Commit graph

16 commits

Author SHA1 Message Date
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
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
Arun Cvf
853a54ae79 Fix mixed content error. (#2383)
Mixed Content: The page at 'https://cdn.rawgit.com/MithrilJS/mithril.js/master/examples/threaditjs/index.html' was loaded over HTTPS, but requested an insecure stylesheet 'http://threaditjs.com/reset.css'. This request has been blocked; the content must be served over HTTPS.
2019-03-02 02:22:39 -05:00
Leo Horie
bc8cf4ed76 change m.request return value from stream to promise
remove m.prop
add m.Promise
update tests and examples
2016-11-13 22:44:22 -05:00
Leo Horie
86fdcdafaa simplify other examples 2016-10-27 20:37:14 -04:00
Leo Horie
7c736b511a rename node to vnode 2016-07-29 22:04:04 -04:00
Pierre-Yves Gérardy
05c8c411ad Remove the injection of Stream into requestService
I guess the leftovers of a previous version...
2016-06-20 18:37:17 +02:00
Leo Horie
bce2abbffd Merge remote-tracking branch 'origin/rewrite' into rewrite
Conflicts:
	docs/keys.md
	docs/signatures.md
	docs/v1.x-migration.md
	index.js
	ospec/bin/ospec.cmd
	request/request.js
	request/tests/test-xhr.js
	util/prop.js
	util/tests/index.html
	util/tests/test-prop.js
2016-06-20 09:34:14 -04:00
Leo Horie
b9ce90765d streams implementation 2016-06-20 09:21:25 -04:00
Isiah Meadows
02cc4ec1d6 Fix whitespace/etc. in examples (#1115) 2016-06-18 03:39:55 -04:00
Leo Horie
5ec06e7c08 init state, fix examples 2016-05-15 11:14:38 -04:00
Leo Horie
5265697cb2 semi-working bundle 2016-05-14 01:01:35 -04:00
Leo Horie
d61a6169ea fix submission 2016-05-04 13:45:42 -04:00
Leo Horie
965f700cc4 remove dead code 2016-05-04 00:36:18 -04:00
Leo Horie
3282ef3f77 components, angular dbmon 2016-05-03 23:39:01 -04:00
Leo Horie
559369016d initial commit (work in progress) 2016-04-20 20:02:37 -04:00