Skip to content
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

Explicit React imports #503

Open
jy95 opened this issue Jun 27, 2022 · 2 comments
Open

Explicit React imports #503

jy95 opened this issue Jun 27, 2022 · 2 comments

Comments

@jy95
Copy link

jy95 commented Jun 27, 2022

Hello @iamhosseindhv ,

As tsdx has Treeshaking, I think it could be a good idea to explicitly write you are using in React ;

image
image
image

Kind regards

@iamhosseindhv
Copy link
Owner

Hi @jy95. Would you be able to explain what different it makes to change imports as suggested above, and how treeshaking affects this please? Many thanks

@jy95
Copy link
Author

jy95 commented Jun 27, 2022

Hello @iamhosseindhv,

Currently, you are using tsdx that builds your code.
(dts-cli is a maintained fork with updated dependencies including a nice JSX transform )
Give a look to React plan : facebook/react#11503 (comment)

People consuming your ESM entrypoint (dist/notistack.esm.js) will be able to get a lighter payload : nothing prevents you to experiment yourself with dts-cli on a test branch ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants