-
Notifications
You must be signed in to change notification settings - Fork 119
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
transformTagName compatibility #59
Conversation
…mponentsFactory with `transformTagName` parameter
React: The introduction of the factory function means that all components will need to be bundled and used together at all times. This will essentially prevent tree shaking. I would prefer to allow for the prefixing to occur in creation of the files rather than at runtime. Can you provide more info one why this would need to be done at runtime instead? |
@jthoms1 thanks for the feedback! |
I think with how it sits right now you would be correct about the treeshaking. As we continue to introduce new ways of having interactions between stencil components and frameworks this would be less true. So keeping it as static exports on a per component level would be prefered. With changing it as runtime I would assume that in your particular case components are not referencing each other. So 'dsn-cmp-a' would never reference 'dsn-cmp-b' or the renaming process would break some components. |
We do have references, but also handle them dynamically inside of each component of our stencil based components library. So yes, for example for the tree shaking.. is it possible to just generate the second file and keep the treeshakable as it is. or generate only one of them depending on the configuration, with a hint, that it will limit the treeshakability? |
I think disabling the polyfills and defineCustomElements is something that I should do. The process for applying unique tags at runtime is probably outside of the scope of this project. I will follow up with @adamdbradley and @manucorporat to see if there is something we can do to account for it. |
I have added code to allow for disabling of polyfills and defineCustomElements in PR #62. |
I think this could all be much simpler with a configuration option. Where you pass it a function that changes the tagName or selector. Then the output code doesn't need to change and it just updates during the generation of the files. I can create a quick PR to show what I mean. |
I created a PR that should accomplish the same thing but requires fewer changes. It is #84 |
Hey Josh, thanks for the update! For angular this solution works perfectly. For react there is still no way to change at runtime, as it seems. But with the new solution we could at least add a marker to string replace later on, that could work. We'll check that. In your new branch also both issues we experienced with 0.0.3 of angular and 0.0.7 of react are solved (angular had a wrong import and react did not respect it's default values (259d6f5#diff-482e662989a7e8fa634e455eddbbe7b8R14)). |
This patch would readd the possiblity to add factorySyntax optional based on #84 and it's not adding much code. Would that be a possibility?
|
…output-target # Conflicts: # packages/angular-output-target/src/generate-proxies.ts # packages/example-project/component-library-angular/src/directives/proxies.ts # packages/example-project/component-library-react/src/components.ts # packages/react-output-target/src/output-react.ts
This reverts commit a0f8370.
Issue/1002
Any update on this topic? |
@cstickel Hi, were you able to find a way to transform tags at run time for react wrapper ?. |
Any idea why this was closed? Did this functionality make it in the core library? |
We ended up not relying on |
Changes the wrappers to be compatible to changed tag names via
transformTagName
option.transformTagName
callback to dynamically change the rendered tag name