Commit graph

139 commits

Author SHA1 Message Date
Pierre-Yves
3fd82e6359 implement m.domFor() and use it internally to move and remove nodes. Fix #2780 2022-06-21 17:02:05 +02:00
Pierre-Yves Gérardy
c0a9c21c09
Actually remove ospec from the main code base (#2786)
* Actually remove ospec from the main code base (it is still used as a dev-dependency)

* fix a copy error

Co-authored-by: Barney Carroll <barney.carroll@gmail.com>

Co-authored-by: Barney Carroll <barney.carroll@gmail.com>
2022-06-10 18:33:17 +02:00
Pierre-Yves Gérardy
ea680dc917
Add back CI (#2785)
* Add back CI, remove ospec as a run-time dependency

* Fix the lint:docs errors

* Add back ospec for now, with a compatible version
2022-06-10 17:10:26 +01:00
James Forbes
8c149d3653 Release Artifacts for v2.2.2
[skip ci]
2022-05-26 04:30:20 +10:00
James Forbes
a8337c0651 Release Artifacts for v2.2.1
[skip ci]
2022-05-25 09:53:59 +10:00
James Forbes
527c0de6e2 Release Artifacts for v2.2.0
[skip ci]
2022-05-16 18:14:36 +10:00
James Forbes
259902f5f8 Release Artifacts for v2.1.0
[skip ci]
2022-05-16 18:08:13 +10:00
James Forbes
0ce6e4eae6 Remove version and release npm hooks 2022-04-27 21:01:09 +02:00
Stephan Hoyer
ee7fe52ee8 Update deps 2022-02-21 15:02:31 +01:00
dependabot[bot]
50d3809dac Bump marked from 0.7.0 to 4.0.10
Bumps [marked](https://github.com/markedjs/marked) from 0.7.0 to 4.0.10.
- [Release notes](https://github.com/markedjs/marked/releases)
- [Changelog](https://github.com/markedjs/marked/blob/master/.releaserc.json)
- [Commits](https://github.com/markedjs/marked/compare/v0.7.0...v4.0.10)

---
updated-dependencies:
- dependency-name: marked
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-25 19:25:40 +01:00
Isiah Meadows
bd66955f1e Unbreak tests 2020-10-14 03:28:45 -07: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
9b1155c4aa Fix a docs generation bug [skip ci] 2019-08-18 14:53:53 -04:00
Isiah Meadows
caef6a8f09 v2.0.4 2019-08-18 14:21:31 -04:00
Isiah Meadows
4c15e258e0 Preparing for release 2019-08-18 14:20:22 -04:00
Isiah Meadows
22e6d37a26 Refactor the scripts to work as advertised
- Correct docs generation to always fetch its dependency
- Don't try to close a handle that's already been closed by other methods
- Allow the release script to actually be testable.
2019-08-17 21:58:57 -04:00
Isiah Meadows
0d10dc2c89 v2.0.3 2019-07-27 20:57:02 -04:00
Isiah Meadows
9d3ce5fa6d v2.0.2 2019-07-27 20:29:19 -04:00
Isiah Meadows
48e7fd1711
Refactor scripts (#2465)
* Refactor all kinds of scripts

* Update docs to ensure linter passes
2019-07-27 15:12:49 -04:00
Isiah Meadows
516a3a6df6 v2.0.1 2019-07-24 05:24:31 -04:00
Isiah Meadows
1776366cf4 v2.0.0 2019-07-24 05:03:21 -04:00
Isiah Meadows
ae6b547673 v2.0.0-rc.9 2019-07-16 21:59:00 -04:00
Isiah Meadows
c30a716e49 Update readme when releasing, too 2019-07-16 21:58:37 -04:00
Isiah Meadows
3f754dffaa v2.0.0-rc.8 2019-07-12 15:43:57 -04:00
Isiah Meadows
582bda56dc
Partially recast the router API to be a lot more intuitive. (#2469)
* Recast the router API to be a lot more intuitive.

Fixes #2387
Fixes #2072
Fixes quite a few issues reported on Gitter.

For `m.route.Link`:

- More intuitive
- More accessible
- More ergonomic
- It can be disabled
- It can be cancelled
- It can be changed
- Oh, and you can use it isomorphically.

For `m.route.prefix`

- You can *read* it.
- You can write to it, of course.
- It's literally just setting a property.

For the router itself (and the rest of Mithril):

- You can now `require("mithril")` and all its submodules without a DOM
  at all. There is a catch: you can't instantiate any routes, you can't
  mount anything, and you can't invoke `m.render` in any capacity. You
  can only use `m.route.Link`, `m.route.prefix`, hyperscript stuff, and
  `mithril/stream`, and you can use `m.request` with `background: true`
  if you use a global XHR polyfill. (You can't use `m.request` without
  `background: true` except with a DOM to redraw with.) The goal here is
  to try to get out of the way for simple testing and to defer the
  inevitable `TypeError`s for the relevant DOM methods to runtime.

  The factory requires no arguments, and in terms of globals, you can
  just figure out based on what errors are thrown what globals to
  define. Their values don't matter - they just need to be set to
  *something*, even if it's just `null` or `undefined`, before Mithril
  executes.

Had to make quite a few other changes throughout the docs and tests to
update them accordingly. Oh, and that massive router overhaul enabled me
to do all this.

Also, slip in a few drive-by fixes to the mocks so they're a little
easier to work with and can accept more URLs. This was required for a
few of the tests.

* Update changelog + numbers, add forgotten bundle option

* Add PR numbers to changelog [skip ci]

* Allow continuing to the next match by returning `false`.

* Update numbers again
2019-07-12 15:29:37 -04:00
Isiah Meadows
904b63b2aa
Drop m.version (#2466)
* Drop `m.version`

It's caused way too much grief over the years, and I've finally decided
it's worth pitching. For those who need it, it's easy to get, especially
if you use it through Node or a build system. And for those who are just
loading it globally, you have to explicitly specify the version anyways,
so you'd be just as golden if you followed it up with a simple inline
script that does `m.version = "the version you loaded"`.

Oh, and also, you shouldn't be coding specifically for version numbers,
either - it's a known anti-pattern. Instead, you should prefer feature
detection and just do the right thing.

* Update changelog [skip ci]
2019-07-10 14:04:44 -04:00
Isiah Meadows
1434ba313f
Fix m.version to not depend on package.json (#2464)
* Fix `m.version` to not depend on `package.json`

Created an accidental breaking change.

* Update changelog

* Fix a failing test
2019-07-09 19:26:00 -04:00
Isiah Meadows
fecd262d0b v2.0.0-rc.7 2019-07-06 03:54:57 -04:00
Isiah Meadows
e82f6d00c2 v2.0.0-rc.6 2019-05-31 12:14:27 -04:00
Isiah Meadows
f1d001cfcd v2.0.0-rc.5 2019-05-29 10:23:40 -04:00
Isiah Meadows
7fb47852c0 Run npm audit fix and prune 2019-05-29 10:23:18 -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
99a61a09dc
Update a few dependencies, update ospec to version 3.1.0 (#2370) 2019-02-05 13:20:55 -05:00
Isiah Meadows
02844a0b89 Fix version script [skip ci]
For some reason, it was never updated to include the stream bundle.
2019-02-05 11:40:42 -05:00
Isiah Meadows
c803918f00 v2.0.0-rc.4 2019-02-05 11:29:45 -05:00
Isiah Meadows
f09c84c369 v2.0.0-rc.3 2018-12-06 00:36:12 -05:00
Isiah Meadows
353e4c1748 Make sure to include new bundles in version script 2018-12-06 00:33:11 -05:00
Isiah Meadows
e31c06be3e v2.0.0-rc.2 2018-12-06 00:23:58 -05:00
Gandalf-the-Bot
86c16820f7 Bundled output for commit 7c5024f921 [skip ci] 2018-11-30 08:13:28 +00:00
Isiah Meadows
7c5024f921
Fix some linter issues, update ESLint (#2318)
* Fix linter issues, run `npm audit fix`

* Update ESLint to not be so ancient.
2018-11-30 03:11:07 -05:00
Isiah Meadows
c33621cd52
Simplify bundler a little (#2290)
- Remove a useless abstraction
- Remove a useless write + read
- Only read when generating the bundle
- Use one watcher instead of two
- Use Chokidar to simplify and make for a better experience
2018-11-27 18:02:35 -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
232ff597a6
Switch to Terser (#2289)
1. It's actually supported
2. It's less buggy

https://twitter.com/dan_abramov/status/1060216917493981184
2018-11-09 13:55:25 -05:00
Isiah Meadows
1f18506de6 v2.0.0-rc.1 2018-11-07 12:37:22 -05:00
Scotty Simpson
843d7ad454 Abandon Closure Compiler in favor of UglifyES (#2285)
Moved to UglifyES, ditched async cruft, clarified responsibilities between cli & minify.

Makes for faster, more reliable, synchronous, non-Google-reliant minification.
2018-11-06 15:48:48 -05:00
Isiah Meadows
3e494583c6 v2.0.0-rc.0 2018-10-25 14:54:22 -04:00
Isiah Meadows
2635070734 Merge branch 'next' 2018-10-25 14:23:33 -04:00
Pierre-Yves Gérardy
4922912bbb [chore] remove Danger for now 2018-05-16 01:09:49 +02:00