Commit Graph
46 Commits
Author SHA1 Message Date
unaffiliated 6daf2e69f0 ignore state updates when on node
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>

Closes #390
2017-01-21 16:21:48 +01:00
Tim Wisniewski 3b5740c00e Assert that tree exists, fix tests (#358)
* assert that tree exists, fix tests

* make assertions more helpful
2016-12-22 06:55:36 -05:00
Tim Wisniewski 9af9b1ad37 fix prev.location.params bug. closes #354 (#355) 2016-12-11 15:45:46 -05:00
Yoshua Wuyts a7916ec3f9 [major] choo v4 (#352)
* location: change url on location:setLocation

- [ ] don't break hashing
- [ ] allow not changing the url

fixup! move fns around

fixup! add search string

* app.start: clean

* walk: add

* location: update arg calls

* fixup! location: update

* uri-wrap: fix thunking

* router: update to latest sheet-router (#239)

* router: update to latest sheet-router

* tests: fix for latest version

* tests: fix SSR

* tests: fix history

* tests: spruce up

* docs: update example

* examples: update

* deps: bump sheet-router

* 4.0.0-0

* chore(changelog): 4.0.0 (#211)

* feat(api:) arg order (#268)

* s/data, state/state, data/

* feat(api): swap arguments

* fix(href): fix routing (#271)

* feat(http): remove (#269)

* feat(router): enable hash routing (#273)

* deps: fix mount

* 4.0.0-1

* feat(mount): copy {script,link} tags

* 4.0.0-2

* fix(mount): forEach -> for

Lol can't use forEach

* fix(router): use state.location.href (#282)

* fix(mount): use deep node clone

* 4.0.0-3

* fix(deps): remove hash-match

* 4.0.0-4

* fix(mount): return node

* 4.0.0-5

* fix(router): check if a hash is a valid selector (#339)

* 4.0.0-6

* fix(router): pass params on newstate (#343)

* 4.0.0-7

* feat(docs): update for 4.0.0 (#320)

* feat(docs): update for 4.0.0

* docs: update router example in readme (#337)

* chore(changelog): update for v4 (#351)
2016-12-11 19:35:29 +01:00
Tim Wisniewski e44f9619e9 prev.params should always exist (#227) 2016-08-23 05:45:53 -04:00
Yoshua Wuyts 2b7dc1901c .use: add new api method 2016-07-24 22:01:40 +01:00
Lucas Cherkewski dd88941d77 Use properly formatted assert() statement for send() on server 2016-07-14 15:10:08 -04:00
Yoshua Wuyts ea3a6f69e8 Merge branch 'master' into raf 2016-07-12 17:51:44 +02:00
Yoshua Wuyts 3cb9364c3d onAction: prefix views with view 2016-07-08 12:24:14 +02:00
Yoshua Wuyts f5f8d01c0b index: add raf guard 2016-07-06 23:15:54 +02:00
Yoshua Wuyts 4ad3dc9b72 deps: bump to barracks 8 2016-07-05 17:55:17 +02:00
Ben Drucker c3293b5953 Remove dead check for strict prev/current state equality
* Barracks will always return a new object

https://github.com/yoshuawuyts/barracks/blob/11d3c6d1822beadce0251279f9bc8370c569ea5e/index.js#L144
2016-07-04 16:19:17 -07:00
Ben Drucker e0783320f7 Add tests and fixes for rehydration
* Barracks must get an initial state or state.location is undefined
* Replaces document.addEventListener w/ pkg handling existing ready doc
2016-07-04 16:19:12 -07:00
Ben Drucker cdabc4d85f Return outerHTML from toString if available, fall back to toString() 2016-07-04 08:07:54 -07:00
timwis 6954bc5084 Rename action param -> data in index.js 2016-07-03 12:37:43 -04:00
Yoshua Wuyts 6407188ee9 router: change order of arguments
fixup! freeze state & rename app ns to location
2016-07-02 22:54:35 +02:00
Yoshua Wuyts 9e039ed561 architecture: use barracks
Changes
=======
- add hook handlers
- add effect composition
- add noFreeze option

Commits
=======
- fixup! fix toString()
- fixup! use assert instead of throw
- fixup! fix reducers
- fixup! work on done callbacks
- fixup! more callback work
- fixup! woooh fixed effects errs
- fixup! wrap up stuff
2016-07-02 16:00:26 +02:00
Todd Kennedy 8f8df602c5 Extract html into separate module (#103) 2016-07-02 12:55:41 +02:00
Yoshua Wuyts bca9d46f61 router: fix arguments bug 2016-06-23 23:54:02 +02:00
Yoshua Wuyts bae31831fe subscriptions: load on DOM ready 2016-06-20 15:11:28 +01:00
Yoshua Wuyts 30726b4277 Merge pull request #53 from toddself/fix-assert-call
Fix assert call for subscriptions
2016-06-19 22:16:02 +02:00
Todd Kennedy 02c3c81f37 Fix assert call for subscriptions 2016-06-19 11:38:36 -07:00
Todd Kennedy 1d38ab9f22 Allow for naming the rootId with no options
Right now if you want to name your rootId something different, but don't pass
in any options, it doesn't change the name of your rootId (see confusion in
github #49.

This would allow someone to use

```js
const app = choo()
app.start('myRootNode')
```

Rather than having to use

```js
const app = choo()
app.start('myRootNode', {name: 'myRootNode'})
```
2016-06-19 08:35:41 -07:00
timwis 957f41bea9 use ternary, hash is opt-in 2016-06-04 19:53:05 -04:00
timwis a5f8093dc0 Merge branch 'master' into hash 2016-06-04 19:25:12 -04:00
timwis 7e837a47eb use hash history for initial location 2016-06-04 18:43:38 -04:00
timwis 97d7122ff2 listen to hash changes 2016-06-04 18:00:00 -04:00
Emil Bay 3f38810d64 Fix #37 rootId should clear if only opts is passed
`rootId` is optional to `start`, but has lower precedence than `opts`. Currently it is not cleared when the value is passed to `opts`
2016-06-04 15:48:27 +02:00
Yoshua Wuyts 3749ffb477 start: throw err for render races 2016-05-31 15:54:46 +02:00
Yoshua Wuyts 3153fcb26c router: suppress re-render on same state
- views will no longer be re-rendered if the state hasn't changed
- `oldState` is passed as the final argument in a view. E.g. `params,
  state, send, oldState`. This is mostly because it will usually only be
  used for optimizing - changing the order would be a breaking change
  :(
2016-05-31 12:30:40 +02:00
Yoshua Wuyts 60665f2a71 toString: support rehydration 2016-05-24 02:10:17 +09:00
Tim Wisniewski bc78589567 Use opts.href instead of opts.history
Per [documentation](https://github.com/yoshuawuyts/choo#tree--appstartopts)
2016-05-23 07:35:24 -04:00
Yoshua Wuyts dc840059a4 models: fix state namespace 2016-05-23 14:40:52 +09:00
Yoshua Wuyts 0cc0caa8e1 examples/http: update for ns 2016-05-23 13:44:32 +09:00
Yoshua Wuyts 300b6325a9 examples: update mailbox 2016-05-23 04:00:29 +09:00
Yoshua Wuyts 24b9be7c8d models: sturdify namespaces 2016-05-23 03:32:14 +09:00
Yoshua Wuyts 0be2337605 docs: improve examples & concepts 2016-05-23 03:32:14 +09:00
Yoshua Wuyts 4084775c8c choo: add server rendering 2016-05-22 02:06:46 +09:00
Yoshua Wuyts e8f327dbb0 choo: fix subs 2016-05-16 04:09:02 +07:00
Yoshua Wuyts acd834a8b1 choo: update internal fn name 2016-05-16 03:37:19 +07:00
Yoshua Wuyts 922c69a0de choo: add subscriptions 2016-05-16 03:37:06 +07:00
Yoshua Wuyts 5d3cb47a99 choo: fix model trigger ordering 2016-05-13 12:23:25 +07:00
Yoshua Wuyts 53a1e6026a choo: add href / history handling 2016-05-12 14:45:20 +07:00
Yoshua Wuyts 5f68a8bf3a choo: fix updates 2016-05-11 14:56:18 +07:00
Yoshua Wuyts 48d43eaf09 choo: add initial render 2016-05-11 13:51:17 +07:00
Yoshua Wuyts c28d37ac84 . 2016-05-11 01:09:53 +07:00