Skip to content
Write Scala.js React apps just like you would in ES6
Scala Shell
Branch: master
Clone or download

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows Update scalajs-react:core to 1.7.0 (#365) May 19, 2020
core Allow exporting external components to `ReactComponentClass` instances ( May 31, 2020
coreIntellijSupport Update slinky to support the newest intellij (#328) Feb 18, 2020
docs Release v0.6.5 Apr 10, 2020
docsMacros/src/main/scala/slinky/docs Rename the me.shadaj.slinky package to just slinky (#103) Jan 25, 2018
generator Introduce linting with Scalafix and enable SBT turbo and ReloadOnSour… Jan 27, 2020
history Introduce Scalafmt (#323) Feb 3, 2020
hot Store hot reloading proxies in a module to support Scala.js 1.0 (#335) Mar 1, 2020
native Update scalatest to 3.1.2 (#364) May 17, 2020
project Update sbt-scalafix to 0.9.16 (#374) May 29, 2020
reactrouter Introduce Scalafmt (#323) Feb 3, 2020
readWrite Upgrade Scala.JS, Scalafmt and SBT (#327) Feb 21, 2020
scalajsReactInterop Update scalajs-react:core to 1.7.0 (#365) May 19, 2020
testRenderer Add facades for the `act` testing function (#376) May 30, 2020
tests Allow exporting external components to `ReactComponentClass` instances ( May 31, 2020
vr Update scalatest to 3.1.2 (#364) May 17, 2020
web Update scalajs-dom to 1.0.0 (#362) May 17, 2020
.gitignore Update publishing setup Oct 9, 2019
.scalafix.conf
.scalafmt.conf Update scalafmt-core to 2.4.2 (#350) Apr 6, 2020
CHANGELOG.md Allow exporting external components to `ReactComponentClass` instances ( May 31, 2020
CODE_OF_CONDUCT.md Add code of conduct Jan 22, 2020
LICENSE Add MIT license Aug 6, 2017
README.md Electron doc (#339) Apr 7, 2020
build.sbt Update scalajs-react:core to 1.7.0 (#365) May 19, 2020
logo.png Add logo to README Aug 7, 2017
logo.svg Add logo to README Aug 7, 2017
package.json Add support for Scala.js 1.0.0-RC2 (#321) Jan 31, 2020
publish.sbt Upgrade Scala.JS, Scalafmt and SBT (#327) Feb 21, 2020
publish.sh Upgrade Scala.JS, Scalafmt and SBT (#327) Feb 21, 2020
secrets.tar.enc Fix publishing setup Jan 22, 2020

README.md

Write Scala.js React apps just like you would in ES6

Get started at slinky.dev

What is Slinky?

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

Contributing

Slinky is split up into several submodules:

  • core contains the React.js facades and APIs for creating components and interfaces to external components
  • web contains bindings to React DOM and definitions for the HTML/SVG tag API
  • reactrouter contains bindings to React Router
  • history contains a facade for the HTML5 history API
  • native contains bindings to React Native and external component definitions for native UI elements
  • vr contains bindings to React 360 and external component definitions for VR UI elements
  • readWrite contains the Reader and Writer typeclasses used to persist state for hot reloading
  • hot contains the entrypoint for enabling hot-reloading
  • scalajsReactInterop implements automatic conversions between Slinky and Scala.js React types
  • testRenderer contains bindings to react-test-renderer for unit testing components
  • coreIntellijSupport contains IntelliJ-specific support for the @react macro annotation
  • tests contains the unit tests for the above modules (except native and vr which have local tests)
  • docs and docsMacros contains 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/updateIntellij

And then import the project again.

You can’t perform that action at this time.