Deservicify core (#2458)
* De-servicify router (mostly) Still uses the redraw service, but it no longer has an intermediate service of its own. Also, did a *lot* of test deduplication in this. About 30-40% of the router service tests were already tested on the main router API instance itself. Bundle size decreased from 9560 to 9548 bytes min+gzip. * Merge `m.mount` + `m.redraw`, update router Simplifies the router and redraw mechanism, and makes it much easier to keep predictable. Bundle size down to 9433 bytes min+gzip, docs updated accordingly. * Make `mithril/render` just return the `m.render` function directly. * Deservicify `m.render`, revise `m.route` - You now have to use `mithril/render/render` directly if you want an implicit redraw function. (This will likely be going away in v3.) - Revise `m.route` to only `key` components * Add `redraw` to `m.render`, deservicify requests * Test error logging * Update docs + changelog [skip ci]
This commit is contained in:
parent
db277217f8
commit
1f4b2cf49a
60 changed files with 1212 additions and 1393 deletions
|
|
@ -2,9 +2,8 @@
|
|||
|
||||
var buildPathname = require("../pathname/build")
|
||||
|
||||
module.exports = function($window, Promise) {
|
||||
module.exports = function($window, Promise, oncompletion) {
|
||||
var callbackCount = 0
|
||||
var oncompletion
|
||||
|
||||
function PromiseProxy(executor) {
|
||||
return new Promise(executor)
|
||||
|
|
@ -191,8 +190,5 @@ module.exports = function($window, Promise) {
|
|||
encodeURIComponent(callbackName)
|
||||
$window.document.documentElement.appendChild(script)
|
||||
}),
|
||||
setCompletionCallback: function(callback) {
|
||||
oncompletion = callback
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue