:steam_locomotive::train: - sturdy 4kb frontend framework
$ npm install choo@next
Hashes are by default ignored when routing. To enable hash routing, set the hash option to true choo({ hash: true })
.
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.
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
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 https://polyfill.io 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.
href
, query
, route
and params
missing on state during store init (https://github.com/choojs/choo/pull/695)Republishing to npm to remove unrelated files that were accidentally included in the package.
The :100:th release tag!
app
argument to app.use
callback (@seangenabe in #665)Thanks everyone that helped on this release!
popState
eventapp.mount(selector)
when server rendering, exposing the target selector as app.selector
for templatingWe upgraded our router to fix some inconsistencies in routing, courtesy of @marcbachmann! :tada:
Thanks everyone that helped on this release!
navigate
event. Modifies the state before the render event is triggered. Therefore this fixes #530, #553, #549, #610, #463.emit
as an alias to .emitter.emit
bel/raw
via choo/html/raw