Write Scala.js React apps just like you would in ES6
Get started at slinky.dev
Slinky is a framework for writing React apps in Scala with an experience just like using ES6.
Slinky lets you:
- Write React components in Scala with an API that mirrors vanilla React
- Implement interfaces to other React libraries with automatic conversions between Scala and JS types
- Write apps for React Native, React 360, and Electron, including the ability to share code with web apps
- Develop apps iteratively with included hot-reloading support
Slinky is split up into several submodules:
corecontains the React.js facades and APIs for creating components and interfaces to external componentswebcontains bindings to React DOM and definitions for the HTML/SVG tag APIreactroutercontains bindings to React Routerhistorycontains a facade for the HTML5 history APInativecontains bindings to React Native and external component definitions for native UI elementsvrcontains bindings to React 360 and external component definitions for VR UI elementsreadWritecontains theReaderandWritertypeclasses used to persist state for hot reloadinghotcontains the entrypoint for enabling hot-reloadingscalajsReactInteropimplements automatic conversions between Slinky and Scala.js React typestestRenderercontains bindings toreact-test-rendererfor unit testing componentscoreIntellijSupportcontains IntelliJ-specific support for the@reactmacro annotationtestscontains the unit tests for the above modules (except native and vr which have local tests)docsanddocsMacroscontains the documentation site, which is a Slinky app itself
To run the main unit tests, first install the dependencies by running npm install inside the tests folder, then from the base folder run sbt tests/test. Similarly for React Native tests, run npm install inside the native folder, then from the base folder run sbt native/test.
Note to IntelliJ IDEA users. When you try to import Slinky SBT definition in IDEA and encounter an exception like
java.nio.file.NoSuchFileException: /Users/someuser/.slinkyPluginIC/sdk/192.6817.14/plugins, you should
try to download required IntelliJ files for plugin subproject manually before importing:
sbt coreIntellijSupport/updateIntellijAnd then import the project again.
