Commit graph

29 commits

Author SHA1 Message Date
James Forbes
2fcaec7d8b
Temporarily host REM on fly to fix the docs 2024-09-23 04:51:33 -07:00
Stephan Hoyer
885b3f9442 Consistent naming of Mithril.js 2022-02-19 12:06:39 +01:00
Stephan Hoyer
7b1fda5b66 Add meta description to docs 2022-02-19 12:06:39 +01:00
Rasmus Porsager
d257025253 Flems in docs (#2348) [skip ci]
* Initial addition of flems - fixes #526

* Fix leftover ```js code blocks

* Add DOCTYPE

* Fix edge & IE11

* Don't show console

* Change orientation on mobile

* Use mithril@next for playground link

* Improve loading and structure

* Fix header alignment in IE

* Don't rotate logo

* Fix conflicts

* Allow `js` tags

* Fix code block query

* Fix Routing section and flems

* Fix firefox

* Improve flems styling

* Improve copy

* Fix data -> body in m.request sample

* Add flems in docs usage description
2019-10-14 13:06:39 -04: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
da211d74ba Update per v1.1.7 release 2019-09-23 19:11:32 -04:00
Isiah Meadows
62172cbe08 Fix pen [skip ci] 2019-07-26 18:38:59 -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
b580e241c8 Prepare for v2, s/markup/html/g in code blocks 2019-07-23 16:42:54 -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
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
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
Erik Vullings
8a7eae00ed Fix for #2423. request.data => body, params is used for querystrings (#2425)
* Fix for #2423. request.data is replaced by body, params is used for querystring interpolation.

* Updated documentation after code review by shadowhand and isiahmeadows

* Convert indentation to tabs

* Replacing m.request.data and m.jsonp.data with params or body.

* Update request.md


Co-authored-by: Isiah Meadows <contact@isiahmeadows.com>
2019-06-10 19:36:32 -04:00
Daniel Loomer
9b38e41fd6 standardize cdn links in docs (#2416)
- consistently use @next and explicit path
2019-05-27 11:58:11 -04:00
Ayush Jain
982fdf5737 Corrected the case issue of 'JavaScript' throughout the docs (#2401)
* corrected JavaScript spelling
2019-04-01 08:14:38 -04:00
Isiah Meadows
ddec23efe7
Mithril now accepts donations through OpenCollective (#2363)
* Mithril now accepts donations through OpenCollective

* Include both backers and sponsors

* Add a contributing TOC, retitle page, fix a few links
2019-02-18 14:21:13 -05:00
Isiah Meadows
b91a10a233
s/mithril/mithril@next/g, add v1 docs link [skip ci] (#2368)
This should help point users to the correct version if they plan to
install the release candidate, and it should help users find the
existing docs for v1.
2019-02-02 11:01:51 -05:00
Isiah Meadows
4a641092dc
Officially drop IE9-10 support, pull out our hacks (#2296)
- I also fixed a bunch of related comments
- I had to polyfill `requestAnimationFrame` for Node
- Drive-by: run `eslint . --fix`
- Drive-by: update transpiling info in CONTRIBUTING.md
- Drive-by: we aren't the only ones going semicolon-free
2018-11-27 18:04:15 -05:00
cavemansspa
e62f0f38f6 Doc update for unpkg src attr (#2205)
* Add https: to unpkg src attr

* [docs] Credit @cavemansspa
2018-08-21 18:40:15 +02:00
Leo Thorp
81903cacdb docs: fix typo (#2077) 2018-01-25 22:06:34 -08:00
Pat Cavit
7bc9904223 docs: integrate latest from next 2017-04-11 10:54:32 -07:00
Pat Cavit
207dea91da docs: merge 7ba74ad and friends 2017-03-28 11:37:07 -07:00
Pat Cavit
33aa1fa735 docs: merge docs from next to master 2017-03-24 15:36:53 -07:00
Leo
c861ade3fa fix typo 2017-02-02 07:46:29 -05:00
Barney Carroll
c8ed22fb08 docs: intro: valid HTML snippet (#1574)
Declaring scripts after the closing body tag looks like a typo
2017-01-31 10:04:26 -08:00
Leo
e1d1691cb9 fix readme style 2017-01-30 11:11:42 -05:00
Leo
431436bd6a prep docs 2017-01-30 10:43:22 -05:00
Leo
aee13901d8 docs tweaks 2017-01-26 20:46:32 -05:00
Renamed from docs/introduction.md (Browse further)