-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
The Svelte "customElement" feature is not production ready yet ! #6481
Comments
having this merged would help #4330 controlling the shadow dom |
@sawden could you give an example of something you would wanted to make that now you can’t? |
All "Blocker Issues" keep me away from building Web Components with svelte in its current state 🤐. In my opinion, for example, nested slots are essential. |
Do you mean with nested slots a custom element inside a custom element inside a custom element an so on? Cause I think that works fine I don’t see a good example of what’s wrong in the issues |
Pretty sad to see such an important functionality being broken since mid 2019 (#3128), and to read here ' I think that works fine'. |
So, here is an absolute minimum project that shows the problem I have. I believe it's the same problem @sawden is talking about. Output is shown when compiled with As it seems that the REPL doesn't set the parameter correctly, output is shown there either way - with the same html. So you need to export the sources and set the parameter manually and add the custom element to the index.html, which is A real world module that shows the problem is for example https://github.com/buhrmi/thumb-ui |
Quick update: I managed to get the expected output by changing the createFragment function as shown below. Problem is, I don't find the place in the Svelte code to get Svelte compile the application code accordingly. Any hints are welcome. ` function create_fragment$1(ctx) {
` |
Same here, I have a I'm an active open source contributor ( |
This issue has gone a bit off topic, and offers nothing in itself, thus I will close it in favour of all the issues that it links. Nobody on the core maintainers team is particularly fond of Web Components, and thus there is limited desire to prioritise the issues which set out to provide support further than what currently exists. If you want to champion web components, then please go ahead and contribute to the open issues by way of PRs, etc, and we will see that these features are added to core. |
I find this to be quite disapointing. What are the issues the core team have with Web Components that are stunting support? Rich has always been critcal of Web Components, why support them at all? The killer feature for me is the ability to incrementally improve and standardise UIs with Web Components and that's difficult to do in an agnostic way without them as far as I'm aware. GitHub's adoption story is a great example of this. Svelte is by far the nicest way to write components —be those native or Web Components— as attested by Stack Overflow's 2021 Developer Survey. If this is the wrong place, please direct me accordingly please. |
I'm working on a project whose deliverable are web components in Svelte so am keenly interested in contributing this way and make improvements to Svelte's web components support. Still in preparation but if by any chance we can work together feel free to contact me (of course others reading this are welcome :) |
I'm happy to help to improve the situation regarding web component support. But I fail to understand how to make the necessary changes to the compiler , unfortunately😒 |
Loads of project now use vue because of this being able to “”compile”” to webcomponents and supported but that kinda sucks cause vue is big to package with every component I think svelte would be perfect for this also svelte has a nicer api overal |
If you are using web components because of it's encapsulation you maybe want to compile your svelte app normally and just use a |
FWIW, a few of the blockers mentioned here (which are still not yet implemented in Svelte itself) are now implemented in
Also, beyond that:
Among other features. Anyway, figured this might be worth a look for folks still wanting to use these features with Svelte-based custom elements. LMK if you find any issues since I’m actively using this in prod myself (and plan on supporting it). 😊 |
Describe the problem
I spent 2 weeks trying to port my project from setencil to svelte only to find out that the "customElement" feature is not ready for productive use at the current state.
Don't get me wrong svelte is a nice tool for a lot of projects but the "Web Component" feature is obviously experimental and that should be definitely mentioned in the docs to prevent frustrated developers.
Blocker Issues:
Nice to have:
Describe the proposed solution
Set the "customElement" feature in its current state as experimental.
Alternatives considered
Fix all essential bugs of the "customElement" feature.
Importance
i cannot use svelte without it
The text was updated successfully, but these errors were encountered: