Proposal: render as customElements mode #37
Replies: 3 comments 1 reply
-
I have never used web-compomemts before. What would be the advantage of web-components? |
Beta Was this translation helpful? Give feedback.
-
I have done some simple prototyping of this, https://github.com/Shinyaigeek/nano/blob/feature/define-as-web-coponents-mode/src/customElementsMode.ts, and have actually run it. I've tried it. https://github.com/Shinyaigeek/nano-jsx-web-components-prototyping |
Beta Was this translation helpful? Give feedback.
-
Now that I see the code, it looks like it makes sense to add this. But of course, the built-in UI elements should not be shipped as web components since they have to run isomorphic on node.js and deno. But I feel it is a good idea to let users build reusable components for the web. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi @yandeu !
nanojsx
is very small UI library, so I think this is also useful for making web-components. Actually,svelte
provides customElement mode to build svelte component as web-components.I know,
svelte
includes runtime and compiler, andnano-jsx
does not have a compiler, sonano-jsx
cannot provide a similar solution, so I propose anotherrender
function to render (define)nano-jsx
components as web-components like below.Maybe,
Nano.defineAsCustomElement
will be a simple wrapper forcustomElements.define
andNano.render
, but this will be very useful.I want to hear your opinion about this, and If you like it, I want to work on this.
Beta Was this translation helpful? Give feedback.
All reactions