- Update diode-react to scalajs-react 2.0.0-RC3. This change can break applications that use diode-react if they use older versions of scalajs-react.
- This version removes the backwards compatibility with Scala 2.12 because of scalajs-react 2.
- update build/dependencies to support SJS 1.0.0
- Allow cross-building for any ScalaJS version - default is 1.0.0-RC2
- The build uses the
SCALAJS_VERSIONenvironment variable to get the scala.js plugin version for the build - The diode-react sub-project is now only built for 0.6.x builds
- Bump scala cross versions to 2.12.10 and 2.13.1
- Adjust for change where higher kinds are directly supported in 2.13.1
- Cross-Build for Scala 2.12.8 (all projects) and 2.13.0 (for 'core', 'devtools', and 'data' projects only)
- Drops support for Scala 2.11.x because dependencies no longer support it.
- Some small impl changes to support 2.13.0
- Bump uTest and scala.js versions etc... to support 2.13.0
- diode-react only compiles for 2.12 - we can change this after sjs-react itself supports 2.13
- Upgrade to Scala 2.12.8 and Scala.js 0.6.27
- Update diode-react to scalajs-react 1.4.2
- Upgrade to Scala 2.12.6 and Scala.js 0.6.22
- Update diode-react to scalajs-react 1.3.1
- Allow to subscribe to a ZipModel
- Upgrade to Scala 2.12.4 and Scala.js 0.6.19
- Update diode-react to scalajs-react 1.1.0
- Use the existing
startTimeinPendingandPendingStalePotState - Add a hook to log exceptions encountered while processing effects
- Documentation fixes
- Upgrade to Scala 2.11.11, 2.12.2 and Scala.js 0.6.15
- Update diode-react to scalajs-react 1.0.0
- Change license to Apache 2.0 (was MIT)
- New
zoomTomacro to simplify commonzoomRWuse-cases. For example what used to be
circuit.zoomRW(_.a)((m, v) ⇒ m.copy(a = v)).zoomRW(_.i)((m, v) ⇒ m.copy(i = v))can now be expressed with
circuit.zoomTo(_.a.i)- Fixed
RefToto always useAction - Moved Diode under
io.suzakuorganization
- Added
dispatchCBanddispatchNowtoModelProxyto provide a more explicit way of dispatching in aCallbackor directly - Added a Pot.fromOption convenience method (by @vpavkin)
- Circuit
subscribenow usesModelRO[T]in its listener callback so that the listener does not need to care about the type of the model. - Moved many methods from ModelR into its super trait ModelRO
- Support for Scala 2.12
- Updated to Scala.js 0.6.13 (for Scala 2.12 support)
Major change in 1.0.0 was making dispatched actions type safe (fixing #11 in process). Action type safety is based on an implicit type class
ActionType[A] that must be present in scope for any valid action. Easiest way to achieve this is to utilize the provided Action type as a
base for all your actions. If this is not possible, for example you have no control over action classes, you need to provide an instance of
ActionType.
For example if you had something like,
trait MyAction
case class Increase(amount: Int) extends MyAction
case class Decrease(amount: Int) extends MyActionyou can change it to either
trait MyAction extends diode.Action
case class Increase(amount: Int) extends MyAction
case class Decrease(amount: Int) extends MyActionor
trait MyAction
object MyAction {
implicit object MyActionType extends ActionType[MyAction]
}
case class Increase(amount: Int) extends MyAction
case class Decrease(amount: Int) extends MyActionBoth variations work, but it's recommended to use the Action type.
This change also reflects on how action batches and empty actions are expressed. What used to be a Seq[A] is now an ActionBatch and an
empty action is indicated with NoAction instead of None. Both of these new types are subtypes of the new Action type.
The ReactConnector was updated in two ways. The first change affects how you connect your component and requires changes in your code. The
change was needed because the original approach caused a lot of needless unmounting and mounting of the component. In your code you must break
the connect into two parts, where the first part is executed only once creating the connecting wrapper and in the second part the wrapper is used
to connect your own component. For example
staticRoute(root, CustomerRoot) ~> render(connect(_.customerData)(proxy => Customers(proxy)))should be changed to
val customerData = connect(_.customerData)
...
staticRoute(root, CustomerRoot) ~> render(customerData(proxy => Customers(proxy)))If you need to specify the type for the wrapper, use ReactConnectProxy[A], for example val customerData: ReactConnectProxy[CustomerData] in the
example above.
Another change was the addition of an optional key to the component created in connect (fixes #17).
- Support for silent model changes that do not trigger listeners through
ModelUpdateSilentandModelUpdateSilentEffect - Dispatcher supports nested dispatching and queues any dispatch requests received while dispatching a previous action
- Fixed
map,flatMapandflatteninPotto return a correct type ofPotinstead ofEmpty/Ready - Added
ModelRO[S]trait (for "read-only") to abstract reader functionality that does not need to know about the base model type. Can be used to replace types ofModelR[_, S] - Updated to Scala.js 0.6.9
- Fixed a bug in
foldHandlerswhere model changes in earlier handles were not always taken into account - Fixed a bug in
Circuitwhere subscribing to a listener while other listeners were being called resulted in that new subscription being ignored.
- Changed Circuit
actionHandlertype to take current model as parameter to enable chaining of handlers - Added
composeHandlersandfoldHandlersto help building action handler hierarchies combineHandlersis deprecated and replaced withcomposeHandlers- Exposed
rootmodel reader in theModelRtrait
- Introduced
FastEqtypeclass to provide suitable equality checking in various cases using===and=!=operators. PotCollectionfetching is always asynchronous to prevent nasty corner cases- Circuit subscription requires a
ModelRinstead of a simple function - The
modelin Circuit is now private, overrideinitialModelmethod to set the initial value - Updated to Scala.js 0.6.7
- DevTools updated to scalajs-dom 0.9.0 (backwards incompatible change in accessing
indexedDB)
- Split Diode into
diode-coreanddiode-datamodules as the core functionality is quite stable butdiode-data(Potstuff) is still changing quite rapidly. - Added
AsyncActionwhich is a more general base forPotAction. - Simplified
Potby moving everything RetryPolicy related into specificAsyncActionRetriable.
- Added virtual collections (
PotCollection) to support lazy loading of data. - Added
RefTofor referencing data elsewhere in the model. - Added
mapandflatMapto access model values inside containers (such asOption) while maintaining reference equality. - Added
zipto combine two readers while maintaining reference equality. - Added an action processor for persisting application state.
- Moved
Potand related classes fromdiode.utiltodiode.datapackage.
- Upgraded
Effects to be real class(es) instead of just type alias for easier composition etc. - Added animation example using
requestAnimationFrame. - Added TodoMVC example using React.
- Initial version.