Commit graph

16 commits

Author SHA1 Message Date
Stephan Hoyer
885b3f9442 Consistent naming of Mithril.js 2022-02-19 12:06:39 +01: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
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
dmitriz
95ca2ce47d Prevent create empty item 2017-05-01 13:27:22 +01:00
Gampol T
450570d4c9 fix ui.save not detect escape key
change event from onkeypress to onkeyup because onkeypress cannot detect escape key press
if (e.keyCode === 27)
2017-02-23 17:48:13 +07:00
Gampol T
f6e627a891 fix state.update not destroy when edit text blank
if (state.editing.title === "") should call state.destroy() instead of destroy()
2017-02-23 17:45:25 +07:00
Paul D. Fernhout
7c5e06d2ec Fix todomvc to reflect All/Active/Completed choice 2016-11-14 21:12:34 -05:00
Leo Horie
37735f1772 remove redundant abstraction level in todomvc example 2016-10-28 09:51:42 -04:00
Leo Horie
9ea1cf0ae0 make editor and todomvc example more idiomatic 2016-10-28 00:56:59 -04:00
Leo Horie
7c736b511a rename node to vnode 2016-07-29 22:04:04 -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
a9cad2c45b Merge branch 'rewrite' of github.com:lhorie/mithril.js into rewrite 2016-05-03 23:39:16 -04:00
Leo Horie
3282ef3f77 components, angular dbmon 2016-05-03 23:39:01 -04:00
Stefan Keim
5fe5b5029b correct index
```todos.splice(index, 1)``` in destroy makes the elements shift; therefor loops index has to be aligned has to be corrected
2016-04-27 08:50:54 +02:00
Leo Horie
559369016d initial commit (work in progress) 2016-04-20 20:02:37 -04:00