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
|
|
@ -10,10 +10,8 @@ o.spec("request", function() {
|
|||
var mock, request, complete
|
||||
o.beforeEach(function() {
|
||||
mock = xhrMock()
|
||||
var requestService = Request(mock, PromisePolyfill)
|
||||
request = requestService.request
|
||||
complete = o.spy()
|
||||
requestService.setCompletionCallback(complete)
|
||||
request = Request(mock, PromisePolyfill, complete).request
|
||||
})
|
||||
|
||||
o.spec("success", function() {
|
||||
|
|
@ -835,10 +833,7 @@ o.spec("request", function() {
|
|||
// if you use the polyfill, as it's based on `setImmediate` (falling
|
||||
// back to `setTimeout`), and promise microtasks are run at higher
|
||||
// priority than either of those.
|
||||
var requestService = Request(mock, Promise)
|
||||
request = requestService.request
|
||||
complete = o.spy()
|
||||
requestService.setCompletionCallback(complete)
|
||||
request = Request(mock, Promise, complete).request
|
||||
mock.$defineRoutes({
|
||||
"GET /item": function() {
|
||||
return {status: 200, responseText: "[]"}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue