Skip to content

Commit

Permalink
chore(metro-runtime): Use process.env.EXPO_OS platform env checks t…
Browse files Browse the repository at this point in the history
…o reduce (#27636)

# Why

- Importing `react-native` (native or web) is heavy and can lead to
places for web tree shaking to break. In root libraries such as
`expo/metro-runtime` we should make all code paths as light as possible.
- This change uses the `process.env.EXPO_OS` global transform to skip
importing react-native at the bundle root for certain passes.

---------

Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
  • Loading branch information
2 people authored and marklawlor committed Mar 18, 2024
1 parent 44d7c74 commit 0eafde8
Show file tree
Hide file tree
Showing 24 changed files with 51 additions and 61 deletions.
1 change: 1 addition & 0 deletions packages/@expo/metro-runtime/CHANGELOG.md
Expand Up @@ -12,6 +12,7 @@

### 💡 Others

- Use `process.env.EXPO_OS` platform env checks to reduce `react-native` imports. ([#27636](https://github.com/expo/expo/pull/27636) by [@EvanBacon](https://github.com/EvanBacon))
- Use `typeof window` checks for removing server code. ([#27514](https://github.com/expo/expo/pull/27514) by [@EvanBacon](https://github.com/EvanBacon))

## 3.1.3 - 2024-02-06
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0eafde8

Please sign in to comment.