Commit graph

2938 commits

Author SHA1 Message Date
Piotr Husiatyński
c71e8f4fcb JSON.stringify(m.prop(x)) use x.toJSON method when possible
When JSON serializing m.prop, check if wrapped object does define toJSON method
and if so, return it's result.
2016-05-25 11:12:36 +02:00
Leo Horie
e35fc79f09 mroe docs 2016-05-25 02:01:27 -04:00
Leo Horie
5815a590a8 test empty object 2016-05-24 23:18:11 -04:00
Leo Horie
eb25faf8af Merge branch 'rewrite' of github.com:lhorie/mithril.js into rewrite 2016-05-24 23:16:53 -04:00
Leo Horie
e7420e72e1 more tests 2016-05-24 23:16:43 -04:00
Leo Horie
920851e3ab Merge pull request #1067 from RichardIvan/patch-2
Typo in component.md
2016-05-24 10:53:28 -04:00
Richard Ivan
63d67e1d71 typo
typo
2016-05-24 16:44:50 +02:00
Leo Horie
a2c01d1d96 prop and withAttr tests 2016-05-21 09:49:05 -04:00
Leo Horie
477e73f300 prop and withAttr work in progress 2016-05-21 01:48:11 -04:00
Leo Horie
e1473dcce8 fiddling w/ bundled var names 2016-05-21 01:20:54 -04:00
Leo Horie
6400b616fc make renderer optional in autoredraw module 2016-05-21 01:14:59 -04:00
Leo Horie
9b602edf4e create only one renderer 2016-05-21 00:59:33 -04:00
Leo Horie
749b952392 clean up index.js 2016-05-21 00:48:58 -04:00
Leo Horie
0005cf26ee refactor redraw into pubsub and autoredraw
- pubsub is a basic pubsub impl
- autoredraw is glue code to register callback to pubsub and onevent

moved e.redraw to autoredraw
2016-05-21 00:37:34 -04:00
Leo Horie
db46bb4414 update bundler readme 2016-05-20 22:55:41 -04:00
Leo Horie
4e65357242 node doesn't like floating point numbers as setTimeout arg 2016-05-20 22:55:21 -04:00
Leo Horie
b1e8f61c87 fix tests after merge conflict 2016-05-20 22:50:52 -04:00
Leo Horie
acd9d5b641 Merge branch 'bundler-fix' into rewrite
Conflicts:
	api/mount.js
	api/router.js
	api/tests/test-router.js
	index.js
2016-05-20 22:45:51 -04:00
Leo Horie
10daf1e630 Merge pull request #1064 from tivac/redraw-mounts
[rewrite] Add m.redraw() support for multiple mount points
2016-05-20 22:38:21 -04:00
Leo Horie
e5391a1957 bundler variable disambiguation 2016-05-20 22:38:10 -04:00
Pat Cavit
71c77ba603 Add m.redraw() support for multiple mount points
To better match `0.2.x` behavior: https://jsfiddle.net/xbpyqL9k/
2016-05-20 15:27:17 -07:00
Leo Horie
42b21a5950 Merge pull request #1063 from il-juggler/patch-1
Update mithril.request.md
2016-05-20 18:12:51 -04:00
AlonsoSoto
51e553f980 Update mithril.request.md 2016-05-20 14:36:20 -05:00
Pat Cavit
058b25002d Linebreaks are hard, spacing isn't (#1062)
Because linebreaks are affected by git's `core.autocrlf` rule and I don't feel like adding a `.gitattributes` file yet.
2016-05-20 11:51:30 -07:00
Pat Cavit
04eaa25ab1 Support for skipping redraws (#1049)
Mostly useful for event handlers, setting `e.redraw = false` will prevent mithril from re-rendering.
2016-05-20 11:50:41 -07:00
Pat Cavit
2ca8fa6e66 Quiet some ESLint errors (#1060)
Some via config, a few via code edits
2016-05-19 22:18:31 -07:00
Pat Cavit
79e4c4a104 Remove old testing file (#1061) 2016-05-19 22:16:35 -07:00
Leo Horie
890d4123db Merge remote-tracking branch 'origin/rewrite' into rewrite
Conflicts:
	package.json
2016-05-19 23:25:20 -04:00
Leo Horie
e104b75364 cover everything 2016-05-19 23:24:36 -04:00
Leo Horie
977239d207 rename limiter to throttle and refactor
- don't inject raf/setTimeout since we can't really mock them w/ a good degree of timing accuracy anyways

fix some unrelated tests
2016-05-19 23:24:04 -04:00
Leo Horie
c071ac064b Merge pull request #1057 from tivac/eslint
[rewrite] Add ESLint and a generated config/ignore file
2016-05-19 23:03:50 -04:00
Pat Cavit
fbcdcf93e2 Add mithril bundle version of dbmonster 2016-05-19 13:24:28 -07:00
Pat Cavit
2af3aa27c7 Update size 🍩 (#1052) 2016-05-19 12:42:07 -07:00
Pat Cavit
e466ccebd0 Remove unused var (#1053)
Uglify caught this when I was testing to see what the updated min+gzip size was.
2016-05-19 12:41:25 -07:00
Pat Cavit
8450ca5d91 Add ESLint and a generated config/ignore file
Manually changed some rules to better match @lhorie's style and reduce #
of errors from ESLint.
2016-05-19 12:37:33 -07:00
Leo Horie
e8755c11c7 Merge pull request #1056 from tivac/api-tests
Public API tests
2016-05-19 15:06:53 -04:00
Pat Cavit
da6b697d19 spaces -> tabs 2016-05-19 11:57:41 -07:00
Pat Cavit
9f1afea9e1 Match @lhorie style
I don't usually write JS w/o semicolons, so no surprise I got this wrong
at first.
2016-05-19 11:53:41 -07:00
Pat Cavit
36bfc6892b Fix var shadowing infinite loop bug in browsers 2016-05-19 11:52:14 -07:00
Pat Cavit
749ff74bea Test both async types when using router 2016-05-19 11:35:45 -07:00
Pat Cavit
37b0ce20c5 Add missing dependencies 2016-05-19 11:08:26 -07:00
Pat Cavit
74f3e0d205 Remove old manual testing file 2016-05-19 10:59:41 -07:00
Pat Cavit
282cc5afdd Fix m.route() tests
- Wasn't calling route.prefix(), was assigning to it
- Needed to handle pushstate prefix (`""`) specially in assertions
2016-05-19 10:59:41 -07:00
Pat Cavit
41b24b998a m.route tests should run against all prefixes
Also tests `router.link` now. Had to add a `preventDefault` function to
domMock events that doesn't do anything, that may need a more-complete
implementation someday?
2016-05-19 10:59:41 -07:00
Pat Cavit
89dfd6e97d Remove unused reference 2016-05-19 10:59:41 -07:00
Pat Cavit
ce42adb720 Basic router tests 2016-05-19 10:59:41 -07:00
Pat Cavit
8f7cc0cb11 Stricter 2016-05-19 10:59:41 -07:00
Pat Cavit
fc481ff497 strict all the things 2016-05-19 10:59:41 -07:00
Pat Cavit
0cf509f674 Add forcing support and improve tests
Also verify that we're using tabs, whee.
2016-05-19 10:59:41 -07:00
Pat Cavit
86ce23a2bd Fix bundler w/ relative paths from sub-dirs 2016-05-19 10:59:41 -07:00