Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inferno and Web Components? #1081

Closed
ethanresnick opened this issue May 15, 2017 · 7 comments
Closed

Inferno and Web Components? #1081

ethanresnick opened this issue May 15, 2017 · 7 comments

Comments

@ethanresnick
Copy link

Does inferno work with web components? I know react largely does. Are there any reasons inferno would work differently? Maybe things with the event system, or whether the virtual dom updates attributes or DOM Node properties, etc? This would be useful to document.

cc @treshugart: maybe you've already looked into this?

@treshugart
Copy link

treshugart commented May 15, 2017

@ethanresnick I'm not sure about Inferno, but if it follows React closely it likely doesn't integrate well. The two main issues with React are:

The issue about attributes vs properties is one that is mostly at fault for many thinking that you can't pass complex data structures to a custom element, which is untrue. The one for custom events prohibits reactivity, an issue that fuels the rhetoric that custom elements can't follow FRP practices. These are also not specific to custom elements. They are problematic for anything that utilises custom properties or events on DOM elements.

These aren't small issues. They bottleneck people wanting to build custom elements to only building / using very simple components which is another complaint - but not the fault of - custom elements.

@ethanresnick
Copy link
Author

@treshugart Thanks for jumping in. I was aware of those issues with React, but I've also seen your react-integration lib that seems to work around them nicely. Hopefully, someone from inferno can jump in to confirm that it's behavior is the same, in which case the react-integration lib should just work too.

@treshugart
Copy link

@ethanresnick There's also https://github.com/skatejs/val which is possibly a more robust angle to tackle the problem from.

@ethanresnick
Copy link
Author

Good to know about; thanks.

@LukeSheard
Copy link
Contributor

Inferno should work exactly the same way as React for Web Components as commented above there are numerous options around this though, so I will close this.

@alivedise
Copy link

React 16 supports custom attributes which is heavily used in Web Components. What's the plan of inferno? Does it support custom attributes already?

@Havunen
Copy link
Member

Havunen commented Oct 11, 2017

Inferno does simple setAttribute, if javascript dom API requires different function call, then not. @alivedise can you add test case for it?

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

No branches or pull requests

5 participants