Re: [WICG/webcomponents] [scoped-registries] Proposal for registry extension (Issue #989)

> I've basically never seen a component like this. Who makes those elements? 

It's a real-life situation, and not one so uncommon I suspect. I haven't seen this with Web Components, but in React and Angular, yes. I would like to believe that in the future it could be done using WC. 

So in summary, in large companies I have worked at, there would be a centralised team creating shared components for the whole company. A real-life company for example offered 300+ public components, but these components would sometimes in turn use private components only available in the scope of one component. This formed the "Core" component library. Those components would also use a number of libraries for common UI widget.

In addition to "Core", some other departments would offer additional components to be used across the company. For example, the security team offered some authentication-related components.

But then this company is working in a somewhat decentralised way where each department is quite independent. Some of those departments would build npm package, or sometimes federated modules, to offer functionalities specific to this department. This includes UI components, but also "business component", which are akin to views reused in multiple context. I have seen departments offer 100+ components  split in dozens of packages, developed by different teams but pulled together in the same app or high level component. Who actually develop those component would vary; some department had teams building most of those, others would be contributed by specific project teams. 

And then in the context of a single application within this department, there could be up to a half-dozen front-end dev teams working in parallel on different features with sometimes little coordination.

> Who provides the definitions and tag names?

That's the central point. With React, Angular, or most any framework, usage is defined by direct reference, which is not necessarily the case with WC. For a company like the one described above to adopt WC, the consuming component would need to have control on the tagNames. Components that use light-dom references to other components would need to do so without assuming their tagName (granted most usage would be in shadow dom, but I see many cases where light-dom reference would be needed). 

It touches also to #987 as using direct reference to components through constructor would be safer than string-based creation. String-based usage (template or createElement) depends on pre-registration and known tagName. Undefined or wrongly defined elements would not necessarily throw. For these reason, string-based usage would encourage the definition or every known elements instead of only the dependencies or a component.


-- 
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/issues/989#issuecomment-1508450079
You are receiving this because you are subscribed to this thread.

Message ID: <WICG/webcomponents/issues/989/1508450079@github.com>

Received on Friday, 14 April 2023 12:44:02 UTC