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(expo-router)!: compile as ESM #27638

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

EvanBacon
Copy link
Contributor

@EvanBacon EvanBacon commented Mar 13, 2024

Why

We changed the compilation to cjs to support importing manifest code in the CLI without needing to bundle, but as a result, all of react-native-web is pulled in to web projects. This PR changes the bundle format back to esm, and adds a cjs build step to the prepare script which can be used in CLI to access the manifest functions. The change results in decent bundle size savings: 950kb -> 880kb in static-rendering e2e test.

We'll need a follow up PR to do something similar to expo/metro-runtime so we aren't pulling in everything in development too.

Test Plan

  • All tests should continue passing.

Checklist

@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label Mar 13, 2024
Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
@expo-bot expo-bot added bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: fingerprint compatible bot: passed checks ExpoBot has nothing to complain about
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants