klembot / twinejs

Twine, a tool for telling interactive, nonlinear stories
https://twinery.org
GNU General Public License v3.0
2k stars 295 forks source link

"Extending Twine" suggestion: hydrate-JSONP property collisions should favour the hydrate property instead of the JSONP #971

Open webbedspace opened 2 years ago

webbedspace commented 2 years ago

Any properties added through hydrate must not conflict with properties specified in JSONP. Twine will ignore these and use what is in the JSONP.

I understand this is just a fallback tiebreaker behaviour, but it feels counterintuitive to me… Since hydration happens "after" the JSONP is evaluated, I mentally model that the hydrate-computed properties are appended to the JSONP, rather than vice-versa. That, and since hydrate-computed properties are computed and thus more "complex", they should have priority over the more "primitive" JSONP values.

klembot commented 2 years ago

My rationale right now is that I don't want people overusing/misuing the hydrate property--it should only be used for things that can't be represented in JSONP. Generally speaking, formats shouldn't have conflicts... at least, I don't see a good use case for that.