A JavaScript Framework for Building Brilliant Applications
MIT License
Bot releases are hidden (Show)
Use markdown for the README badges.
Published by JAForbes over 2 years ago
Use markdown for the README badges.
Published by JAForbes over 2 years ago
This updates the documentation to link to the new Zulip chat room.
Published by JAForbes over 2 years ago
The internal bundler sometimes mangles the words in RegExp literals incorrectly. Please see below.
This PR fixes an oddity I noticed in the way m.request
handles URLSearchParams
object. It now handles it in the same sort of way XHR and Fetch do it.
params:
to m.route.Link
, fix docs (@dead-claudia)
Add params:
to m.route.Link
. Minor fix to docs to reflect reality with m.route.Link
's disabled:
attribute.
Recast the global reads to all be guarded with typeof
, so that if they aren't defined, they're just null
.
m.Fragment = "["
utility for JSX users. (@dead-claudia)
The title says it all, and the diff's obvious. Resolves https://github.com/MithrilJS/mithril.js/issues/2640 and probably others.
Minimizes semver changes on release to the minimum required version bump to satisfy major/minor/patch semver ranges. Minimizes the semver change so that.
An attempt at better demonstrating m.route.Link
with less text. Fixes #2767.
change-log
to changelog
, fix a few assorted bugs (@dead-claudia)
This PR is in two parts: 1. Revise the build system and some of the local dev setup. Fully split ospec from the repo, and add it as a dependency.
rework of #2149. added a meta description parser and meta descriptions to all docs pages. because google. built the docs, inspected the output manually.
use consistent naming of Mithril.js. fix badges in README. Fixes issue #2749.
Fix for error thrown when a value contains non-valid / malformed URI Component. Example: test=%c5%a1%e8ZM%80%82H. will throw "URI malformed".
fixes #2061. @dead-claudia I just redid your change but slightly different in order to handle a mix of wrong and right encodings properly.
This addresses the crucial feature of #2669: text is always represented as virtual text nodes, never as a vnode.text
.
Added guard so that JSON.parse does not fail on IE11 with no content empty string being parsed. Fixes https://github.com/MithrilJS/mithril.js/issues/2624.
The bundler mangles identifier-like strings within RegExps, this works around the problem by not using such RegExps.
Derived from PR #2581. Allows requests to properly reject on event of a timeout.
Removing an extra isLifecycleMethod in the removeAttr method, it isn't needed since it's already checked on the previous line.
Fix issue where ending a stream in the middle of a stream callback would result in erroneous parent stream state for the rest of that emit. Fixes #2601.
Add stream/stream.js
to releases again. Add stream/stream.min.js
now that the process is remotely sane now.
I updated error messages to be much more helpful.
I moved the return statement to the end of define() so that it returns even if the comparison fails.
https://github.com/MithrilJS/mithril.js/runs/6199543939?check_suite_focus=true.
Automated releases, pre-releases, (code) rollbacks and recovery, npm publishing, change log management just by using normal github flow.
Added Flems for Simple Application supporting v2.0.4 of Mithril.js. Fixes Issue #2710.
fixes #2634.
Addresses #2604.
added link to flems.io as an easier way to just try out the framework. -. Documentation has grown a bit stale.
Added power support for the travis.yml file with ppc64le. This is part of the Ubuntu distribution for ppc64le.
As a developer I tried setting up Mithril with Babel and Webpack but failed because of a variety of errors.
This is an attempt at fixing #1759, but there may be more to be added. Feedback welcome. ping @dontwork.
Bumps path-parse from 1.0.6 to 1.0.7. Commits. See full diff in compare view.
Bumps glob-parent from 5.1.0 to 5.1.2. Release notes. Sourced from glob-parent's releases. v5.1.2. Bug Fixes.
Bumps ajv from 6.10.2 to 6.12.6. Release notes. Sourced from ajv's releases. v6.12.6. Fix performance issue of "url" format.
Add Dropdown that shows links to archived versions of the documentation.
In the m.request return value description, add a line informing that error status codes cause the promise to reject.
Naming JSX events according to their documentation produces unexpected results with incorrectly named events when using JSX with Mithril.
Also fixes a broken internal link.
Bumps marked from 0.7.0 to 4.0.10. Release notes. Sourced from marked's releases. v4.0.10. 4.0.10 (2022-01-13). Bug Fixes.
Added flems instead of the current codepen samples.
Content was moved some time ago and linked section no longer exists.
Documentation update.
Bumps hosted-git-info from 2.8.4 to 2.8.9. Changelog. Sourced from hosted-git-info's changelog. 2.8.9 (2021-04-07).
Bumps lodash from 4.17.20 to 4.17.21. Commits. f299b52 Bump to v4.17.21.
Bumps handlebars from 4.7.6 to 4.7.7. Changelog. Sourced from handlebars's changelog. v4.7.7 - February 15th, 2021.
We don't expose this publicly anymore, so there's literally no justification for this file's existence.
When following tutorial and typing everything in, I was confused that Save button didn't work.
"Javascript"/"javascript" → "JavaScript". Fixes #2398, or at least I can't find any more incorrect capitalizations.
Found some typos. Mainly unescaped |
in tables, but also a few other irregularities. Not all problems are visible in the website docs.
Fixed a typo in testing doc page. Currently there is reference to mocha
in the page whereas opsec
is used.
Bumps acorn from 7.1.0 to 7.4.0. Commits. 54efb62 Mark version 7.4.0.
Bumps handlebars from 4.4.2 to 4.7.6. Changelog. Sourced from handlebars's changelog. v4.7.6 - April 3rd, 2020.
Bumps lodash from 4.17.15 to 4.17.20. Commits. ded9bc6 Bump to v4.17.20. 63150ef Documentation fixes.
Bumps minimist from 1.2.0 to 1.2.3. Commits. 6457d74 1.2.3. 38a4d1c even more aggressive checks for protocol pollution.
Offer to install mithril as a webpack plugin. Just makes my life easier by not having to include mithril in every one of my js files.
One of the example is using the antiquated word "slave" for a database replica. I updated the language and tested the change.
While reading through some of the documentation I saw some issues with both the ES6 and m.trust
pages.
There is a small typo in mithril.js, render/render.js. Should read subsequence
rather than subsequece
.
Change the link to point to ospec docs in github. ospec link went to mochajs. issue 2575. N/A. N/A. N/A.
The scrimba version of Mithril 0-60 was built on their beta platform, and doesn't really even work anymore.
update .npmignore so that archives are not included in the resulting package. space/bandwidth savings. fix #2552.
Add an optional cache for faster runs. Add a final report. Don't return anything from exec()
. Cover more files. Look for a "--cache" option.
Recast key docs to be much clearer and more accurate, including a few Flems examples to help intuitively explain things.
m.censor
, adjust m.route.Link
to use it (@dead-claudia)
Add m.censor
. Adjust m.route.Link
to use it. Restructure a few things for better code reuse. Fixes #2472.
As Can I use shows fetch()
supported since Safari 10.1 and iOS Safari 10.3.
I'd like to introduce release dates to the change log files. Release dates are human-friendly and add a bit of historical perspective to change-log files.
Ordinarily, I would not have released this, but it includes a backport of a security fix from v2.0.3. If you're stuck on v1.x, you should really update to this ASAP.
m.parseQueryString
(#2523 @isiahmeadows @Hunter-Dolan)contenteditable
elements (#2516 @isiahmeadows)m.trust
updating (#2516 @isiahmeadows)onbeforeremove
resolving after new nodes are added (#2492 @isiahmeadows)m.parseQueryString
(#2494 @isiahmeadows)v2.0.2 was skipped as it had a critical flaw and was immediately unpublished.
This is really what v2.0.0 was supposed to be, but the npm upload got botched the first time around.
children
are not normalized into vnodes on ingestion; normalization only happens if and when they are ingested by the view (#2155 (thanks to @magikstm for related optimization #2064))m.redraw()
is always asynchronous (#1592)m.mount()
will only render its own root when called, it will not trigger a redraw()
(#1592)vnode.state
(as in vnode.state = ...
) is no longer supported. Instead, an error is thrown if vnode.state
changes upon the invocation of a lifecycle hook.m.request
will no longer reject the Promise on server errors (eg. status >= 400) if the caller supplies an extract
callback. This gives applications more control over handling server responses.null
or undefined
value, they are treated as if they were absent. #1773 (#2174)m.request
errors no longer copy response fields to the error, but instead assign the parsed JSON response to error.response
and the HTTP status code error.code
.attrs
field, respectively), the latter takes precedence, except for class
attributes that are still added together. #2172 (#2174)onbeforeupdate
to allow attrs to block components from even diffing (#2297)m.withAttr
removed. (#2317)data
has now been split to params
and body
and useBody
has been removed in favor of just using body
. (#2361)/asset/:path.../view
. This was previously only available in m.route
route definitions, but it's now usable in both that and where paths are accepted. (#2361)m.request({url: "/api/user/:id/get", params: {id: user.id}})
would result in a request like GET /api/user/1/get
, not one like GET /api/user/1/get?id=1
. If you really need it in both places, pass the same value via two separate parameters with the non-query-string parameter renamed, like in m.request({url: "/api/user/:urlID/get", params: {id: user.id, urlID: user.id}})
. (#2361)m.route.set
, m.request
, and m.jsonp
all use the same path template syntax now, and vary only in how they receive their parameters. Furthermore, declared routes in m.route
shares the same syntax and semantics, but acts in reverse as if via pattern matching. (#2361)options.responseType
now defaults to "json"
if extract
is absent, and deserialize
receives the parsed response, not the raw string. If you want the old behavior, use responseType: "text"
. (#2335)Content-Type: application/json; charset=utf-8
for all XHR methods by default, provided they have a body that's != null
(#2361, #2421)
GET
with bodies, but you can address them through configuring CORS appropriately.GET
methods and only when useBody: true
was passed (the default), and it was always set for them. Now it's automatically omitted when no body is present, so the hole is slightly broadened.null
/undefined
/booleans as strictly unkeyed (#2452 @isiahmeadows)
null
/undefined
at the vnode level, always stringify non-object children that aren't holes (#2452 @isiahmeadows)
true
was equivalent to "true"
and false
was equivalent to ""
.key
parameter for routes now only works globally for components (#2458 @isiahmeadows)
render
still render by diff.mithril/redraw
now just exposes the m.redraw
callback (#2458 @isiahmeadows)
.schedule
, .unschedule
, and .render
properties of the former redrawService
are all removed.mount
in Mithril's source for m.route
. That should help you in finding ways around the removed feature. (It doesn't take that much more code.)m.version
has been removed. If you really need the version for whatever reason, just read the version
field of mithril/package.json
directly. (#2466 @isiahmeadows)m.route.prefix(...)
is now m.route.prefix = ...
. (#2469 @isiahmeadows)
m.route.link
function removed in favor of m.route.Link
component. (#2469 @isiahmeadows)
options
object is accepted as an attribute. This was initially targeting the old m.route.link
function and was transferred to this. (#1930)m.redraw.sync()
(#1592)handleEvent
methods (#1949, #2222).m.request
better error message on JSON parse error - (#2195, @codeclown)m.request
supports timeout
as attr - (#1966)m.request
supports responseType
as attr - (#2193)m.trust()
string (#2097)mithril
and mithril/stream
(#2194 @porsager).
m.*
properties from mithril
are re-exported as named exports in addition to being attached to m
.m()
itself from mithril
is exported as the default export.mithril/stream
's primary export is exported as the default export.m.route
now support -
and .
as delimiters for path segments. This means you can have a route like "/edit/:file.:ext"
. (#2361)
m.route.set
, m.request
, and m.jsonp
, but it was wholly untested for and also undocumented.m.buildPathname
and m.parsePathname
added. (#2361)m.mount(root, null)
to unsubscribe and clean up after a m.route(root, ...)
call. (#2453)redraw
parameter exposed any time a child event handler is used (#2458 @isiahmeadows)m.route.SKIP
can be returned from route resolvers to skip to the next route (#2469 @isiahmeadows)require("mithril")
. You just need to set the necessary globals to something, even if null
or undefined
, so they can be properly used. (#2469 @isiahmeadows)
m.route.Link
and m.route.prefix
.m.request
, provided the background: true
option is set and that an XMLHttpRequest
polyfill is included as necessary.m.render(...)
, m.redraw()
, and m.route(...)
.m.route.set()
causes all mount points to be redrawn (#1592)null
or undefined
#1804 #2082 (#1865, #2130)key
had different tag
values #2128 @JacksonJN (#2130)addEventListener
and removeEventListener
are always used to manage event subscriptions, preventing external interference.m.mount()
/m.redraw()
.Object.prototype
properties can no longer interfere with event listener calls.undefined
(or any non-function), are now correctly removed.oninit
to be called unnecessarily in some cases #1992
Object.prototype.__proto__
setter with key: "__proto__"
in certain situations (#2251)m.render()
are now normalized #2266
{style}
attributes (#2192 @barneycarroll), (#2311 @porsager), (#2312 @isiahmeadows)extract
/serialize
/deserialize
with correct this
value (#2288)mithril
loads mithril/index.js
, not the bundle, so users of mithril/hyperscript
, mithril/render
, and similar see the same Mithril instance as those just using mithril
itself.
https://unpkg.com/mithril
is configured to receive the minified bundle, not the development bundle.mithril.js
, and is not browser-wrapped.async
/await
in Chrome (#2428 @isiahmeadows)onbeforeupdate
returning false, then remaining the same on next redraw (#2447 @isiahmeadows)onbeforeupdate
returns false and then true with new child tree (#2447 @isiahmeadows)?#
and invalid prefixes like #foo#bar
(#2448 @isiahmeadows)contenteditable
check to also check for contentEditable
property name (#2450 @isiahmeadows)Published by dead-claudia about 5 years ago
When publishing, the npm upload got interrupted and it didn't publish properly. So I unpublished it. Don't try installing this version - it won't work!
This is a hotfix release for critical issues discovered in v2.0.0-rc.8.
m.route.Link
selector argument component:
when it should've been called selector:
. https://github.com/MithrilJS/mithril.js/pull/2475 (This is the only breaking change.)ev.preventDefault()
was critically broken, and button values and modifier state was incorrectly tested for. https://github.com/MithrilJS/mithril.js/pull/2476
I also included various docs fixes in this release to clear up some confusion.
children
are not normalized into vnodes on ingestion; normalization only happens if and when they are ingested by the view (#2155 (thanks to @magikstm for related optimization #2064))m.redraw()
is always asynchronous (#1592)m.mount()
will only render its own root when called, it will not trigger a redraw()
(#1592)vnode.state
(as in vnode.state = ...
) is no longer supported. Instead, an error is thrown if vnode.state
changes upon the invocation of a lifecycle hook.m.request
will no longer reject the Promise on server errors (eg. status >= 400) if the caller supplies an extract
callback. This gives applications more control over handling server responses.null
or undefined
value, they are treated as if they were absent. #1773 (#2174)m.request
errors no longer copy response fields to the error, but instead assign the parsed JSON response to error.response
and the HTTP status code error.code
.attrs
field, respectively), the latter takes precedence, except for class
attributes that are still added together. #2172 (#2174)onbeforeupdate
to allow attrs to block components from even diffing (#2297)m.withAttr
removed. (#2317)data
has now been split to params
and body
and useBody
has been removed in favor of just using body
. (#2361)/asset/:path.../view
. This was previously only available in m.route
route definitions, but it's now usable in both that and where paths are accepted. (#2361)m.request({url: "/api/user/:id/get", params: {id: user.id}})
would result in a request like GET /api/user/1/get
, not one like GET /api/user/1/get?id=1
. If you really need it in both places, pass the same value via two separate parameters with the non-query-string parameter renamed, like in m.request({url: "/api/user/:urlID/get", params: {id: user.id, urlID: user.id}})
. (#2361)m.route.set
, m.request
, and m.jsonp
all use the same path template syntax now, and vary only in how they receive their parameters. Furthermore, declared routes in m.route
shares the same syntax and semantics, but acts in reverse as if via pattern matching. (#2361)options.responseType
now defaults to "json"
if extract
is absent, and deserialize
receives the parsed response, not the raw string. If you want the old behavior, use responseType: "text"
. (#2335)Content-Type: application/json; charset=utf-8
for all XHR methods by default, provided they have a body that's != null
(#2361, #2421)
GET
with bodies, but you can address them through configuring CORS appropriately.GET
methods and only when useBody: true
was passed (the default), and it was always set for them. Now it's automatically omitted when no body is present, so the hole is slightly broadened.null
/undefined
/booleans as strictly unkeyed (#2452 @isiahmeadows)
null
/undefined
at the vnode level, always stringify non-object children that aren't holes (#2452 @isiahmeadows)
true
was equivalent to "true"
and false
was equivalent to ""
.key
parameter for routes now only works globally for components (#2458 @isiahmeadows)
render
still render by diff.mithril/redraw
now just exposes the m.redraw
callback (#2458 @isiahmeadows)
.schedule
, .unschedule
, and .render
properties of the former redrawService
are all removed.mount
in Mithril's source for m.route
. That should help you in finding ways around the removed feature. (It doesn't take that much more code.)m.version
has been removed. If you really need the version for whatever reason, just read the version
field of mithril/package.json
directly. (#2466 @isiahmeadows)m.route.prefix(...)
is now m.route.prefix = ...
. (#2469 @isiahmeadows)
m.route.link
function removed in favor of m.route.Link
component. (#2469 @isiahmeadows)
options
object is accepted as an attribute. This was initially targeting the old m.route.link
function and was transferred to this. (#1930)require("mithril")
. You just need to set the necessary globals to something, even if null
or undefined
, so they can be properly used. (#2469 @isiahmeadows)
m.route.Link
and m.route.prefix
.m.request
, provided the background: true
option is set and that an XMLHttpRequest
polyfill is included as necessary.m.render(...)
, m.redraw()
, and m.route(...)
.m.redraw.sync()
(#1592)handleEvent
methods (#1949, #2222).m.request
better error message on JSON parse error - (#2195, @codeclown)m.request
supports timeout
as attr - (#1966)m.request
supports responseType
as attr - (#2193)m.trust()
string (#2097)mithril
and mithril/stream
(#2194 @porsager).
m.*
properties from mithril
are re-exported as named exports in addition to being attached to m
.m()
itself from mithril
is exported as the default export.mithril/stream
's primary export is exported as the default export.m.route
now support -
and .
as delimiters for path segments. This means you can have a route like "/edit/:file.:ext"
. (#2361)
m.route.set
, m.request
, and m.jsonp
, but it was wholly untested for and also undocumented.m.buildPathname
and m.parsePathname
added. (#2361)m.mount(root, null)
to unsubscribe and clean up after a m.route(root, ...)
call. (#2453)redraw
parameter exposed any time a child event handler is used (#2458 @isiahmeadows)m.route.SKIP
can be returned from route resolvers to skip to the next route (#2469 @isiahmeadows)m.route.set()
causes all mount points to be redrawn (#1592)null
or undefined
#1804 #2082 (#1865, #2130)key
had different tag
values #2128 @JacksonJN (#2130)addEventListener
and removeEventListener
are always used to manage event subscriptions, preventing external interference.m.mount()
/m.redraw()
.Object.prototype
properties can no longer interfere with event listener calls.undefined
(or any non-function), are now correctly removed.oninit
to be called unnecessarily in some cases #1992
Object.prototype.__proto__
setter with key: "__proto__"
in certain situations (#2251)m.render()
are now normalized #2266
{style}
attributes (#2192 @barneycarroll), (#2311 @porsager), (#2312 @isiahmeadows)extract
/serialize
/deserialize
with correct this
value (#2288)mithril
loads mithril/index.js
, not the bundle, so users of mithril/hyperscript
, mithril/render
, and similar see the same Mithril instance as those just using mithril
itself.
https://unpkg.com/mithril
is configured to receive the minified bundle, not the development bundle.mithril.js
, and is not browser-wrapped.async
/await
in Chrome (#2428 @isiahmeadows)onbeforeupdate
returning false, then remaining the same on next redraw (#2447 @isiahmeadows)onbeforeupdate
returns false and then true with new child tree (#2447 @isiahmeadows)?#
and invalid prefixes like #foo#bar
(#2448 @isiahmeadows)contenteditable
check to also check for contentEditable
property name (#2450 @isiahmeadows)🚨🚨🚨 This is the final release candidate. There will be no more breaking changes added between now and when v2.0.0 stable is released. What you see here is precisely what to expect from v2.0.0 beyond small bug fixes. 🚨🚨🚨
Few new bug fixes, but a few major breaking changes since v2.0.0-rc.7.
require("mithril/redraw")
now returns the m.redraw
function directly. There is no longer any redrawService
exposed in any way. https://github.com/MithrilJS/mithril.js/pull/2458
m.version
no longer exists. In general, rely on feature detection, not version detection. https://github.com/MithrilJS/mithril.js/pull/2466
m.route.link
method has been replaced with the m.route.Link
component, with a capital L. https://github.com/MithrilJS/mithril.js/pull/2469
m.route.prefix
method has been made a property instead. https://github.com/MithrilJS/mithril.js/pull/2469
And a couple new features:
m.route.SKIP
to skip a route from onmatch
. https://github.com/MithrilJS/mithril.js/pull/2469
require("mithril")
in environments that lack a full DOM implementation. You just need a few of the globals defined, even if just to null
or undefined
, to ensure proper instantiation. https://github.com/MithrilJS/mithril.js/pull/2469
children
are not normalized into vnodes on ingestion; normalization only happens if and when they are ingested by the view (#2155 (thanks to @magikstm for related optimization #2064))m.redraw()
is always asynchronous (#1592)m.mount()
will only render its own root when called, it will not trigger a redraw()
(#1592)vnode.state
(as in vnode.state = ...
) is no longer supported. Instead, an error is thrown if vnode.state
changes upon the invocation of a lifecycle hook.m.request
will no longer reject the Promise on server errors (eg. status >= 400) if the caller supplies an extract
callback. This gives applications more control over handling server responses.null
or undefined
value, they are treated as if they were absent. #1773 (#2174)m.request
errors no longer copy response fields to the error, but instead assign the parsed JSON response to error.response
and the HTTP status code error.code
.attrs
field, respectively), the latter takes precedence, except for class
attributes that are still added together. #2172 (#2174)onbeforeupdate
to allow attrs to block components from even diffing (#2297)m.withAttr
removed. (#2317)data
has now been split to params
and body
and useBody
has been removed in favor of just using body
. (#2361)/asset/:path.../view
. This was previously only available in m.route
route definitions, but it's now usable in both that and where paths are accepted. (#2361)m.request({url: "/api/user/:id/get", params: {id: user.id}})
would result in a request like GET /api/user/1/get
, not one like GET /api/user/1/get?id=1
. If you really need it in both places, pass the same value via two separate parameters with the non-query-string parameter renamed, like in m.request({url: "/api/user/:urlID/get", params: {id: user.id, urlID: user.id}})
. (#2361)m.route.set
, m.request
, and m.jsonp
all use the same path template syntax now, and vary only in how they receive their parameters. Furthermore, declared routes in m.route
shares the same syntax and semantics, but acts in reverse as if via pattern matching. (#2361)options.responseType
now defaults to "json"
if extract
is absent, and deserialize
receives the parsed response, not the raw string. If you want the old behavior, use responseType: "text"
. (#2335)Content-Type: application/json; charset=utf-8
for all XHR methods by default, provided they have a body that's != null
(#2361, #2421)
GET
with bodies, but you can address them through configuring CORS appropriately.GET
methods and only when useBody: true
was passed (the default), and it was always set for them. Now it's automatically omitted when no body is present, so the hole is slightly broadened.null
/undefined
/booleans as strictly unkeyed (#2452 @isiahmeadows)
null
/undefined
at the vnode level, always stringify non-object children that aren't holes (#2452 @isiahmeadows)
true
was equivalent to "true"
and false
was equivalent to ""
.key
parameter for routes now only works globally for components (#2458 @isiahmeadows)
render
still render by diff.mithril/redraw
now just exposes the m.redraw
callback (#2458 @isiahmeadows)
.schedule
, .unschedule
, and .render
properties of the former redrawService
are all removed.mount
in Mithril's source for m.route
. That should help you in finding ways around the removed feature. (It doesn't take that much more code.)m.version
has been removed. If you really need the version for whatever reason, just read the version
field of mithril/package.json
directly. (#2466 @isiahmeadows)m.route.prefix(...)
is now m.route.prefix = ...
. (#2469 @isiahmeadows)
m.route.link
function removed in favor of m.route.Link
component. (#2469 @isiahmeadows)
options
object is accepted as an attribute. This was initially targeting the old m.route.link
function and was transferred to this. (#1930)require("mithril")
. You just need to set the necessary globals to something, even if null
or undefined
, so they can be properly used. (#2469 @isiahmeadows)
m.route.Link
and m.route.prefix
.m.request
, provided the background: true
option is set and that an XMLHttpRequest
polyfill is included as necessary.m.render(...)
, m.redraw()
, and m.route(...)
.m.redraw.sync()
(#1592)handleEvent
methods (#1949, #2222).m.request
better error message on JSON parse error - (#2195, @codeclown)m.request
supports timeout
as attr - (#1966)m.request
supports responseType
as attr - (#2193)m.trust()
string (#2097)mithril
and mithril/stream
(#2194 @porsager).
m.*
properties from mithril
are re-exported as named exports in addition to being attached to m
.m()
itself from mithril
is exported as the default export.mithril/stream
's primary export is exported as the default export.m.route
now support -
and .
as delimiters for path segments. This means you can have a route like "/edit/:file.:ext"
. (#2361)
m.route.set
, m.request
, and m.jsonp
, but it was wholly untested for and also undocumented.m.buildPathname
and m.parsePathname
added. (#2361)m.mount(root, null)
to unsubscribe and clean up after a m.route(root, ...)
call. (#2453)redraw
parameter exposed any time a child event handler is used (#2458 @isiahmeadows)m.route.SKIP
can be returned from route resolvers to skip to the next route (#2469 @isiahmeadows)m.route.set()
causes all mount points to be redrawn (#1592)null
or undefined
#1804 #2082 (#1865, #2130)key
had different tag
values #2128 @JacksonJN (#2130)addEventListener
and removeEventListener
are always used to manage event subscriptions, preventing external interference.m.mount()
/m.redraw()
.Object.prototype
properties can no longer interfere with event listener calls.undefined
(or any non-function), are now correctly removed.oninit
to be called unnecessarily in some cases #1992
Object.prototype.__proto__
setter with key: "__proto__"
in certain situations (#2251)m.render()
are now normalized #2266
{style}
attributes (#2192 @barneycarroll), (#2311 @porsager), (#2312 @isiahmeadows)extract
/serialize
/deserialize
with correct this
value (#2288)mithril
loads mithril/index.js
, not the bundle, so users of mithril/hyperscript
, mithril/render
, and similar see the same Mithril instance as those just using mithril
itself.
https://unpkg.com/mithril
is configured to receive the minified bundle, not the development bundle.mithril.js
, and is not browser-wrapped.async
/await
in Chrome (#2428 @isiahmeadows)onbeforeupdate
returning false, then remaining the same on next redraw (#2447 @isiahmeadows)onbeforeupdate
returns false and then true with new child tree (#2447 @isiahmeadows)?#
and invalid prefixes like #foo#bar
(#2448 @isiahmeadows)contenteditable
check to also check for contentEditable
property name (#2450 @isiahmeadows)Several new bug fixes, including the dreaded Uncaught TypeError: Cannot read property 'onbeforeupdate' of undefined
on Chrome, TypeError: vnode.state is undefined
on Firefox, but there are also a few breaking changes since v2.0.0-rc.6:
#a=b&c=d
as equivalent to ?a=b&c=d
. This aligns with the URL spec better, where #
is itself illegal in URL fragments. https://github.com/MithrilJS/mithril.js/pull/2448
null
/undefined
are no longer valid in keyed fragments. https://github.com/MithrilJS/mithril.js/pull/2452
true
, false
, and undefined
are all normalized to null
at the vnode level. Unlikely to break people, as the past behavior was so counterintuitive and inconsistent people actively avoided using it as it had a knack for creating subtle bugs. https://github.com/MithrilJS/mithril.js/pull/2452
children
are not normalized into vnodes on ingestion; normalization only happens if and when they are ingested by the view (#2155 (thanks to @magikstm for related optimization #2064))m.redraw()
is always asynchronous (#1592)m.mount()
will only render its own root when called, it will not trigger a redraw()
(#1592)vnode.state
(as in vnode.state = ...
) is no longer supported. Instead, an error is thrown if vnode.state
changes upon the invocation of a lifecycle hook.m.request
will no longer reject the Promise on server errors (eg. status >= 400) if the caller supplies an extract
callback. This gives applications more control over handling server responses.null
or undefined
value, they are treated as if they were absent. #1773 (#2174)m.request
errors no longer copy response fields to the error, but instead assign the parsed JSON response to error.response
and the HTTP status code error.code
.attrs
field, respectively), the latter takes precedence, except for class
attributes that are still added together. #2172 (#2174)onbeforeupdate
to allow attrs to block components from even diffing (#2297)m.withAttr
removed. (#2317)data
has now been split to params
and body
and useBody
has been removed in favor of just using body
. (#2361)/asset/:path.../view
. This was previously only available in m.route
route definitions, but it's now usable in both that and where paths are accepted. (#2361)m.request({url: "/api/user/:id/get", params: {id: user.id}})
would result in a request like GET /api/user/1/get
, not one like GET /api/user/1/get?id=1
. If you really need it in both places, pass the same value via two separate parameters with the non-query-string parameter renamed, like in m.request({url: "/api/user/:urlID/get", params: {id: user.id, urlID: user.id}})
. (#2361)m.route.set
, m.request
, and m.jsonp
all use the same path template syntax now, and vary only in how they receive their parameters. Furthermore, declared routes in m.route
shares the same syntax and semantics, but acts in reverse as if via pattern matching. (#2361)options.responseType
now defaults to "json"
if extract
is absent, and deserialize
receives the parsed response, not the raw string. If you want the old behavior, use responseType: "text"
. (#2335)Content-Type: application/json; charset=utf-8
for all XHR methods by default, provided they have a body that's != null
(#2361, #2421)
GET
with bodies, but you can address them through configuring CORS appropriately.GET
methods and only when useBody: true
was passed (the default), and it was always set for them. Now it's automatically omitted when no body is present, so the hole is slightly broadened.null
/undefined
/booleans as strictly unkeyed (#2452 @isiahmeadows)
null
/undefined
at the vnode level, always stringify non-object children that aren't holes (#2452 @isiahmeadows)
true
was equivalent to "true"
and false
was equivalent to ""
.m.redraw.sync()
(#1592)handleEvent
methods (#1949, #2222).m.route.link
accepts an optional options
object (#1930)m.request
better error message on JSON parse error - (#2195, @codeclown)m.request
supports timeout
as attr - (#1966)m.request
supports responseType
as attr - (#2193)m.trust()
string (#2097)mithril
and mithril/stream
(#2194 @porsager).
m.*
properties from mithril
are re-exported as named exports in addition to being attached to m
.m()
itself from mithril
is exported as the default export.mithril/stream
's primary export is exported as the default export.m.route
now support -
and .
as delimiters for path segments. This means you can have a route like "/edit/:file.:ext"
. (#2361)
m.route.set
, m.request
, and m.jsonp
, but it was wholly untested for and also undocumented.m.buildPathname
and m.parsePathname
added. (#2361)m.mount(root, null)
to unsubscribe and clean up after a m.route(root, ...)
call. (#2453)m.version
returns the previous version string for what's in next
. (#2453)
next
, you should hopefully know what you're doing. If you need stability, don't use next
. (This is also why I'm not labelling it as a breaking change.)m.route.set()
causes all mount points to be redrawn (#1592)null
or undefined
#1804 #2082 (#1865, #2130)key
had different tag
values #2128 @JacksonJN (#2130)addEventListener
and removeEventListener
are always used to manage event subscriptions, preventing external interference.m.mount()
/m.redraw()
.Object.prototype
properties can no longer interfere with event listener calls.undefined
(or any non-function), are now correctly removed.oninit
to be called unnecessarily in some cases #1992
Object.prototype.__proto__
setter with key: "__proto__"
in certain situations (#2251)m.render()
are now normalized #2266
{style}
attributes (#2192 @barneycarroll), (#2311 @porsager), (#2312 @isiahmeadows)extract
/serialize
/deserialize
with correct this
value (#2288)mithril
loads mithril/index.js
, not the bundle, so users of mithril/hyperscript
, mithril/render
, and similar see the same Mithril instance as those just using mithril
itself.
https://unpkg.com/mithril
is configured to receive the minified bundle, not the development bundle.mithril.js
, and is not browser-wrapped.async
/await
in Chrome (#2428 @isiahmeadows)onbeforeupdate
returning false, then remaining the same on next redraw (#2447 @isiahmeadows)onbeforeupdate
returns false and then true with new child tree (#2447 @isiahmeadows)?#
and invalid prefixes like #foo#bar
(#2448 @isiahmeadows)contenteditable
check to also check for contentEditable
property name (#2450 @isiahmeadows)Note: this is a pure bug fix update. It includes #2421, but is otherwise basically the same as v2.0.0-rc.5.
children
are not normalized into vnodes on ingestion; normalization only happens if and when they are ingested by the view (#2155 (thanks to @magikstm for related optimization #2064))m.redraw()
is always asynchronous (#1592)m.mount()
will only render its own root when called, it will not trigger a redraw()
(#1592)vnode.state
(as in vnode.state = ...
) is no longer supported. Instead, an error is thrown if vnode.state
changes upon the invocation of a lifecycle hook.m.request
will no longer reject the Promise on server errors (eg. status >= 400) if the caller supplies an extract
callback. This gives applications more control over handling server responses.null
or undefined
value, they are treated as if they were absent. #1773 (#2174)m.request
errors no longer copy response fields to the error, but instead assign the parsed JSON response to error.response
and the HTTP status code error.code
.attrs
field, respectively), the latter takes precedence, except for class
attributes that are still added together. #2172 (#2174)onbeforeupdate
to allow attrs to block components from even diffing (#2297)m.withAttr
removed. (#2317)data
has now been split to params
and body
and useBody
has been removed in favor of just using body
. (#2361)/asset/:path.../view
. This was previously only available in m.route
route definitions, but it's now usable in both that and where paths are accepted. (#2361)m.request({url: "/api/user/:id/get", params: {id: user.id}})
would result in a request like GET /api/user/1/get
, not one like GET /api/user/1/get?id=1
. If you really need it in both places, pass the same value via two separate parameters with the non-query-string parameter renamed, like in m.request({url: "/api/user/:urlID/get", params: {id: user.id, urlID: user.id}})
. (#2361)m.route.set
, m.request
, and m.jsonp
all use the same path template syntax now, and vary only in how they receive their parameters. Furthermore, declared routes in m.route
shares the same syntax and semantics, but acts in reverse as if via pattern matching. (#2361)options.responseType
now defaults to "json"
if extract
is absent, and deserialize
receives the parsed response, not the raw string. If you want the old behavior, use responseType: "text"
. (#2335)Content-Type: application/json; charset=utf-8
for all XHR methods by default, provided they have a body that's != null
(#2361, #2421)
GET
with bodies, but you can address them through configuring CORS appropriately.GET
methods and only when useBody: true
was passed (the default), and it was always set for them. Now it's automatically omitted when no body is present, so the hole is slightly broadened.m.redraw.sync()
(#1592)handleEvent
methods (#1949, #2222).m.route.link
accepts an optional options
object (#1930)m.request
better error message on JSON parse error - (#2195, @codeclown)m.request
supports timeout
as attr - (#1966)m.request
supports responseType
as attr - (#2193)m.trust()
string (#2097)mithril
and mithril/stream
(#2194 @porsager).
m.*
properties from mithril
are re-exported as named exports in addition to being attached to m
.m()
itself from mithril
is exported as the default export.mithril/stream
's primary export is exported as the default export.m.route
now support -
and .
as delimiters for path segments. This means you can have a route like "/edit/:file.:ext"
. (#2361)
m.route.set
, m.request
, and m.jsonp
, but it was wholly untested for and also undocumented.m.buildPathname
and m.parsePathname
added. (#2361)m.route.set()
causes all mount points to be redrawn (#1592)null
or undefined
#1804 #2082 (#1865, #2130)key
had different tag
values #2128 @JacksonJN (#2130)addEventListener
and removeEventListener
are always used to manage event subscriptions, preventing external interference.m.mount()
/m.redraw()
.Object.prototype
properties can no longer interfere with event listener calls.undefined
(or any non-function), are now correctly removed.oninit
to be called unnecessarily in some cases #1992
Object.prototype.__proto__
setter with key: "__proto__"
in certain situations (#2251)m.render()
are now normalized #2266
{style}
attributes (#2192 @barneycarroll), (#2311 @porsager), (#2312 @isiahmeadows)extract
/serialize
/deserialize
with correct this
value (#2288)mithril
loads mithril/index.js
, not the bundle, so users of mithril/hyperscript
, mithril/render
, and similar see the same Mithril instance as those just using mithril
itself.
https://unpkg.com/mithril
is configured to receive the minified bundle, not the development bundle.mithril.js
, and is not browser-wrapped.PSA: ESM builds have been dropped from v2.0 as of #2366. Please update your scripts accordingly, as only CommonJS is supported until we can figure out a way to enable ES module support in a way that doesn't break everyone. (I've had to help troubleshoot way too many Webpack issues to feel comfortable with side-by-side support.)
If all goes well with this release candidate, it will go stable as you see it now.
children
are not normalized into vnodes on ingestion; normalization only happens if and when they are ingested by the view (#2155 (thanks to @magikstm for related optimization #2064))m.redraw()
is always asynchronous (#1592)m.mount()
will only render its own root when called, it will not trigger a redraw()
(#1592)vnode.state
(as in vnode.state = ...
) is no longer supported. Instead, an error is thrown if vnode.state
changes upon the invocation of a lifecycle hook.m.request
will no longer reject the Promise on server errors (eg. status >= 400) if the caller supplies an extract
callback. This gives applications more control over handling server responses.null
or undefined
value, they are treated as if they were absent. #1773 (#2174)m.request
errors no longer copy response fields to the error, but instead assign the parsed JSON response to error.response
and the HTTP status code error.code
.attrs
field, respectively), the latter takes precedence, except for class
attributes that are still added together. #2172 (#2174)onbeforeupdate
to allow attrs to block components from even diffing (#2297)m.withAttr
removed. (#2317)data
has now been split to params
and body
and useBody
has been removed in favor of just using body
. (#2361)/asset/:path.../view
. This was previously only available in m.route
route definitions, but it's now usable in both that and where paths are accepted. (#2361)m.request({url: "/api/user/:id/get", params: {id: user.id}})
would result in a request like GET /api/user/1/get
, not one like GET /api/user/1/get?id=1
. If you really need it in both places, pass the same value via two separate parameters with the non-query-string parameter renamed, like in m.request({url: "/api/user/:urlID/get", params: {id: user.id, urlID: user.id}})
. (#2361)m.route.set
, m.request
, and m.jsonp
all use the same path template syntax now, and vary only in how they receive their parameters. Furthermore, declared routes in m.route
shares the same syntax and semantics, but acts in reverse as if via pattern matching. (#2361)options.responseType
now defaults to "json"
if extract
is absent, and deserialize
receives the parsed response, not the raw string. If you want the old behavior, use responseType: "text"
. (#2335)m.redraw.sync()
(#1592)handleEvent
methods (#1949, #2222).m.route.link
accepts an optional options
object (#1930)m.request
better error message on JSON parse error - (#2195, @codeclown)m.request
supports timeout
as attr - (#1966)m.request
supports responseType
as attr - (#2193)m.trust()
string (#2097)mithril
and mithril/stream
(#2194 @porsager).
m.*
properties from mithril
are re-exported as named exports in addition to being attached to m
.m()
itself from mithril
is exported as the default export.mithril/stream
's primary export is exported as the default export.m.route
now support -
and .
as delimiters for path segments. This means you can have a route like "/edit/:file.:ext"
. (#2361)
m.route.set
, m.request
, and m.jsonp
, but it was wholly untested for and also undocumented.m.buildPathname
and m.parsePathname
added. (#2361)m.route.set()
causes all mount points to be redrawn (#1592)null
or undefined
#1804 #2082 (#1865, #2130)key
had different tag
values #2128 @JacksonJN (#2130)addEventListener
and removeEventListener
are always used to manage event subscriptions, preventing external interference.m.mount()
/m.redraw()
.Object.prototype
properties can no longer interfere with event listener calls.undefined
(or any non-function), are now correctly removed.oninit
to be called unnecessarily in some cases #1992
Object.prototype.__proto__
setter with key: "__proto__"
in certain situations (#2251)m.render()
are now normalized #2266
{style}
attributes (#2192 @barneycarroll), (#2311 @porsager), (#2312 @isiahmeadows)extract
/serialize
/deserialize
with correct this
value (#2288)mithril
loads mithril/index.js
, not the bundle, so users of mithril/hyperscript
, mithril/render
, and similar see the same Mithril instance as those just using mithril
itself.
https://unpkg.com/mithril
is configured to receive the minified bundle, not the development bundle.mithril.js
, and is not browser-wrapped.children
are not normalized into vnodes on ingestion; normalization only happens if and when they are ingested by the view (#2155 (thanks to @magikstm for related optimization #2064))m.redraw()
is always asynchronous (#1592)m.mount()
will only render its own root when called, it will not trigger a redraw()
(#1592)vnode.state
(as in vnode.state = ...
) is no longer supported. Instead, an error is thrown if vnode.state
changes upon the invocation of a lifecycle hook.m.request
will no longer reject the Promise on server errors (eg. status >= 400) if the caller supplies an extract
callback. This gives applications more control over handling server responses.null
or undefined
value, they are treated as if they were absent. #1773 (#2174)m.request
errors no longer copy response fields to the error, but instead assign the parsed JSON response to error.response
and the HTTP status code error.code
.attrs
field, respectively), the latter takes precedence, except for class
attributes that are still added together. #2172 (#2174)onbeforeupdate
to allow attrs to block components from even diffing (#2297)m.withAttr
removed. (#2317)m.redraw.sync()
(#1592)handleEvent
methods (#1949, #2222).m.route.link
accepts an optional options
object (#1930)m.request
better error message on JSON parse error - (#2195, @codeclown)m.request
supports timeout
as attr - (#1966)m.request
supports responseType
as attr - (#2193)m.trust()
string (#2097)stream.lift
as a user-friendly alternative to merge -> map
or combine
#1944
mithril
and mithril/stream
(#2194 @porsager).
m.*
properties from mithril
are re-exported as named exports in addition to being attached to m
.m()
itself from mithril
is exported as the default export.mithril/stream
's primary export is exported as the default export.m.route.set()
causes all mount points to be redrawn (#1592)null
or undefined
#1804 #2082 (#1865, #2130)key
had different tag
values #2128 @JacksonJN (#2130)addEventListener
and removeEventListener
are always used to manage event subscriptions, preventing external interference.m.mount()
/m.redraw()
.Object.prototype
properties can no longer interfere with event listener calls.undefined
(or any non-function), are now correctly removed.oninit
to be called unnecessarily in some cases #1992
Object.prototype.__proto__
setter with key: "__proto__"
in certain situations (#2251)m.render()
are now normalized #2266
{style}
attributes (#2192 @barneycarroll), (#2311 @porsager), (#2312 @isiahmeadows)extract
/serialize
/deserialize
with correct this
value (#2288)m.withAttr
and m.prop
were removed (#2317 @isiahmeadows)children
are not normalized into vnodes on ingestion; normalization only happens if and when they are ingested by the view (#2155 (thanks to @magikstm for related optimization #2064))m.redraw()
is always asynchronous (#1592)m.mount()
will only render its own root when called, it will not trigger a redraw()
(#1592)vnode.state
(as in vnode.state = ...
) is no longer supported. Instead, an error is thrown if vnode.state
changes upon the invocation of a lifecycle hook.m.request
will no longer reject the Promise on server errors (eg. status >= 400) if the caller supplies an extract
callback. This gives applications more control over handling server responses.null
or undefined
value, they are treated as if they were absent. #1773 (#2174)m.request
errors no longer copy response fields to the error, but instead assign the parsed JSON response to error.response
and the HTTP status code error.code
.attrs
field, respectively), the latter takes precedence, except for class
attributes that are still added together. #2172 (#2174)onbeforeupdate
to allow attrs to block components from even diffing (#2297)m.withAttr
removed. (#2317)m.redraw.sync()
(#1592)handleEvent
methods (#1949, #2222).m.route.link
accepts an optional options
object (#1930)m.request
better error message on JSON parse error - (#2195, @codeclown)m.request
supports timeout
as attr - (#1966)m.request
supports responseType
as attr - (#2193)m.trust()
string (#2097)stream.lift
as a user-friendly alternative to merge -> map
or combine
#1944
mithril
and mithril/stream
(#2194 @porsager).
m.*
properties from mithril
are re-exported as named exports in addition to being attached to m
.m()
itself from mithril
is exported as the default export.mithril/stream
's primary export is exported as the default export.m.route.set()
causes all mount points to be redrawn (#1592)null
or undefined
#1804 #2082 (#1865, #2130)key
had different tag
values #2128 @JacksonJN (#2130)addEventListener
and removeEventListener
are always used to manage event subscriptions, preventing external interference.m.mount()
/m.redraw()
.Object.prototype
properties can no longer interfere with event listener calls.undefined
(or any non-function), are now correctly removed.oninit
to be called unnecessarily in some cases #1992
Object.prototype.__proto__
setter with key: "__proto__"
in certain situations (#2251)m.render()
are now normalized #2266
{style}
attributes (#2192 @barneycarroll), (#2311 @porsager), (#2312 @isiahmeadows)extract
/serialize
/deserialize
with correct this
value (#2288)children
are not normalized into vnodes on ingestion; normalization only happens if and when they are ingested by the view (#2155 (thanks to @magikstm for related optimization #2064))m.redraw()
is always asynchronous (#1592)m.mount()
will only render its own root when called, it will not trigger a redraw()
(#1592)vnode.state
(as in vnode.state = ...
) is no longer supported. Instead, an error is thrown if vnode.state
changes upon the invocation of a lifecycle hook.m.request
will no longer reject the Promise on server errors (eg. status >= 400) if the caller supplies an extract
callback. This gives applications more control over handling server responses.null
or undefined
value, they are treated as if they were absent. #1773 (#2174)attrs
field, respectively), the latter takes precedence, except for class
attributes that are still added together. #2172 (#2174)m.redraw.sync()
(#1592)handleEvent
methods (#1949, #2222).m.route.link
accepts an optional options
object (#1930)m.request
better error message on JSON parse error - (#2195, @codeclown)m.request
supports timeout
as attr - (#1966)m.request
supports responseType
as attr - (#2193)m.trust()
string (#2097)m.prop()
(#2268)m.route.set()
causes all mount points to be redrawn (#1592)null
or undefined
#1804 #2082 (#1865, #2130)key
had different tag
values #2128 @JacksonJN (#2130)addEventListener
and removeEventListener
are always used to manage event subscriptions, preventing external interference.m.mount()
/m.redraw()
.Object.prototype
properties can no longer interfere with event listener calls.undefined
(or any non-function), are now correctly removed.oninit
to be called unnecessarily in some cases #1992
Object.prototype.__proto__
setter with key: "__proto__"
in certain situations (#2251)m.render()
are now normalized #2266
children
are not normalized into vnodes on ingestion; normalization only happens if and when they are ingested by the view (#2155 (thanks to @magikstm for related optimization #2064))m.redraw()
is always asynchronous (#1592)m.mount()
will only render its own root when called, it will not trigger a redraw()
(#1592)vnode.state
(as in vnode.state = ...
) is no longer supported. Instead, an error is thrown if vnode.state
changes upon the invocation of a lifecycle hook.m.request
will no longer reject the Promise on server errors (eg. status >= 400) if the caller supplies an extract
callback. This gives applications more control over handling server responses.null
or undefined
value, they are treated as if they were absent. #1773 (#2174)attrs
field, respectively), the latter takes precedence, except for class
attributes that are still added together. #2172 (#2174)m.redraw.sync()
(#1592)handleEvent
methods (#1949, #2222).m.route.link
accepts an optional options
object (#1930)m.request
better error message on JSON parse error - (#2195, @codeclown)m.request
supports timeout
as attr - (#1966)m.request
supports responseType
as attr - (#2193)m.trust()
string (#2097)m.route.set()
causes all mount points to be redrawn (#1592)null
or undefined
#1804 #2082 (#1865, #2130)key
had different tag
values #2128 @JacksonJN (#2130)addEventListener
and removeEventListener
are always used to manage event subscriptions, preventing external interference.m.mount()
/m.redraw()
.Object.prototype
properties can no longer interfere with event listener calls.undefined
(or any non-function), are now correctly removed.oninit
to be called unnecessarily in some cases #1992
Object.prototype.__proto__
setter with key: "__proto__"
in certain situations (#2251)Published by tivac over 6 years ago