Allow Mithril to be loaded in non-browser environments without modification (#2633)
This commit is contained in:
parent
3ad404039f
commit
045e4f720a
5 changed files with 5 additions and 4 deletions
|
|
@ -36,6 +36,7 @@ PSA: changes to [`mithril/stream`](stream.md) are now specified in this changelo
|
||||||
- Fix issue where new redraw handlers weren't copied over on update. ([#2578](https://github.com/MithrilJS/mithril.js/pull/2578) [@isiahmeadows](https://github.com/isiahmeadows))
|
- Fix issue where new redraw handlers weren't copied over on update. ([#2578](https://github.com/MithrilJS/mithril.js/pull/2578) [@isiahmeadows](https://github.com/isiahmeadows))
|
||||||
- Make changes to file inputs gracefully handled, and don't break if the current value and old value mismatch (and the new value isn't empty), but instead just log an error. ([#2578](https://github.com/MithrilJS/mithril.js/pull/2578) [@isiahmeadows](https://github.com/isiahmeadows))
|
- Make changes to file inputs gracefully handled, and don't break if the current value and old value mismatch (and the new value isn't empty), but instead just log an error. ([#2578](https://github.com/MithrilJS/mithril.js/pull/2578) [@isiahmeadows](https://github.com/isiahmeadows))
|
||||||
- This mainly exists just to kick the can down the road - this is the only case I'm aware of where the DOM itself would be responsible for throwing an error. A proper fix to the greater issue of error handling is much more complex, and I'd rather not block users any longer over this one specific issue.
|
- This mainly exists just to kick the can down the road - this is the only case I'm aware of where the DOM itself would be responsible for throwing an error. A proper fix to the greater issue of error handling is much more complex, and I'd rather not block users any longer over this one specific issue.
|
||||||
|
- Allow Mithril to be loaded in non-browser environments without modification. ([#2633](https://github.com/MithrilJS/mithril.js/pull/2633) [@isiahmeadows](https://github.com/isiahmeadows))
|
||||||
|
|
||||||
Important note: if you were using any of these undocumented tools, they are no longer available as of this release. This is not considered a breaking change as they were written for internal usage and as of v2 are all 100% unsupported in userland.
|
Important note: if you were using any of these undocumented tools, they are no longer available as of this release. This is not considered a breaking change as they were written for internal usage and as of v2 are all 100% unsupported in userland.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,4 +2,4 @@
|
||||||
|
|
||||||
var render = require("./render")
|
var render = require("./render")
|
||||||
|
|
||||||
module.exports = require("./api/mount-redraw")(render, requestAnimationFrame, console)
|
module.exports = require("./api/mount-redraw")(render, typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : null, typeof console !== "undefined" ? console : null)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
"use strict"
|
"use strict"
|
||||||
|
|
||||||
module.exports = require("./render/render")(window)
|
module.exports = require("./render/render")(typeof window !== "undefined" ? window : null)
|
||||||
|
|
|
||||||
|
|
@ -3,4 +3,4 @@
|
||||||
var PromisePolyfill = require("./promise/promise")
|
var PromisePolyfill = require("./promise/promise")
|
||||||
var mountRedraw = require("./mount-redraw")
|
var mountRedraw = require("./mount-redraw")
|
||||||
|
|
||||||
module.exports = require("./request/request")(window, PromisePolyfill, mountRedraw.redraw)
|
module.exports = require("./request/request")(typeof window !== "undefined" ? window : null, PromisePolyfill, mountRedraw.redraw)
|
||||||
|
|
|
||||||
2
route.js
2
route.js
|
|
@ -2,4 +2,4 @@
|
||||||
|
|
||||||
var mountRedraw = require("./mount-redraw")
|
var mountRedraw = require("./mount-redraw")
|
||||||
|
|
||||||
module.exports = require("./api/router")(window, mountRedraw)
|
module.exports = require("./api/router")(typeof window !== "undefined" ? window : null, mountRedraw)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue