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(package.json): remove "react-native" export condition #1530

Merged
merged 2 commits into from
Jan 7, 2025

Conversation

joshuayoes
Copy link
Contributor

@joshuayoes joshuayoes commented Jan 3, 2025

Please verify the following:

  • yarn build-and-test:local passes
  • I have added tests for any new features, if relevant

Describe your PR

This PR removes the "react-native" export condition from all of our Reactotron packages. This is a shortcut fix for #1430

This PR is essentially the same solution as this community patch: #1430 (comment)

This was added in #1326 to improve errors and stack traces, but it appears that some issues with Reactotron's types are causing compilation issues with people's bundler and test setups.

This should ultimately be fixed by making Reactotron's types more robust and strict, but to improve our user experience now, we are implementing this solution.

@joshuayoes joshuayoes added the bug 🪲 Nope, this is wrong. label Jan 3, 2025
@joshuayoes joshuayoes self-assigned this Jan 3, 2025
Comment on lines +160 to +168
if (packageJson.exports["react-native"]) {
console.error(
[
`Invalid ${packageJsonPath} exports.react-native field should not exist`,
`Remove this check once typescript types are more stable`,
`See https://github.com/infinitered/reactotron/issues/1430`,
].join("\n")
)
process.exit(1)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Prettier formatting made a bunch of noise in this file but this is the actual change

Copy link
Member

@jamonholmgren jamonholmgren left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for jumping on this @joshuayoes !

@joshuayoes joshuayoes merged commit 47be69f into master Jan 7, 2025
3 checks passed
@joshuayoes joshuayoes deleted the fix/package-json-export-react-native branch January 7, 2025 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Nope, this is wrong.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants