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

fix: Incorrect types export #99

Conversation

lukmccall
Copy link
Contributor

Exporting a type without annotation (not using export type) can cause some unexpected bugs. For example, when using tools like rnx-kit with tree shaking enabled, the project may fail to compile because it tries to import a non-existing type. During the tree shaking step, those types are removed, so using correct export annotations can help avoid these issues.

@alexbrazier
Copy link
Owner

I actually reverted this change a while ago due to it causing import errors for some people #17 #16

I'm assuming this will bring back those issues again?

@lukmccall
Copy link
Contributor Author

Hello @alexbrazier, thank you for your response! AFAIK, the bundler should load the compiled JavaScript file instead of the source folder. In the linked issue, it seems like Metro is attempting to use the .ts file for some unknown reason. I'm not sure if your package was built before it was published four years ago. Still, currently, you are publishing compiled JavaScript files that shouldn't contain any information regarding exported types, at least not in .js files.

Copy link
Owner

@alexbrazier alexbrazier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it should be fine and there seem to be some other type exports in the project so happy to try it

@alexbrazier alexbrazier merged commit 484414f into alexbrazier:master Apr 13, 2024
4 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants