mirror of
https://github.com/flarum/framework.git
synced 2024-11-29 04:33:47 +08:00
1.5 KiB
1.5 KiB
Changes
- Mithril
- See changes from v0.2.x @ https://mithril.js.org/migration-v02x.html
- Kept
m.prop
andm.withAttr
- Actual Promises are used now instead of
m.deferred
- Component
- Use new Mithril lifecycle hooks (
component.config
is gone)- When implementing your own, you must call
super.<hook>(vnode)
to updatethis.attrs
- When implementing your own, you must call
component.render
now doesn't use the current state instance- this is because of how Mithril v2 works
- now calls mithril on the component class (not instance) and its props
- Use new Mithril lifecycle hooks (
- Translator
- Added
app.translator.transText
, automatically extracts text fromtranslator.trans
output
- Added
- Utils
- Changed
computed
util to require multiple keys to be passed as an array SubtreeRetainer
now has anupdate
method instead ofretain
, and its output is used inonbeforeupdate
lifecycle hookEvented
util is now a class instead of an objectformatNumber
now usesNumber.prototype.toLocaleString
with the current application locale, and supports passing an options object (eg. for currency formatting - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NumberFormat/resolvedOptions#Description)
- Changed
- Modals
app.modal.show
now takes the Modal class (not instance) and optional props (app.modal.show(ForgotPasswordModal, props)
)
Forum
- Forum Application
- Renamed to
Forum
app.search
is no longer global, extend usingextend
- Renamed to