Are custom elements a goal for Vue? #13241
Replies: 1 comment 1 reply
-
I'm just a user, not a maintainer, so I can't speak on what the future of Vue is. The issue here is the Vue (and most frontend frameworks) and Web Components, work and do things in completely different ways, which is why Vue needs a whole load of hacks to try and get the Vue way of doing things working on-top-of the Web Components way of doing things. So unless the Vue maintainers decide to introduce some breaking changes to how Vue works and how you author components, that will impact everyone, not just people targeting Web Components, there will likely always be bugs and limitations if you use Vue with Web Components. The same applies to all other frontend frameworks that were not written from the start with Web Components as their only target (so all the popular ones like React, Solid etc). In other words if you want amazing Web Component compatibility, you and everyone else in your company that are targeting Web Components should probably be using frameworks that were written specifically for Web Components and with that as their only target. Alternatively you could also all use the same frontend framework and not worry about Web Components. |
Beta Was this translation helpful? Give feedback.
-
Hi team,
Thank you for a great work you did in the last release to support custom elements.
We are working on a UI library based on Vue 3 compiled to custom elements and using of the latter in different applications with Vue 2, React etc. It, I believe, could be quite a common pattern for many companies if Vue 3 implementation of custom elements is stable, so it could increase the amount of Vue users even if they haven't tried it yet and had no intentions to try.
Initially we found this approach works well and started to implement components based on it. However after working actively on it for some time, we discovered number of issues and opened three issues in Vue core repository as a result for now.
#13234
#13206
#13199
Those are examples of normal using of created custom elements, which could be expected in any codebase. So those are not edge cases, I believe.
I saw these tweets from @yyx990803:
https://x.com/youyuxi/status/1839520963110613110?t=YVqIRArA4losWANIsNYwcQ&s=19

https://x.com/youyuxi/status/1839520299617841562?t=q-r91JDTEysaa4aqUtsF3A&s=19

It looks like there are some challenges with the implementation and also doubts about the future of web components itself.
The question is: can we as Vue users count on custom elements implementation in Vue and willingness to support it in the future versions of the framework?
Beta Was this translation helpful? Give feedback.
All reactions