Skip to content

Commit

Permalink
Exclude React Compiler runtime from inline requires (#1390)
Browse files Browse the repository at this point in the history
Summary:
Similar to #1126. This call is in every component on every render and it is not beneficial to inline it. On the contrary, you want to reduce the indirection there.

Changelog: [Performance] Exclude React Compiler runtime from inline requires

<!--
Changelog entries should be prefixed with one of the following scopes:
[Breaking, Feature, Fix, Performance, Deprecated, Experimental, Internal]

Examples:
  Changelog: [Fix] Respond with HTTP 404 when a bundle entry point cannot be resolved
  Changelog: [Internal]
-->
Changelog:

Pull Request resolved: #1390

Test Plan:
Before:

<img width="846" alt="Screenshot 2024-11-17 at 18 01 25" src="https://github.com/user-attachments/assets/3e04a6b0-dd41-4374-8872-bfc5a1982866">

After:

<img width="814" alt="Screenshot 2024-11-17 at 18 08 05" src="https://github.com/user-attachments/assets/fb9cd5dc-2f50-440a-a175-1859e63752a9">

Reviewed By: GijsWeterings

Differential Revision: D66075145

Pulled By: robhogan

fbshipit-source-id: 11a12fbd04620bdb3e5b9320aca8a02c1f05803f
  • Loading branch information
gaearon authored and facebook-github-bot committed Nov 18, 2024
1 parent 8c77416 commit b371180
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/metro/src/lib/transformHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const baseIgnoredInlineRequires = [
'react',
'react/jsx-dev-runtime',
'react/jsx-runtime',
'react-compiler-runtime',
'react-native',
];

Expand Down

0 comments on commit b371180

Please sign in to comment.