Commit graph

3621 commits

Author SHA1 Message Date
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
be0213a506 Hide the "Upcoming" section from the live site [skip ci]
Eventually, I'd like to find a way to just automatically filter it out.
2019-07-24 05:38:51 -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
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
8186818e10 Add TS installation notes 2019-07-24 00:30:08 -04:00
Isiah Meadows
b580e241c8 Prepare for v2, s/markup/html/g in code blocks 2019-07-23 16:42:54 -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
spacejack
61b087ea20 Conform stream.map to FL spec and clarify stream internal properties (#2481)
* Conform stream.map to FL spec. Clarify stream internal properties.

* Streamline ignoreInitial logic, code style edit
2019-07-23 02:35:50 -04:00
Isiah Meadows
84baff8def Fix part 1 of #2477 2019-07-17 12:33:02 -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
17f2ab2645 Merge branch 'next' 2019-07-16 21:55:31 -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
Isiah Meadows
c3cca5f8e2
Remove an outdated bit in the docs [skip ci] 2019-07-16 07:49:22 -04:00
Isiah Meadows
c2f269c3b4
Fix design bug (#2475) 2019-07-16 07:16:25 -04:00
Oscar
cbe6596b79 fix small typo in comment (#2473) [skip ci]
// The attribute is1 coerced -> // The attribute is coerced
2019-07-13 08:38:46 -04:00
Isiah Meadows
6e57a0691c
Fix #2470 (#2471) 2019-07-12 16:27:24 -04:00
Isiah Meadows
3fd1953143 Fix all the templates [skip ci]
Thanks a lot, GitHub...
2019-07-12 16:13:52 -04:00
Isiah Meadows
3f754dffaa v2.0.0-rc.8 2019-07-12 15:43:57 -04:00
Isiah Meadows
e6ab2ef982 Fix lint issues, run npm audit fix 2019-07-12 15:40:07 -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
dependabot[bot]
ace4e77ace Bump lodash from 4.17.11 to 4.17.14 (#2468)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.11 to 4.17.14.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.11...4.17.14)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: null <49699333+dependabot[bot]@users.noreply.github.com>
2019-07-12 06:47:29 -04:00
Isiah Meadows
9900e427fd Update issue templates
Update issue templates to be a lot clearer on what we want.
2019-07-12 03:57:15 -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
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
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
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
db277217f8
Move fragment type check to normalizer (#2462)
Should result in more informative stack traces.

Fixes #2461
2019-07-07 17:16:56 -04:00
spacejack
b2f82e3abc Add build/parsePathname to API TOC (#2460) 2019-07-07 16:35:02 -04:00
Isiah Meadows
fecd262d0b v2.0.0-rc.7 2019-07-06 03:54:57 -04:00
Isiah Meadows
366f63391e Update package-lock.json 2019-07-06 03:54:38 -04:00
Isiah Meadows
a23bcea7ee
Correct a bunch of incorrect/outdated references (#2457)
- Babel 7 has a whole different module API
- Traceur is basically dead
- JSX != HTML
- Some bits are just obvious from context what they are
- ES6 docs shouldn't be auto-installing JSX support
- Also, I decided it was worth clearing up some misleading docs in
  surrounding areas.
2019-07-06 03:41:01 -04:00
Isiah Meadows
76e8eaab5e
Clarify need for escaping, to avoid confusion (#2456)
Nobody has asked yet, but I'd like to not form assumptions about the
reader. Also, it's come up on rare occasion a while back, on both GitHub
and Gitter.
2019-07-06 02:45:12 -04:00
Isiah Meadows
d8a34cc920 Update bundles 2019-07-05 19:54:21 -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
7eee730c29
Mithril's grown a bit (#2454)
Thank you all these freaking edge cases and perf bugs... :-(
2019-07-05 18:55:45 -04:00
Isiah Meadows
90bcff0fa7
Deduplicate m.route and m.redraw logic (#2453)
- Remove appropriate route change subcriptions when a root is removed
  via `m.mount(root, null)`.
- Don't pollute `onpopstate` and friends - use standard event listeners
  instead.
- Simplify and streamline subscriptions, in preparation of adding a
  `remove` parameter to `m.mount`.
- Change the redraw internals to redraw immediately, with ability to
  cancel via returning a sentinel.
- Change `"bleeding-edge"` for `m.version` in `next` to instead just be
  the latest `m.version`. (If you're using `next`, you should know what
  you're in for.)
- Update tests to be aware of these changes. (Some were failing for
  subtle reasons.)
- Drive-by: remove some uses of `string.charAt(n)` and use `string[n]`
  instead.
2019-07-05 18:52:06 -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
Isiah Meadows
86d64e213f
Fix #2443 (#2451) 2019-07-03 14:41:48 -04:00
Isiah Meadows
ddc8adbbd3
Fix #2424 (#2450)
* Fix #2424

* Add PR ref
2019-07-03 14:41:37 -04:00
Isiah Meadows
d629c7aef8
Fix #2442 (#2449)
* Fix #2442

* Add PR link
2019-07-03 12:43:38 -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
9e9b89d900
Fix #2067 (#2447)
* Fix #2067

* Add PR number [skip ci]
2019-07-03 04:53:45 -04:00
spacejack
696b5cbfe3 Edit types installation to be clearer and easier to find (#2435) 2019-06-20 07:02:02 -04:00
Daniel Loomer
10f0b4934a support falsy arguments in Object.assign polyfill (#2433)
* support falsy arguments in Object.assign polyfill

* add tests for assign polyfill
2019-06-15 22:48:24 -04:00
Stephan Hoyer
dd6572579d
Create FUNDING.yml 2019-06-14 14:51:12 +02:00
Isiah Meadows
9d6fc3e910
Update CODEOWNERS 2019-06-13 13:23:11 -04:00
Woody Gilk
6f602de878 Improve initial request docs example (#2430) 2019-06-12 05:53:59 -04:00