hyperHTML-Element | extensible class to define hyperHTML based Custom | Web Framework library
kandi X-RAY | hyperHTML-Element Summary
kandi X-RAY | hyperHTML-Element Summary
An extensible class to define hyperHTML based Custom Elements.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Create a component instance
- Disconnects a DOM node .
- Start a change observer .
- Parses a node into an array of attributes
- Create content of given template
- Update style function
- Recursively extract child nodes .
- Wrap a super class function to its prototype .
- This function checks if all the nodes are ready .
- Dispatch DOM events to the target .
hyperHTML-Element Key Features
hyperHTML-Element Examples and Code Snippets
Community Discussions
Trending Discussions on hyperHTML-Element
QUESTION
Maybe I'm doing something very wrong but I can't seem to get hyperhtml-element to play nice with babel.
If I import HyperHTMLElement from 'hyperhtml-element' then I get raw es6 in my bundle. If I import HyperHTMLElement from 'hyperhtml-element/es5' then I get Uncaught TypeError: Super expression must either be null or a function
I'm using @babel/preset-env
I've been using hyperhtml-element in an Electron app for the last couple month and love it. But now that I'm trying to use it on the web I can't even figure out how to bundle it. I've been trying to make this work for almost a month now.
This is my gulpfile.js
ANSWER
Answered 2018-Oct-01 at 09:09If I
import HyperHTMLElement from 'hyperhtml-element'
then I get raw es6 in my bundle.
Which is exactly what should happen, right ? You are using ES6 syntax, you get it.
But here you are bundling with browserify, which AFAIK doesn't even understand ES6, only CommonJS.
Accordingly, if you want to require
HyperHTMLElement for CommonJS you have to be a bit more specific:
QUESTION
I cannot see any output with FireFox 57, while expecting 'HyperHtmlElement' ...
...ANSWER
Answered 2017-Dec-28 at 12:52There are two issues with your code:
- latest
HyperHTMLElement
bringshyperHTML
to you automatically. You don't need to include both scripts, just includeHyperHTMLELement
and feel free to importbind
,wire
and other methods/utilities from it, if needed. - Firefox does not ship yet Custom Elements. You need a polyfill, such as document-register-element or others.
As you can see in this CodePen, Firefox will indeed behave like Chrome or Safari, and Edge will work as well.
I hope I've answered your question.
QUESTION
When using HyperHTMLElement
it's possible to access the contents of the component by simply using this.children
or this.querySelector()
, since it's an element.
But how would I achieve similar behavior when using hyper.Component
?
The hypothetical example I have in mind is from React docs: https://facebook.github.io/react/docs/refs-and-the-dom.html - I'd like to focus a specific node inside my DOM.
I have a codepen sandbox where I'm trying to solve this: https://codepen.io/asapach/pen/oGvdBd?editors=0010
The idea is that render()
returns the same Node
every time, so I could save it before returning and access it later as this.node
:
ANSWER
Answered 2017-Sep-12 at 00:55This is something I've worked on in the past via https://github.com/joshgillies/hypercomponent
The implementation is actually quite trivial.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install hyperHTML-Element
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page