Replies: 3 comments 3 replies
-
A modular plugin system was very important for us from the start, we never had a monolithic architecture. @JakobVogelsang and I had intended from the beginning to develop a tiny set of general purpose "internal" plugins ourselves within the As it turned out, they also wanted to use a weird "wizard" system — for workflows with multiple dialog pages one after the other — that Jakob and I had badly ad-hoc designed for our own internal use only. Thus the whole kerfuffle with widespread use of our weird and bad wizard "API" (never intended to be an external API) in plugins began, making it impossible to separate plugins out to their own repositories. Web components were originally only meant to be used as a way of loading plugins, and
When we said "Let's come up with a real purpose and usable API for wizards, pull out the core component into its own repository, and develop all plugins including our own 'internal' ones in separate repositories!" in the beginning of 2022, we intended to make that originally intended way of working more clear by getting rid of our original distinction between "internal" included plugins and "external" plugins.
Actually, there is a polyfill available for using scoped registries across all modern browsers right now. I would suggest this for any plugins that still want to use web components. Please note that some mwc components (like
We don't have a technical way to force plugin authors to do anything in particular. It is important that plugins may always be developed without any coordination with the
Plugins may already be developed not just using different javascript frameworks, but also without any framework at all, or using completely different programming languages that compile to javascript like In general I don't see why we need to prescribe a particular approach to plugin authors. If a plugin wants to use web components it can either be fine with different versions (our current approach) or register its own namespaced tag names (or make use of the scoped registries polyfill) in order to have access to fixed versions. If a plugin doesn't want to use web components, it doesn't need to. What do you think of this stance? |
Beta Was this translation helpful? Give feedback.
-
I looked at this a couple of months and though I have mostly forgotten the Limitations are important if we are trying to use the same UI components: Limitation 1: Components should not be self registering. The Limitation 2: Every component that uses sub components should use scoped-elements. The alternative "find and replace" version which would allow this to be used might be https://github.com/scoped-elements/material-web although I'd be reluctant to use an unreleased, unmaintained thing like this without guarantees and cautious about having to maintain this ourselves. |
Beta Was this translation helpful? Give feedback.
-
@ca-d as usual, thank you for the great clarification! :)
If I understood it correctly, the polyfill that you linked is to scope elements that I use in my component. This is something we could maybe ask of plugin authors? Does not seem too much of a hustle. (I don't like that it reminds me of Angular's module structure but that is just my problem :D ) An interesting point I found is that there is a scoped custom element registry polyfill what we could include globally in core so nobody has to do anything: What do you think? I'll try out both and let you know how it went. |
Beta Was this translation helpful? Give feedback.
-
Question
Is the Web-Components the right technology for a growing platform and community?
Context
We plan to move away from a monolithic structure to a more modular one.
By separating
Core
fromPlugins
we hope for following effects:Overview Of OpenSCD Next's Planned Architecture
Problem
mwc-button
. 2Options
1. Enforce Same Version (pinning)
Updates need to be synchronised and at the same time to avoid conflicts. This will lead to bottlenecks.
2. Do Not Use Custom Elements (and Lit)
We use custom elements for OpenSCD itself (
open-scd
element) and for the plugin mechanism.Custom elements work well for adding plugins and wizards dynamically to OpenSCD. It has great capsulation because styles are captured inside the shadow root and frameworks and libraries do not bother the rest of the DOM.
However, inside of plugins and wizards we need a different technology that does not depend on custom elements like: React, VueJS or Svelte
The main disadvantages:
Both are manageable problems but need extra effort.
3. Wait For Scoped Custom Element Registries
We continue as is and wait for the scoped registries.
As of now there is now target date.
Footnotes
this might be change up so at least we get an error message ↩
scoped custom elements are behind a feature flag in chrome canary: https://github.com/WICG/webcomponents/issues/716#issuecomment-1535263394 ↩
Beta Was this translation helpful? Give feedback.
All reactions