fix(expo): export app.plugin.js entry points for typescript packages #8837
+4
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The packages migrated to typescript have explicit
exportsstatements in package.json which restrict what entry points may be accessed when standard node module resolution rules are followedExpo config plugins uses a resolver that follows those rules, so it was following the exports declarations that are new in the typescript-migrated packages
Ergo, if we are going to specify exports, we must also specify the expo plugin export, or it can't be resolved via module resolution rules used by expo and the plugin fails to load
Related issues
Not marking it as a "fix" yet because there is still an outstanding issue for other/web reported by a user, but this should fix expo users on android / ios
Release Summary
fix release commit, should generate a fix release
Checklist
AndroidiOSOther(macOS, web)e2etests added or updated inpackages/\*\*/e2ejesttests added or updated inpackages/\*\*/__tests__Test Plan
I have an almost-completely-working expo build demo of react-native-firebase working now:
https://github.com/mikehardy/rnfbdemo/blob/rnfb-expo-demo/make-expo-demo.sh
Most importantly for this PR, when I got it working to the point where it configured the config plugins, I reproduced the error (as hoped!) that was reported in #8829
I was able to track it down to the exports fields in the package.json of the migrated packages and verify
expo prebuildworked correctly via directly manipulating the package.json files in node_modules there, then carried that fix here to this PRThink
react-native-firebaseis great? Please consider supporting the project with any of the below:React Native FirebaseandInvertaseon Twitter