Choo v7.0.0-0 Release Notes

Release Date: 2019-06-12 // over 3 years ago
  • Install

    $ npm install [email protected]

    0️⃣ Hash routing has been disabled by default (#699)

    0️⃣ Hashes are by default ignored when routing. To enable hash routing, set the hash option to true choo({ hash: true }).

    Match route before intializing stores (#698)

    This means that href, query, param and route are exposed on state before stores are initialized. This can be usefull while setting up the initial state.

    State is not mutated during server side render (#649)

    Prior to this change, when calling toString, changes to state would persist in-between renders. This could lead to a polluted state. This change also clears all event listeners before initializing stores, meaning your listeners are ensured to only trigger once, even on consecutive calls of toString.

    ⚡️ If you were doing server side rendering prior to this update, you were probably plucking at the application state after rendering to get at the generated state. You can now be assured that it is only the state that is passed in to toString that is mutated and can e.g. be used to expose initialState to the client.

    var html = app.toString('/', state)- var title = app.state.title+ var title = state.title

    👉 Use Object.assign instead of xtend (#616)

    💻 This change has an effect on browser support. By removing the dependency xtend, bundle size is reduced but support for IE11 is dropped. We recommend the polyfill service which will detect legacy browsers and load the appropiate polyfills.

    Note: The dependency xtend has been dropped in all other tools in the choo universe, i.e. choo-devtools and choo-service-worker etc.