Skip to content

Commit dffdffa

Browse files
authored
Merge pull request #3279 from GetStream/perf/react-compiler
feat: enable react compiler in the Sample and Expo app
1 parent 5fe309e commit dffdffa

File tree

8 files changed

+299
-333
lines changed

8 files changed

+299
-333
lines changed

examples/ExpoMessaging/app.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
"updates": {
1616
"fallbackToCacheTimeout": 0
1717
},
18+
"experiments": {
19+
"reactCompiler": true
20+
},
1821
"assetBundlePatterns": ["**/*"],
1922
"ios": {
2023
"supportsTablet": true,

examples/ExpoMessaging/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,26 @@
1818
"@react-native-firebase/messaging": "^23.4.0",
1919
"@react-navigation/elements": "^2.6.4",
2020
"@react-navigation/native": "^7.1.8",
21-
"@shopify/flash-list": "^2.1.0",
22-
"expo": "54.0.13",
23-
"expo-audio": "~1.0.13",
21+
"@shopify/flash-list": "2.0.2",
22+
"expo": "54.0.22",
23+
"expo-audio": "~1.0.14",
2424
"expo-build-properties": "~1.0.9",
2525
"expo-clipboard": "~8.0.7",
26-
"expo-constants": "~18.0.9",
26+
"expo-constants": "~18.0.10",
2727
"expo-document-picker": "~14.0.7",
2828
"expo-file-system": "~19.0.17",
2929
"expo-haptics": "~15.0.7",
3030
"expo-image-manipulator": "~14.0.7",
3131
"expo-image-picker": "~17.0.8",
3232
"expo-linking": "~8.0.8",
3333
"expo-location": "~19.0.7",
34-
"expo-router": "~6.0.12",
34+
"expo-router": "~6.0.14",
3535
"expo-sharing": "~14.0.7",
3636
"expo-splash-screen": "~31.0.10",
3737
"expo-status-bar": "~3.0.8",
38-
"expo-video": "~3.0.11",
38+
"expo-video": "~3.0.14",
3939
"react": "19.1.0",
40-
"react-native": "0.81.4",
40+
"react-native": "0.81.5",
4141
"react-native-gesture-handler": "~2.28.0",
4242
"react-native-maps": "1.20.1",
4343
"react-native-reanimated": "~4.1.1",

examples/ExpoMessaging/yarn.lock

Lines changed: 263 additions & 321 deletions
Large diffs are not rendered by default.

examples/SampleApp/babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports = {
22
presets: ['module:@react-native/babel-preset'],
3-
plugins: ['react-native-worklets/plugin'],
3+
plugins: ['babel-plugin-react-compiler', 'react-native-worklets/plugin'],
44
};

examples/SampleApp/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
"@types/lodash.mergewith": "^4.6.9",
7676
"@types/react": "^19.1.0",
7777
"@types/react-test-renderer": "^19.1.0",
78+
"babel-plugin-react-compiler": "^1.0.0",
7879
"eslint": "^9.28.0",
7980
"eslint-plugin-eslint-comments": "^3.2.0",
8081
"eslint-plugin-jest": "^28.13.3",

examples/SampleApp/yarn.lock

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,11 @@
355355
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz#a7054dcc145a967dd4dc8fee845a57c1316c9df8"
356356
integrity sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==
357357

358+
"@babel/helper-validator-identifier@^7.28.5":
359+
version "7.28.5"
360+
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz#010b6938fab7cb7df74aa2bbc06aa503b8fe5fb4"
361+
integrity sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==
362+
358363
"@babel/helper-validator-option@^7.25.9":
359364
version "7.25.9"
360365
resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz#86e45bd8a49ab7e03f276577f96179653d41da72"
@@ -1033,6 +1038,14 @@
10331038
"@babel/helper-string-parser" "^7.25.9"
10341039
"@babel/helper-validator-identifier" "^7.25.9"
10351040

1041+
"@babel/types@^7.26.0":
1042+
version "7.28.5"
1043+
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.28.5.tgz#10fc405f60897c35f07e85493c932c7b5ca0592b"
1044+
integrity sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==
1045+
dependencies:
1046+
"@babel/helper-string-parser" "^7.27.1"
1047+
"@babel/helper-validator-identifier" "^7.28.5"
1048+
10361049
"@babel/types@^7.27.1", "@babel/types@^7.27.3", "@babel/types@^7.27.6":
10371050
version "7.27.6"
10381051
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.27.6.tgz#a434ca7add514d4e646c80f7375c0aa2befc5535"
@@ -3662,6 +3675,13 @@ babel-plugin-polyfill-regenerator@^0.6.1:
36623675
dependencies:
36633676
"@babel/helper-define-polyfill-provider" "^0.6.3"
36643677

3678+
babel-plugin-react-compiler@^1.0.0:
3679+
version "1.0.0"
3680+
resolved "https://registry.yarnpkg.com/babel-plugin-react-compiler/-/babel-plugin-react-compiler-1.0.0.tgz#bdf7360a23a4d5ebfca090255da3893efd07425f"
3681+
integrity sha512-Ixm8tFfoKKIPYdCCKYTsqv+Fd4IJ0DQqMyEimo+pxUOMUR9cVPlwTrFt9Avu+3cb6Zp3mAzl+t1MrG2fxxKsxw==
3682+
dependencies:
3683+
"@babel/types" "^7.26.0"
3684+
36653685
babel-plugin-syntax-hermes-parser@0.28.1:
36663686
version "0.28.1"
36673687
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-hermes-parser/-/babel-plugin-syntax-hermes-parser-0.28.1.tgz#9e80a774ddb8038307a62316486669c668fb3568"

package/src/components/Poll/components/PollAnswersList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export const PollAnswerListItem = ({ answer }: { answer: PollAnswer }) => {
126126
);
127127
};
128128

129-
const PollAnswerListItemComponent = ({ item }: { item: PollAnswer }) => (
129+
const renderPollAnswerListItem = ({ item }: { item: PollAnswer }) => (
130130
<PollAnswerListItem answer={item} />
131131
);
132132

@@ -149,7 +149,7 @@ export const PollAnswersListContent = ({
149149
data={pollAnswers}
150150
keyExtractor={(item) => `poll_answer_${item.id}`}
151151
onEndReached={() => hasNextPage && loadMore()}
152-
renderItem={PollAnswerListItemComponent}
152+
renderItem={renderPollAnswerListItem}
153153
{...additionalFlatListProps}
154154
/>
155155
<AnswerListAddCommentButton />

package/src/components/Poll/components/PollResults/PollOptionFullResults.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export type PollOptionFullResultsProps = PollContextValue & {
2121
PollOptionFullResultsContent?: React.ComponentType<{ option: PollOption }>;
2222
};
2323

24-
export const PollOptionFullResultsItem = ({ item }: { item: PollVoteClass }) => (
24+
export const renderPollOptionFullResultsItem = ({ item }: { item: PollVoteClass }) => (
2525
<PollVote vote={item} />
2626
);
2727

@@ -65,7 +65,7 @@ export const PollOptionFullResultsContent = ({
6565
keyExtractor={(item) => `option_full_results_${item.id}`}
6666
ListHeaderComponent={PollOptionFullResultsHeader}
6767
onEndReached={() => hasNextPage && loadMore()}
68-
renderItem={PollOptionFullResultsItem}
68+
renderItem={renderPollOptionFullResultsItem}
6969
{...additionalFlatListProps}
7070
/>
7171
</View>

0 commit comments

Comments
 (0)