-
Notifications
You must be signed in to change notification settings - Fork 120
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
Custom elements support in domino #96
base: master
Are you sure you want to change the base?
Conversation
added smarter web platform tests blacklisting
return !name || !xml.isValidQName(name) || name.indexOf('-') < 0 || forbiddenNames.indexOf(name) > -1 || name.toLowerCase() !== name; | ||
} | ||
|
||
function CustomElementRegistry(registry, document) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am totally new to domino, but shouldn't you just use Class
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm also new :) but as I see domino should work with node 0.8 so in code the class syntax is not used, unfortunately, I had to use class syntax in one place and I do not know how to avoid it :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't noticed anything regarding this at package.json or in the readme.
@fgnass
Though it makes sense to have engine key in package json. Semantic increment of version shouldn't hurt anyone since Classes supported from 4th version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rootical
Please look at travis :(
Any feedback ? |
Any feedback on this PR? We would love to see custom element support in domino! |
I'd really like to see this merged, it looks pretty good. Any feedback from domino? |
Have you tried this?
Seemingly, it works. On the other hand, why it shouldn't work :) |
@cronon |
@cronon
So I tried to "patch" domino by @webcomponents/custom-elements, and unfortunately it doesn't work :(, There is error: Cannot assign to read only property 'insertBefore' of object '#' the whole api of Node, Element is not configurable/writable :( |
Any plans to continue with support for Custom Elements?? PR looks fairly simple but was abandoned 3 years ago. Hoping to use @angular/elements and have them rendered on the server |
Wanted to indicate that I was seeing the same need as a result of using Angular Universal (server-side rendering.) Custom CSS elements have been used as a way to theme the app, and suporting that in domino would permit the server-side equivalent. |
I believe many people still would love to see this one merged. |
Hello
Firstly let me thanks for awesome work on domino.
Some time ago I started work on some idea, about 'universal custom elements'
General idea is to create custom-elements once and use them (render) on server (node) and on client (browser) side.
I found the server-components which is using domino for rendering the content. But it is using very tricky way to use the domino because domino itself do not implements custom-elements spec.
On other hand I found the skate.js which is using incremental-dom for rendering but just for browser.
Based on that ides I made some POC where:
I'm using JSX because it is simple to decide later how the markup have to be rendered, and it plays well with domino and incremental-dom
This works nice, I have now real progressive enhancement solution where the markup is prerendered on server and can be enhanced on client (eg attach events handlers ect..). Enhanced means not rerendered again but really updated with the changes (thanks to incremental-dom)
But I think this can be done much better.
So I comes to conclusion that domino itself can support custom-elements :)
Later I want to talk with skate.js about integrate this work there.
So about this PR.
This PR contains some almost done work of implementing the custom-elements in domino.
The code is maybe not brilliant, but I tried to explain the all changes in comments.
Firstly I want to know your opinion, about integrate this to master, and later I can polish the code.
I used platform web-platform-tests for test the solution and most critical now passed.
Some of the not working because of lack of some api support in domino (eg document.createAttribute ...)
I decided to expose the customElements registry outside of document and window because I think there should be a way to define custom elements globally instead of doing this on each document creation (each server request).
Waiting for your feedback.
Best Regards
Pawel.