ionic-team / stencil-ds-output-targets

These are output targets that can be added to Stencil for React and Angular.
https://stenciljs.com
MIT License
249 stars 115 forks source link

bug: React output target 0.7.1 update #491

Open venkatesh-nagineni opened 1 week ago

venkatesh-nagineni commented 1 week ago

Prerequisites

Stencil Version

4.22

Stencil Framework Output Target

React

Stencil Framework Output Target Version

0.7.1

Current Behavior

As i updated react-output-target from 0.5.3 to 0.7.1, observed some changes especially how they get bundled with dist-custom-elements

what i have it in my stencil.config.ts with output target like

    {
        type: 'dist-custom-elements',
        customElementsExportBehavior: 'auto-define-custom-elements',
        externalRuntime: false,        
     },

after build with new react wrapper version, everything works as expected and running smoothly but vite bundler gives this warning as it bundles all components in one chunk and no tree shaking possible

As i only using single button component but it get's bundled everything

Screenshot 2024-10-08 at 11 28 58

Screenshot 2024-10-08 at 11 29 28

if i remove customElementsExportBehavior: 'auto-define-custom-elements', then i do not see chunk size exceed warning but it loads all components even i use single button component

Screenshot 2024-10-08 at 10 13 51

not sure what this update fix or did i make any wrong configuration

Expected Behavior

should work better with tree shaking and would be nice to provide any example how ionic handle this with example app via github

Steps to Reproduce

followed similar approach

https://github.com/yunker1/stencil-react-integration/tree/main/packages

Code Reproduction URL

https://github.com/yunker1/stencil-react-integration/tree/main/packages

Additional Information

No response

ionitron-bot[bot] commented 1 week ago

Thanks for the issue!

This project is currently maintained for the purposes of supporting Ionic Framework. At this time, only new issues & pull requests that support Ionic Framework will be prioritized. For the latest updates regarding the maintenance status of this project, please see this section of the project's README

ionitron-bot[bot] commented 19 hours ago

This issue has been labeled as help wanted. This label is added to issues that we believe would be good for contributors.

If you'd like to work on this issue, please comment here letting us know that you would like to submit a pull request for it. This helps us to keep track of the pull request and make sure there isn't duplicated effort. Thank you!