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

feat(cli): Pass unstable_transformProfile to export(:embed) automatically if targeting hermes #25132

Merged
merged 4 commits into from Oct 31, 2023

Conversation

EvanBacon
Copy link
Contributor

Why

Production bundling can skip minification if targeting Hermes because Hermes will perform minification during bytecode creation.

Two concerns:

  1. I can't find any docs on Hermes minification so it's unclear to me if the results are suboptimal.
  2. If a user is building an app manually and the app.json is out of sync with the native project settings, then they could end up not minifying their JSC project source.

@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label Oct 31, 2023
@expo-bot expo-bot added bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels Oct 31, 2023
@EvanBacon EvanBacon merged commit 818d377 into main Oct 31, 2023
5 of 7 checks passed
@EvanBacon EvanBacon deleted the @evanbacon/cli/export-for-hermes branch October 31, 2023 23:15
EvanBacon pushed a commit that referenced this pull request Nov 2, 2023
# Why

@gabrieldonadel reported an issue in
https://github.com/expo/expo/blob/ed860e5e2478a5f9994ffa5682f7a7dff5bdd63c/packages/expo-dev-launcher/ios/main.jsbundle
where the bundle size is doubled.

the root cause is from #25132 and we use `export:embed` without
specifying jsEngine in expo-dev-menu & expo-dev-launcher. that would use
hermes transform profiler and not minify the bundle.

# How

specify the default transform profile because the bundles should support
JSC as well.

# Test Plan

check the bundle sizes are under 2.5MB

# Checklist

- n/a Documentation is up to date to reflect these changes (eg:
https://docs.expo.dev and README.md).
  - fixing issues before publishing packages
- [x] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
- [x] This diff will work correctly for `npx expo prebuild` & EAS Build
(eg: updated a module plugin).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: fingerprint changed bot: passed checks ExpoBot has nothing to complain about
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants