Skip to content

Commit

Permalink
Kick promise polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanHoyer committed May 30, 2022
1 parent 517661a commit 41ed423
Show file tree
Hide file tree
Showing 20 changed files with 41 additions and 1,388 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

## What is Mithril.js?

A modern client-side JavaScript framework for building Single Page Applications. It's small (<!-- size -->10.05 KB<!-- /size --> gzipped), fast and provides routing and XHR utilities out of the box.
A modern client-side JavaScript framework for building Single Page Applications. It's small (<!-- size -->9.34 KB<!-- /size --> gzipped), fast and provides routing and XHR utilities out of the box.

Mithril.js is used by companies like Vimeo and Nike, and open source platforms like Lichess 👍.

Expand Down
1 change: 0 additions & 1 deletion api/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

var Vnode = require("../render/vnode")
var m = require("../render/hyperscript")
var Promise = require("../promise/promise")

var buildPathname = require("../pathname/build")
var parsePathname = require("../pathname/parse")
Expand Down
1 change: 0 additions & 1 deletion api/tests/test-router.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ var m = require("../../render/hyperscript")
var coreRenderer = require("../../render/render")
var apiMountRedraw = require("../../api/mount-redraw")
var apiRouter = require("../../api/router")
var Promise = require("../../promise/promise")

o.spec("route", function() {
// Note: the `n` parameter used in calls to this are generally found by
Expand Down
2 changes: 1 addition & 1 deletion docs/animation.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ var FancyComponent = {

`vnode.dom` points to the root DOM element of the component (`<div class="fancy">`). We use the classList API here to add an `exit` class to `<div class="fancy">`.

Then we return a [Promise](promise.md) that resolves when the `animationend` event fires. When we return a promise from `onbeforeremove`, Mithril.js waits until the promise is resolved and only then it removes the element. In this case, it waits for the exit animation to finish.
Then we return a Promise that resolves when the `animationend` event fires. When we return a promise from `onbeforeremove`, Mithril.js waits until the promise is resolved and only then it removes the element. In this case, it waits for the exit animation to finish.

We can verify that both the enter and exit animations work by mounting the `Toggler` component:

Expand Down
1 change: 0 additions & 1 deletion docs/nav-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
- [m.trust](trust.md)
- [m.fragment](fragment.md)
- [m.redraw](redraw.md)
- [Promise](promise.md)
- Optional
- [Stream](stream.md)
- Tooling
Expand Down
315 changes: 0 additions & 315 deletions docs/promise.md

This file was deleted.

4 changes: 2 additions & 2 deletions docs/request.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Documentation on m.request(), a utility for making XHR/AJAX requests

### Description

Makes XHR (aka AJAX) requests, and returns a [promise](promise.md)
Makes XHR (aka AJAX) requests, and returns a promise

```javascript
m.request({
Expand Down Expand Up @@ -95,7 +95,7 @@ m.request({
})
```

A call to `m.request` returns a [promise](promise.md) and triggers a redraw upon completion of its promise chain.
A call to `m.request` returns a promise and triggers a redraw upon completion of its promise chain.

By default, `m.request` assumes the response is in JSON format and parses it into a JavaScript object (or array).

Expand Down
1 change: 0 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ m.buildQueryString = require("./querystring/build")
m.parsePathname = require("./pathname/parse")
m.buildPathname = require("./pathname/build")
m.vnode = require("./render/vnode")
m.PromisePolyfill = require("./promise/polyfill")
m.censor = require("./util/censor")

module.exports = m
Loading

0 comments on commit 41ed423

Please sign in to comment.