Skip to content
This repository has been archived by the owner on Jun 16, 2020. It is now read-only.

Banning transient state by default #73

Open
Raynos opened this issue Jul 27, 2014 · 2 comments
Open

Banning transient state by default #73

Raynos opened this issue Jul 27, 2014 · 2 comments
Labels

Comments

@Raynos
Copy link
Owner

Raynos commented Jul 27, 2014

Currently mercury allows transient state.

i.e. h('input') where you don't specify the value for the input and allow that state to live in the DOM as a mutable value.

This may cause subtle bugs like a virtual-dom diff / patch cycle not resetting the value to the empty string because it was left transient.

This is either a "feature" or a "bug".

One solution is to have mercury throw an exception if the user "accidentally" uses transient state and to make transient state opt in with something like h('input', { value: h.TRANSIENT })

@Raynos
Copy link
Owner Author

Raynos commented Jul 27, 2014

cc @Matt-Esch

@jxson
Copy link

jxson commented Jul 29, 2014

The subtleties here seem like it would be better to have mercury throw in this case. I think most who get into this situation would probably get there on accident...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants