Commit graph

45 commits

Author SHA1 Message Date
Barney Carroll
31d2ed4be8 Tests use hyperscript instead of manually constructing nodes 2022-02-12 12:19:35 +01:00
Isiah Meadows
9f0dc2ab46
Runtime-deprecate ospec, change change-log to changelog, fix a few assorted bugs (#2578) 2020-09-29 13:27:07 -07:00
Isiah Meadows
d4551f49f5
Add streams to releases again, include minified bundle, drop in… (#2539)
* Minify stream, add stream stuff to releases again

* Kill off a lot of tech debt, drop internal utilities from npm

1. Kill `module/`, internalize `bundler/`, privatize `test-utils/`

We've been telling people to move elsewhere from these for a while, and
it's about time we just pull the plug here and finally remove them.

- We officially removed the bundler from the public API in v2.0, and
  that was the only one of these that was ever publicly documented.
  Usage should be low enough by now it shouldn't break anyone- I'm not
  seeing bundler bugs being reported anymore, either.
- The `module/` utility was so narrow and caveat-filled that I'm not
  sure anyone really used it (even us core Mithril devs never really
  used it), and we only had it documented in the repo folder it lived
  in. I think only one bug was ever filed, and it's because it somehow
  ended up completely non-functional without any of us realizing it.
- The test utilities were meant to be internal from day 1, but people
  started using it despite us core developers constantly telling people
  to look elsewhere and even the docs recommending specific alternatives
  without mention of our internal mocks. (Now if people would RTFM,
  that'd be nice...)

2. Add dedicated HTML test files to verify ospec and the promise
   polyfill, and ensure the promise tests are in pure ES5.

These are made specially for those and should be much easier to just run
now.

3. Fix the benchmark script to use the real DOM in browsers and to not
   require as many dependencies to create. Also, tweak them to be much
   more effective and precise on what's being tested.

Previously, it was rendering to the HTML file itself, while now it's
rendering to the `body`. This means in browsers, it's triggering layout
and everything, benchmarking how well Mithril optimizes for style and
layout recalcs, too. It also puts some pressure on the hyperscript
parser attribute application, so that can be noticed as well.

* Update dependencies
2019-10-03 04:58:14 -04:00
Isiah Meadows
1f4b2cf49a
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]
2019-07-07 18:28:43 -04:00
Isiah Meadows
8eed896859
Track XHR replacements correctly (#2455)
* Track XHR replacements correctly

Fixes #2439

* Update docs [skip ci]
2019-07-05 19:50:51 -04:00
Isiah Meadows
85bfd0f77d
Clarify pathname docs, follow spec with fragments (#2448)
* Clarify pathname docs, follow spec with fragments

- Valid URLs must not contain a `#` within its fragment.
  https://github.com/MithrilJS/mithril.js/issues/2445
- Our docs were a little confusing and misleading - `m.pathname` isn't
  aware of URLs, just path names.
- Removed the relevant extension to `m.parseQueryString` required to
  support the hash parsing extension. Now we just shave it off and
  ignore it.
- Fix support for arbitrary prefixes, so prefixes like `?#` are
  handled correctly.
- Add a bunch of tests to cover various areas of confusion and unusual
  edge cases.

* Update with PR [skip ci]
2019-07-03 06:22:25 -04:00
Isiah Meadows
4a641092dc
Officially drop IE9-10 support, pull out our hacks (#2296)
- I also fixed a bunch of related comments
- I had to polyfill `requestAnimationFrame` for Node
- Drive-by: run `eslint . --fix`
- Drive-by: update transpiling info in CONTRIBUTING.md
- Drive-by: we aren't the only ones going semicolon-free
2018-11-27 18:04:15 -05:00
Isiah Meadows
4d579c50b6
Revert "Fix #1771 and probably others (#2286)" (#2299)
4f68984f2f
2018-11-14 19:26:23 -05:00
Isiah Meadows
4f68984f2f
Fix #1771 and probably others (#2286)
This is *super* subtle, and IMHO Chrome did exactly the wrong thing
here.
2018-11-14 15:35:00 -05:00
Pierre-Yves Gérardy
6283aa4a7d [render/render] Test for removing styles and assorted domMock changes 2018-06-01 21:27:02 +02:00
Pierre-Yves Gérardy
b39f4f683d [domMock] Better accuracy for namespaced elements 2018-06-01 21:27:02 +02:00
Pierre-Yves Gérardy
9136585fe4 [DOM Mock] Fix insertBefore when the reference node follows the moving child in a nodeList 2018-04-23 13:52:03 +02:00
Pierre-Yves Gérardy
fdd34f9726 [mocks] Add some support for parsing SVG using the DOMParser API and innerHTML 2018-03-06 01:12:32 +01:00
magikstm
e64a322bcf Correct test scripts 2017-12-30 04:44:00 -05:00
Pierre-Yves Gérardy
12d3540d47 domMock: implement event propagation 2017-12-03 01:16:22 +01:00
Isiah Meadows
348bed0a7e Allow xlink:href to get removed, fix option.value in mock 2017-10-01 19:34:12 -04:00
tkilliansc
b4856a9ecd fix issue 1919 2017-08-03 13:48:19 -07:00
Pierre-Yves Gérardy
0e0ed7c45d Lint 2017-06-14 00:15:08 +02:00
Pierre-Yves Gerardy
b004c20f0c Make m.redraw() strictly asynchronous 2017-06-13 15:20:29 +02:00
Pierre-Yves Gérardy
894152440b Add tests for #1870 2017-06-12 18:26:45 +02:00
Pierre-Yves Gerardy
195263d226 [test-utils/domMock] restore Attr.nodeValue for backwards compatibility 2017-05-29 13:59:31 +02:00
Pierre-Yves Gerardy
e031fe49a1 [test-utils/domMock] improve attributes handling 2017-05-28 18:26:09 +02:00
Pierre-Yves Gerardy
d0ee256390 [mocks] make location.onhashchange debounced async 2017-04-01 16:48:22 +02:00
Gyandeep Singh
daf5a64697 Chore: Fix lint issues and add indent with tabs 2017-03-11 15:54:41 -06:00
Isiah Meadows
1cc5fa5ba7 "use strict" and other linty fixes 2017-03-03 18:24:38 -05:00
Pierre-Yves Gerardy
eccea68212 Add test-utils/components.js and its tests 2017-02-19 02:14:15 +01:00
Leo Horie
9ad16858a5 #1520 ospec: report duplicate test names 2017-01-08 13:05:27 -05:00
Leo Horie
de07a54881 add support for route state #1480 2016-12-17 21:50:04 -05:00
Pierre-Yves Gerardy
7cab626980 Add a short browserMock test suite 2016-12-07 17:07:37 +01:00
Leo Horie
ff7ce37476 allow dom level 1 events to be removed #1385 2016-11-04 12:33:36 -04:00
Leo Horie
40251c6c16 #1342 update m.route.link target if href changes 2016-10-04 12:19:55 -04:00
Leo Horie
b8ef290acd improved bundler, handle width/height atts 2016-09-23 10:31:33 -04:00
Pierre-Yves Gerardy
bffe87e053 Fix the domMock cssText implementation 2016-08-11 17:53:01 +02:00
Pierre-Yves Gerardy
5fd2e99831 Fix the domMock and domMock tests for cssText support 2016-08-05 12:43:31 +02:00
impinball
c9f1778dc9 Make callAsync a little less flaky 2016-08-03 07:21:15 -04:00
Leo Horie
e8e0bae726 make setPath always async 2016-07-01 13:03:07 -04:00
impinball
b4fb21475c Add editorconfig, resolve differences
This includes newlines, tabs, among other things.
2016-06-18 03:22:12 -04:00
Leo Horie
693c87f5f1 fix svg class updates 2016-06-07 20:20:30 -04:00
Leo Horie
41ac2bf002 rename ajaxt o xhr, expose jsonp 2016-05-26 15:22:36 -04:00
Leo Horie
e7420e72e1 more tests 2016-05-24 23:16:43 -04:00
Leo Horie
977239d207 rename limiter to throttle and refactor
- don't inject raf/setTimeout since we can't really mock them w/ a good degree of timing accuracy anyways

fix some unrelated tests
2016-05-19 23:24:04 -04:00
Leo Horie
f4c1d4a998 cleanup and styling 2016-05-11 11:52:41 -04:00
Leo Horie
d5371533a7 fix attribute syncing for input, select, textarea
optimize events
2016-05-10 01:55:48 -04:00
Leo Horie
b17bd250b7 support all events 2016-05-06 10:11:31 -04:00
Leo Horie
559369016d initial commit (work in progress) 2016-04-20 20:02:37 -04:00