Commit graph

176 commits

Author SHA1 Message Date
Stephan Hoyer
9906e23118 Fix naming 2022-03-02 07:35:35 +01:00
Stephan Hoyer
885b3f9442 Consistent naming of Mithril.js 2022-02-19 12:06:39 +01:00
Matias Kinnunen
2b5c2f0fc6
Fix inconsistent capitalizations of "JavaScript" (#2639) 2020-11-08 15:05:17 -08: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
Pierre-Yves Gérardy
4a3a486d80
Pimp the docs linter (and assorted changes) (#2553)
### Pimp the docs linter (and assorted changes)

 #### `scripts/lint-docs.js`

- Add an optional cache for faster runs
- Add a final report
- Don't return anything from `exec()`
- Cover more files

 #### `scripts/_command.js`

- Look for a "--cache" option

 #### `package.json` scripts

- Added `watch:lint-docs`
- Added `cleanup:lint` to remove the eslint and lint-docs cache files
- Changed `lint:docs` to use the `--cache` option
- Added `test:js` so that we can run the test suite without the linter
- Changed `test` to defer to `test:js`

 #### Actual lint fixes:

- Bad link in a migration guide
- The unicode dashes in the "https://en.wikipedia.org/wiki/Subject–verb–object" are not escaped by marked

### Some more lint-docs pimping

#### `scripts/lint-docs.js`

- some code reorg and cleanup (take a hint from the local coding conventions)
- fix misc bugs
- pass a User-Agent header to the requests
- even nicer reporting

#### `package.json`

- bump the @babel/parser dep to the latest

#### Docs

- tweaks based on lints missed due to previous bugs

### Docs: use the github page for velocity.js, the home page has too many errors.

Co-Authored-By: Isiah Meadows <contact@isiahmeadows.com>
2019-12-19 23:40:52 +01: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
b98ab29efd
Make errors and their messages more accurate and helpful (#2536)
Also, I normalized them to all be sentences for consistency, and I moved
the reentrancy check from `m.mount` to `m.render` to be a little more
helpful. The router change during mounting is inconsequential and only
to avoid the new modified error, and the change to the update loop is to
send the original error if an error occurred while initializing the
default route. (This is all around more useful anyways.)

And while I was at it, I fixed an obscure bug with sync redraws.
2019-09-30 16:08:04 -04:00
soulofmischief
0ea6a190b6 Fix assertion descriptions (#2405)
* Fix assertion descriptions

Move return statement to the end of define()

* ospec: Fix assertion definitions

* Fix typo in assertion

* Add test for descriptions being returned on fail

* Reference result instead of self in returned description method

* Fix style errors
2019-09-22 03:35:07 -04:00
Már Örlygsson
8ef0c2cd79 docs: Add release dates to all change-log files (#2513)
* docs: Add release dates to all change-log files

* docs: Add dates for the most recent releases

[skip ci]
2019-08-21 18:55:34 -04:00
Isiah Meadows
98d6553988 ospec@4.0.1 2019-08-18 15:30:31 -04:00
Isiah Meadows
30ad45caa1
Unbreak m.trust (#2516)
* Actually return the check from `maybeSetContentEditable`

Lots of code paths relied on it being a boolean. When I created the
abstraction, I apparently forgot to make sure it returned the result.

* Don't forget to copy instance state over

* Update changelog [skip ci]

* Fix changelog issue [skip ci]
2019-08-17 14:38:10 -04:00
Sam Szreter
bcf427a3be Fix ospec --require with relative paths (#2511) 2019-08-11 11:23:23 -04:00
Isiah Meadows
39fa2b32c2
Fix #1881 + related ospec bug (#2492)
* Fix #1881 + related ospec bug

* Test duplicate resolves, update changelog
2019-07-26 18:19:40 -04:00
Isiah Meadows
123c0dbaf1
Missed a link 2019-07-24 05:59:55 -04:00
Isiah Meadows
ba1498b61b ospec 4.0.0 2019-07-24 05:57:56 -04:00
Isiah Meadows
234b1c9302 Update migration, fix various minor issues
- Lot of people couldn't migrate to v1 and plan to reevaluate when v2 is
  released.
- It's "npm" not "NPM". It doesn't stand for anything, and it never
  has - it was initially chosen simply because it was easy to type.
  It has a lot of unofficial backronyms with "Node Package Manager"
  being one of the most common ones, but it's never officially stood
  for anything as an acronym *or* initialism.
- Fixed a few errors in the change log, like non-breaking changes being
  included in the "Breaking Changes" section and an inaccuracy in the
  summary of a particular change.
- Fixed RawGit URLs to point to GitHack, which is a lighter proxy that
  offloads caching to Cloudflare instead of also implementing it itself.
  (It also just uses nginx for all the important server logic, so it
  scales better.)
- Add a few more v0.2 references as appropriate
2019-07-24 05:01:20 -04:00
Isiah Meadows
20f0759103
Fix docs (#2482)
* Fix #2414, address part of #1687

Also cleared the CSS up to be a lot more readable instead of smooshed
into a single line.

* Redo the testing docs page

- Addresses another part of #1687
- Also, fix a few linter issues in the ospec binary

* Add note about third-party cookies, tweak a line

* Make the JSX comparison much more meaningful

And let the code speak for itself. Don't fuel the flame wars any more
than what they've already become. We should be *unopinionated*, and so
I've updated those docs to remove the existing opinion.

* Remove a bunch of outdated ES6 references

* Remove the CSS page
2019-07-23 16:33:56 -04:00
Isiah Meadows
b17b00e9eb
Drop ESM support (#2366)
* Drop ESM support

* Add `"unpkg"` field
2019-05-29 09:24:10 -04:00
Isiah Meadows
beb129c5fb Prepare ospec@3.1.0, mithril-stream@2.0.0
Also, correct the change logs to be much more consistent between each
other and ensure the ospec and stream change logs are linked to from
Mithril's primary change log.
2019-02-07 04:10:12 -05:00
Isiah Meadows
415862880d Forgot to revert ospec/package.json [skip ci] 2019-02-05 13:41:34 -05:00
Isiah Meadows
2ab559fdd0 Not updating ospec yet (I lack permissions) [skip ci] 2019-02-05 13:34:43 -05:00
Isiah Meadows
99a61a09dc
Update a few dependencies, update ospec to version 3.1.0 (#2370) 2019-02-05 13:20:55 -05: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
Robin (Robert) Thomas
b5219920ab Ospec: expose messages for passing tests, in addition to failing tests (#2227)
* ospec: all results, failing and passing, include .message and .context

Previously only failing tests had .message and .context.

* Updated docs

* Function was ugly

* Ospec verbose passing tests: put changelog update in right place
2018-11-21 15:47:10 -05:00
Robin (Robert) Thomas
0fd1bc9cae Add 'throws'/'notThrows' assertion to Ospec for error reporting (#2255)
* Ospec: added assertion that function does/doesnt throw error

* Ospec.throws passes npm test

* Ospec.throws: Address requested changes

* Ospec: message comparison support for .throws/.notthrows

Credit to @maranomynet, #2227
2018-11-21 15:46:34 -05:00
Rasmus Porsager
c3896b92e6 output mithril, stream and ospec esm versions on build - fixes #2112 (#2194)
* output mithril, stream and ospec esm versions on build

* Add esm bundles

* [request] Clearer error message for JSON deserialization failure (#2195)

* Bundled output for commit fd7cf8041e [skip ci]

* Fix #1714 conditionally halting stream (#2200)

* Fix #1714 conditionally halting stream

* Add note in changelog

* Do not include stream as named export in mithril.esm.js

* Rename mithril.min.esm.js to mithril.esm.min.js

* Add esm files to eslintignore

* Add named exports

* Add hyperscript `m` as named export

* Add builds with export changes

* checkout regular bundled files

* Change .esm.js to .mjs

* Update pkg module to point to .mjs

* Fix for export names to avoid collision

* Updated bundled files
2018-11-14 15:37:08 -05:00
Isiah Meadows
97b6125654 Fixing bugs introduced by the big next merge
- Update package-lock.json
- Remove (failing) dupe ospec suite

Git didn't *quite* do the right thing here, so I had to fix a few
things.
2018-10-25 14:35:05 -04:00
Isiah Meadows
2635070734 Merge branch 'next' 2018-10-25 14:23:33 -04:00
Isiah Meadows
1ecc30a064 Fix custom elements attribute application, improve key checking
- Fix custom elements attribute application to acknowledge that not all
  custom elements operate purely based on attributes. (Plus, those
  blasted things are verbose as heck when you're working with them in
  raw form. It's also not that uncommon for functionality to be exposed
  via property and *not* attribute.)
- Don't memoize the normalized value when we 1. only use it once in each
  branch, and 2. only use it for a few special cases.
- Centralize the "has property key" code, so it's easier to tune and
  read. I also inlined a couple functions while I was at it since they
  were small and only used once.
- Actually test for how attributes are applied to raw DOM elements vs
  when we choose to use keys. When I first developed the patch, it
  silently worked, when I should've been breaking things.
2018-09-20 15:08:49 -04:00
Isiah Meadows
f844cc8134 Add functionality for inspecting arbitrary past calls
This made it much easier to debug multiple calls while developing this
patch.
2018-09-20 15:08:49 -04:00
Pierre-Yves Gérardy
e46d03f467 [ospec] v3.0.1 2018-06-30 20:28:28 +02:00
Rasmus Porsager
ecfa59c016 Fix glob inclusion on npm install 2018-06-30 20:19:24 +02:00
Pierre-Yves Gérardy
f39081b2a5 [opec] v3.0.0 2018-06-23 22:11:54 +02:00
Pierre-Yves Gérardy
3f5cabc5c5 Chore: Normalize the way we use eslint-disable 2018-06-01 21:27:02 +02:00
Pierre-Yves Gérardy
9016091adf [ospec] docs and change log 2018-06-01 20:22:58 +02:00
Pierre-Yves Gérardy
14695c9cda [ospec] Allow more than one o.only() test 2018-06-01 20:22:58 +02:00
Pierre-Yves Gérardy
a23216b987 [ospec] record errors thrown in tests as failures 2018-06-01 20:22:58 +02:00
Pierre-Yves Gérardy
53597871b8 [ospec] don't allocate task for tests that will be skipped in o.only mode, fix stack overflow 2018-06-01 20:22:58 +02:00
Pierre-Yves Gérardy
24875832e9
[ospec] Document changes made to the result objects. 2018-05-29 23:02:23 +02:00
Pierre-Yves Gérardy
0484758837 [ospec] docs and change log tweaks 2018-05-29 22:42:20 +02:00
Pierre-Yves Gérardy
d05bc9be49 [ospec] make it clear the timeout parameter is deprecated. 2018-05-29 22:42:20 +02:00
Pierre-Yves Gérardy
4a4377e553 [ospec] Make the specTimeout tests hopefully less flaky 2018-05-29 22:42:20 +02:00
Pierre-Yves Gérardy
aa0f9eae98 [ospec] o.defaultTimeout => o.specTimeout, and documentation.
The timeout parameter is deprecated but will still work for now
2018-05-29 22:42:20 +02:00
Pierre-Yves Gérardy
25975c5ce4 [ospec] Restore the assertion success on async test finalization in time 2018-05-29 22:42:20 +02:00
Pierre-Yves Gérardy
8ebf036b8c [ospec] Improve the done() call checker 2018-05-29 22:42:20 +02:00
Pierre-Yves Gérardy
33180370ea [ospec] Change the reserved test name token from '__' to '\x01' 2018-05-29 22:42:20 +02:00
Pierre-Yves Gérardy
0574d193a0 [ospec] better variable name 2018-05-29 22:42:20 +02:00
Pierre-Yves Gérardy
285d00742d [ospec] Detect incomplete assertions 2018-05-29 22:42:20 +02:00
Pierre-Yves Gérardy
21a6a857ef [ospec] update change log 2018-05-29 22:42:20 +02:00
Pierre-Yves Gérardy
ad83d617e1 [ospec] replace ES6 std lib call with ES5 equivalent 2018-05-29 22:42:20 +02:00