Shadaj Slinky Versions Save

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

v0.6.3

4 years ago

Highlights :tada:

Bug Fixes

  • Fix crashes when calling setState on a component with Props set to some subtype of Function1 PR #295
  • Support useCallback with a function that takes arguments PR #290
  • Fix false warnings on @react classes if -Ywarn-value-discard scalac option was used PR #296
  • Update the IntelliJ support plugin to be compatible with IntelliJ 2019.2 PR #297

v0.6.2

4 years ago

Highlights :tada:

  • Support optional attributes, see the docs for more details PR #275
  • Slinky now has full support for Scala 2.13 PR #269

Bug Fixes

  • Improve error messages when an @react class extends the wrong supertype PR #277
  • Add shortcut apply for @react functional components to mirror class components PR #278

v0.6.1

5 years ago

Highlights :tada:

  • Allow SetStateHookCallback to be used as plain functions through an implicit conversion PR #268
  • Allow React.memo to specify a custom compare function PR #260
  • New facades for React Native: SafeAreaView, TouchableHighlight, TouchableOpacity, and Platform PR #214

Bug Fixes

  • Allow component defined in a functional component to have any access control PR #262
  • Fix incorrect typing of SyntheticMouseEvent.clientX PR #261

v0.6.0

5 years ago

Highlights :tada:

  • Casting the target property of event objects is no longer needed! Now all event handlers are statically typed based on the tag they are being placed on PR #243
  • Support React Hooks for functional components, see the docs for more details PR #227
  • Add support for writing functional components, see the docs for more details PR #217
  • Slinky docs have moved to a new domain, slinky.dev!

Breaking Changes :warning:

  • The tags API has seen some major changes, please take a look at the separate section below for more details PR #243
  • Half-built components and tags, which have some props provided but have not yet been converted to a ReactElement, cannot be reused. Doing this will result in a runtime exception pointing out where the reuse occured PR #253
  • Components using the static lifecycle functions getDerivedStateFromProps and getDerivedStateFromError must now override the functions with a val PR #248
  • The React.forwardRef function now takes a FunctionalComponentTakingRef, which can be creating by creating a functional component that takes an additional ref parameter: FunctionalComponent((props, ref) => ...) PR #227
  • The ReactRef type is no longer variant in its type parameters to increase type safety PR #227
  • Components will no longer have their displayName when built in fullOptJS mode, this results in a ~2.5% decrease in bundle size and matches behavior with JS where names are obfuscated in production builds PR #217
  • The Option writer now emits null instead of js.undefined for a value of None PR #247

Bug Fixes

  • Make the static lifecycle functions getDerivedStateFromProps and getDerivedStateFromError work correctly in fullOptJS mode PR #248
  • Fix issues around state not updating when setting an Option to None in hot reloading mode PR #247
  • Handle null return values in derived state functions to not update the state PR #249
  • Fix the js.| reader/writer implementations to work correctly in fullOptJS mode PR #248
  • Support autoComplete attr for input and form elements PR #225
  • Fix capitalization of rowSpan/colSpan attribute (used to be rowspan/colspan) PR #224

Tags API Changes

This release includes a major rewrite of the tags API that eliminates the need to cast the target value of event handlers and improves typesafety by more closely matching the official React API. As a result of these changes, event handlers defined in separate methods or code abstracting over tags may not initially compile with this new version.

Event Handlers

Event handlers in previous versions of Slinky were functions from a DOM event type to Unit. In React, events are normalized into SyntheticEvents that provide a common subset of the events generated in different browsers. In this version of Slinky, event handlers have been changed to all be functions from a synthetic event type (one of SyntheticEvent[TargetDOMType, UnderlyingDOMEventType], SyntheticMouseEvent[TargetDOMType], SyntheticTouchEvent[TargetDOMType], etc based on the event being listened to) to Unit.

