Commit graph

17 commits

Author SHA1 Message Date
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
512eef378e
Recast key docs to be much clearer and more accurate (#2540)
* Recast key docs to be much clearer and more accurate [skip ci]

Also, fix a couple broken hash links I noticed while making this.

* Ensure `diff` blocks are highlighted correctly
2019-10-11 04:29:11 -04:00
Isiah Meadows
4cbcaf2936
Fix link + docs (#2476)
* Fix a copy/paste fail

Also, fix some incorrect tests.

* Clarify how routes are diffed, improve key + route resolver docs

- Add some missing links to route resolvers and single-child keyed
  fragments, clarify usage around them.
- Drive-by: remove a redundant sentence that itself was missing a
  period.

* Actually test for propagation and preventDefault

Previously, the mocks were both junk and inaccurate. No wonder my tests
were silently failing - they were wrong and not obviously wrong.
2019-07-16 16:03:24 -04:00
spacejack
02a91356c0 Keys docs indent fix, additional edits for clarity (#2459)
* Keys docs indent fix, additional edits for clarity

* Another indent fix

* Add comma
2019-07-10 07:35:56 -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
6c562d2b9b
Fix keys, normalize holes (#2452)
* Fix #2434

* Treat holes as unkeyed, normalize boolean/null/undefined

This brings a lot better consistency with that API, even though it's
slightly breaking. (I had to update a bunch of tests to correspond with
it.)

* Fill in PR number [skip ci]
2019-07-03 17:05:44 -04:00
Pat Cavit
6fb77b7771
docs: update with latest fixes (#2116) 2018-04-12 00:11:11 -07:00
Henrik Myntti
c32d508de1 Improve keys example
The previous example about hiding keys had syntax errors, and example in itself didn't follow our own guidelines (key should be on immediate child of an array)

In the new example we reuse the code from the previous example but break out a User component (which is much more likely) and the example says to move the key from inside the user component instead
2017-03-30 18:46:42 +02:00
Barney Carroll
97c60f9046 Close code blocks! 2017-02-24 13:35:42 +00:00
Barney Carroll
71dcde6adf Warn about data models w key props passed as attrs
Hint to avoid problems such as those found here [February 23, 2017 6:28 PM](https://gitter.im/lhorie/mithril.js?at=58af29c47ceae5376a2d470e)
2017-02-24 10:54:07 +00:00
Leo
a89e8cd405 add docs about mixed keys 2017-02-03 22:56:34 -05:00
Barney Carroll
c12b3e8fc2 docs: fix key anti-pattern snippet (#1577) 2017-01-31 10:06:21 -08:00
bruce-one
933266670d Recommend usage of fragments 2017-01-03 10:49:30 +11:00
Leo Horie
04ffdae2a3 some more docs 2016-10-26 10:56:36 -04:00
Leo Horie
ce0c30a235 update docs 2016-06-20 09:22:00 -04:00
Leo Horie
e35fc79f09 mroe docs 2016-05-25 02:01:27 -04:00
Leo Horie
cd8b8b12e6 Some documentation 2016-05-19 01:22:01 -04:00