Repository navigation
Closed
Description
This issue helps me track changes needed to roll out hyperHTML V2.
Breaking Changes
- remove
hyperHTML.escape(useless since V0) - remove
hyperHTML.adopt(experimental, V1 too unpredictable, viperHTML has changes for it) - use
document.importNodeinstead of trusting connect/attributeChanged events (Custom Elements life-cycle will be different and CE will be always upgraded)
Refactoring
- use 100% standard ECMAScript 2015 code as ESM
- avoid transpilation bloat/interference/feature detection issues (use a defined set of transpiling rules instead of the whole 2015 preset)
- use ascjs to create CommonJS version of the module
- use
asbundlerollup to create index.js and be sure the resulting code doesn't throw in ES5 based engines - use uglify-js 2 to create min.js and be sure the resulting code doesn't throw in ES5 based engines
- split dependencies in folders avoiding circular dependencies
- branch out less capable browsers and keep the fast path on modern browsers (too many if/else inside code, just create different callbacks for better/easier code coverage too)
- for custom elements sake, remove hyper HTML attributes before importing and put them back after, avoiding misleading callbacks. Solve all attributes before connecting the node and never after.
Testing / Maintenance
- try to use basicHTML
latest version of jsdomto code cover on the server - make greenkeeper happy
if latest jsdom works -
test in isolation each CommonJS file or test index.js all at once.not needed, rollup is better - aim to the glorious 100% code coverage, trying to avoid ignores
for jsdom / nodejs sake
Nice to have
-
will be out in another releasehyperHTML.adopt(...)based on viperHTML changes and as separate bundle
Reacted by Josh Gillies, Alberto Santini, Oliver Janik, Alexandre and Textras
Metadata
Metadata
Assignees
Labels
No labels
Activity
WebReflection commentedon Nov 1, 2017
Transpilation Issues
node.method(...spread)causes unnecessary Babel output, usenode.apply(node, spread)insteadtypeof anythingcauses unnecessary Babel output if preset 2015 is usedequinusocio commentedon Nov 8, 2017
Ehat about babel-env?
WebReflection commentedon Nov 8, 2017
unnecessary, hyperHTML is easily compatible with IE9+ and Android 2+.
Target browsers will be preserved since it's a no brainer, the isue with Babel is that I want control the output and drop all the unnecessary churn.
If I use a single
typeofin the code, as example, Babel pollute the bundle with checks forSymbolbut I don't use a single symbol in the whole core so that's unnecessary churn.WebReflection commentedon Nov 13, 2017
to whom might concern ... how about the
styleattribute is handled in a special way?I think the React/Preact solution is reasonable and I'm thinking about bringing it in V2.
I don't encourage the usage of inline styles, but for those that changes frequently it feels silly to not improve developer experience there.
joshgillies commentedon Nov 13, 2017
@WebReflection are you referring to something along the lines of:
WebReflection commentedon Nov 13, 2017
@joshgillies yes, when an object, set properties right away (with the diff dance preact does too)
sourcegr commentedon Nov 14, 2017
I believe it is a nice to have addition, but I am not sure if it should land on the core.
Isn't there a way to add this feature (and possibly others) as a plugin or something or with a mechanism similar to
hyperHTML.define?WebReflection commentedon Nov 14, 2017
There are only 3 kind of attributes:
hyperHTML already handles all cases so there’s no room for extension.
Within the special case though, there is the style, which has been universally created via object literals and it’s some sort of de-facto standard.
Differently from nodes , where the content might constantly change, attributes behavior is defined as one-off operation so there’s no way to change/define new behaviors later on.
This constrain grants both extreme performance in attributes handling and consistent behavior with custom elements and built ins.
I don’t think it’d be wise to lose all of that for a use case that is very rare while passing objects has been widely used already. After all, if you want to transform an attribute inline you can do so already using a callback within the interpolation.
WebReflection commentedon Nov 14, 2017
P.S. master has V2 already. There are tons of subdole changes but beside what’s been dropped it should be fully backward compatible, faster in some case, more reliable overall.
If any of you could test it and confirm it works out of the box, that’d be ace!
Thanks