Development build of Hyperapp
See original GitHub issueAs discussed on Slack, I’m creating this issue so we can have a discussion about having a separate build of Hyperapp that developers can use for better debugging and detailed error messages.
Why?
Today, I stumbled upon an issue where the h
function wouldn’t accept a date, like {new Date()}
. Which is reasonable, except I got an error that I had a hard time understanding at first, which was Uncaught TypeError: Cannot read property 'length' of undefined
. You can see a reproduction of the error here: https://codepen.io/vdsabev/pen/Ewpggx
Hyperapp already has a great developer experience due to having so few concepts to learn. To make the learning process (and beyond) even easier, I think the community would benefit from enhanced error messages in cases like mine. This, however, can’t come at the cost of bloating the library - at least not in production.
This issue is about showing better errors. #388 is somewhat related - it’s about showing the errors in a better way.
An example of what React does is: react-dom.development.js:65 Uncaught Error: Objects are not valid as a React child (found: Thu Oct 12 2017 19:55:23 GMT+0300 (Eastern European Summer Time)). If you meant to render a collection of children, use an array instead.
So?
What do you all think? Approaches, examples, alternatives?
Your move.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:28 (18 by maintainers)
We could start by just distributing an unminified file in dist since that would involve zero special maintenance.
From the Slack discussions, another use case @selfup bumped into: he used the obsolete
root
property. A development build could throw an error if any unknown properties are used in theapp
function call. Or show warnings for deprecated properties, including migration steps.