ionic-team / stencil

A toolchain for building scalable, enterprise-ready component systems on top of TypeScript and Web Component standards. Stencil components can be distributed natively to React, Angular, Vue, and traditional web developers from a single, framework-agnostic codebase.
https://stenciljs.com
Other
12.48k stars 783 forks source link

feat: Let globalScript take CustomElementsDefineOptions as parameter #3616

Closed FabioGimmillaro closed 1 year ago

FabioGimmillaro commented 1 year ago

Prerequisites

Describe the Feature Request

Hi.

I wrote a globalScript which stores the transformTagName function within CustomElementsDefineOptions to ensure that all my components know how to transform the tag name of internally used components.

To accomplish this I'm replacing the globalScripts function call within the loader.js function with this: globalScripts(options) Which is a bit hacky, because I don't know if this is still valid with future stencil versions.

So it would be awesome to get the CustomElementsDefineOptions either through the globalScript or maybe another approach.

Thanks.

Describe the Use Case

Because of the transformTagName functionality. Our design-system is used within multiple applications which are used as micro-frontends within other application using our design-system. Because we don't know the actual transformation of our tags we want to ensure to use the correct ones by using the already (from outside) defined tagNameTransform function.

Describe Preferred Solution

My preferred solution would be to just get the CustomElementsDefineOptions by using a stencil context only available from within my components.

Describe Alternatives

Related Code

No response

Additional Information

No response

FabioGimmillaro commented 1 year ago

Hey guys,

I just found another issue describing the same problem I am facing: https://github.com/ionic-team/stencil/issues/3269

Unfortunately I didn't see it in my search before submitting this issue.

alicewriteswrongs commented 1 year ago

Hello @FabioGimmillaro, thanks for taking the time to open this feature request and to look through the backlog. If #3269 captures what you're trying to raise here, would it be alright with you if we closed this?

FabioGimmillaro commented 1 year ago

Hi. Yes of course. :)

alicewriteswrongs commented 1 year ago

Great, thanks!