This means that explicit references to the DOM event type will no longer compile and will need to be replaced by an appropriate synthetic event type with a TargetDOMType that matches the DOM type of the tag the listener is being placed on. This change ensures that the properties available on event objects at compile time match those generated by React.

Abstracting over Tags

In previous versions of Slinky, passing in attributes required the first attribute to be passed separately from the varargs parameter containing the rest of the attributes. In this version, the API for constructing tags has changed from apply taking either (firstTag: AttrPair[...], otherTags: AttrPair[...]*) or ReactElement* to just a single method taking (mods: TagMod[...]*) with conversions from AttrPair and ReactElement to this type.

So code that passed in generated attributes like:

div(firstAttr, restAttrs: _*)

will now need to be replaced by

div(allAttrs: _*)

Similarly, in components that previously took in AttrPair and ReactElement separately, this can now be simplified to just take TagMods.

v0.5.2

5 years ago

Highlights :tada:

  • Slinky support for Scala 2.13 is now built with 2.13.0-M5 PR #202
  • Add support for getDerivedStateFromError from React 16.6 PR #206
  • Add support for the Suspense component from React 16.6 PR #216
  • Use default parameters to fill in missing props on exported components PR #221

Bug Fixes

  • Fix compile errors when overriding the Props or State type PR #220
  • Update library injector setup to support IntelliJ 2018.3 and newer PR #219
  • Fix runtime crash when initialState() is defined with the extra parentheses PR #218
  • Fix compilation errors in generating Reader/Writer when private objects are involved PR #205

v0.5.1

5 years ago

Features

  • Support reading and writing scala.Array PR #187
  • Support the defaultValue attribute for specifying a default form value without overriding user inputs PR #186

Bug Fixes

  • Prevent crashes with components that store an Option of an opaque type in their State PR #198
  • Fix ComponentWrappers not picking up manually defined Reader/Writers for the State type PR #190
  • Fix how the IntelliJ extensions handles components that have a children prop but no other props PR #189
  • Fix errors when using the @react macro annotation with Component/StatelessComponent imported locally PR #188
  • Fix the value attribute not being available on the select and textarea tags PR #177
  • Bump Scala version to 2.12.7 and SBT/plugin versions as well PR #176

v0.5.0

5 years ago

See the Blog Post!

Highlights :tada:

  • Slinky now supports Scala 2.13.0-M4 PR #153!
  • Magnolia has been replaced with a custom implementation tuned for Slinky, resulting in smaller bundles and faster compilation PR #159, PR #159
  • Readers and writers for props are no longer needed for hot-reloading components, resulting in up to 2x drops in bundle size in fastOptJS mode PR #162
  • React element construction is now more aggressively inlined, resulting in smaller bundle sizes (5% drop in the docs project) PR #156
  • Switch from React VR package to React 360 PR #141

Breaking Changes

  • Scalameta is no longer used for the @react macro, and Macro Paradise is used instead. See the docs for updated installation instructions for adding the Macro Paradise compiler plugin PR #132
  • @react components taking a children prop now generate an apply method with the children moved to a curried parameter to better match JSX PR #161
  • React VR components are no longer supported, the slinky-vr module now points to React 360 PR #141
  • ReactComponentClass now takes a type parameter of the Props type to improve type safety with higher-order components. Existing uses can be safely replaced with ReactComponentClass[_] PR #157
  • Interop with Scala.js React now requires using the explicit conversions .toSlinky and .toScalaJSReact PR #151

v0.4.3

5 years ago
  • Support pointer events that were added in React 16.4 PR #149
  • Bump Scala.js React version for interop to 1.2.0 PR #148
  • Fix errors in Reader/Writer provider macros with Scala versions > 2.12.4 PR #147
  • Support storing any type as a default context value PR #136
  • Set sourcemaps to use GitHub URLs so that they load in other apps PR #143

v0.4.2

6 years ago
  • Fix bug with shouldComponentUpdate not being registered correctly on the component PR #135

v0.4.1

6 years ago
  • Fix exception when hot-reloading Slinky components PR #134