Skip to content

fix(expo): Do not try to load native components in Expo Go#4696

Merged
krystofwoldrich merged 8 commits intomainfrom
fix-native-components-expo-go
Mar 27, 2025
Merged

fix(expo): Do not try to load native components in Expo Go#4696
krystofwoldrich merged 8 commits intomainfrom
fix-native-components-expo-go

Conversation

@krystofwoldrich
Copy link
Copy Markdown
Contributor

📢 Type of change

  • Bugfix
  • Enhancement

📜 Description

I don't know since what version of Expo Go this is happening, but it seems like a bug in the Expo Go project. The UIManager.hasViewManagerConfig(nativeComponentName) evaluates to thru on JS reloads and hot reloads, although the Sentry native implementation is not present.

💡 Motivation and Context

This causes unhandled errors, which in Expo Go don't crash the app, but show the Red Box and are making the Dev experience bad.

💚 How did you test it?

run expo sample in expo go

📝 Checklist

  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • All tests passing
  • No breaking changes

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 27, 2025

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 457.86 ms 483.82 ms 25.97 ms
Size 17.75 MiB 20.13 MiB 2.38 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
e73d82f 475.82 ms 506.55 ms 30.73 ms
7fd512a 442.18 ms 437.57 ms -4.61 ms
b1e8712 462.11 ms 465.71 ms 3.60 ms
5571a20 410.55 ms 441.06 ms 30.51 ms
9385d74 432.71 ms 423.56 ms -9.15 ms
7e87527 425.56 ms 407.64 ms -17.93 ms
0677344 327.74 ms 337.14 ms 9.40 ms
2534337 394.15 ms 415.12 ms 20.97 ms
8900e1a+dirty 430.68 ms 456.13 ms 25.44 ms
13f280b 486.16 ms 472.45 ms -13.71 ms

App size

Revision Plain With Sentry Diff
e73d82f 17.73 MiB 20.07 MiB 2.33 MiB
7fd512a 17.74 MiB 20.08 MiB 2.35 MiB
b1e8712 17.73 MiB 19.75 MiB 2.02 MiB
5571a20 17.73 MiB 19.93 MiB 2.19 MiB
9385d74 17.74 MiB 20.09 MiB 2.35 MiB
7e87527 17.75 MiB 20.11 MiB 2.37 MiB
0677344 17.73 MiB 19.81 MiB 2.07 MiB
2534337 17.73 MiB 19.84 MiB 2.11 MiB
8900e1a+dirty 17.73 MiB 19.75 MiB 2.01 MiB
13f280b 17.74 MiB 20.08 MiB 2.34 MiB

Base automatically changed from kw-fix-app-registry to main March 27, 2025 08:39
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 27, 2025

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1209.84 ms 1204.15 ms -5.69 ms
Size 3.19 MiB 4.33 MiB 1.14 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
484813b+dirty 1225.07 ms 1221.00 ms -4.07 ms
60d7316+dirty 1224.33 ms 1231.29 ms 6.96 ms
22e31b6+dirty 1276.55 ms 1278.12 ms 1.57 ms
e22745e+dirty 1246.02 ms 1233.60 ms -12.42 ms
e1ea4a8+dirty 1228.98 ms 1222.80 ms -6.18 ms
0d3e677+dirty 1239.02 ms 1241.22 ms 2.20 ms
c639edf+dirty 1223.63 ms 1227.98 ms 4.35 ms
7d161c0+dirty 1239.57 ms 1250.46 ms 10.89 ms
abb7058+dirty 1260.28 ms 1266.56 ms 6.28 ms
22bcd92+dirty 1219.98 ms 1225.23 ms 5.25 ms

App size

Revision Plain With Sentry Diff
484813b+dirty 2.92 MiB 3.64 MiB 740.56 KiB
60d7316+dirty 3.19 MiB 4.30 MiB 1.12 MiB
22e31b6+dirty 2.92 MiB 3.43 MiB 524.74 KiB
e22745e+dirty 2.92 MiB 3.66 MiB 756.73 KiB
e1ea4a8+dirty 2.92 MiB 3.66 MiB 756.65 KiB
0d3e677+dirty 2.92 MiB 3.66 MiB 758.42 KiB
c639edf+dirty 2.92 MiB 3.64 MiB 742.55 KiB
7d161c0+dirty 3.19 MiB 4.32 MiB 1.13 MiB
abb7058+dirty 2.92 MiB 3.43 MiB 524.53 KiB
22bcd92+dirty 3.19 MiB 4.33 MiB 1.14 MiB

Copy link
Copy Markdown
Contributor

@antonis antonis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀
Thank you for this fix Krystof 🙇

@krystofwoldrich krystofwoldrich merged commit 88a0b65 into main Mar 27, 2025
64 checks passed
@krystofwoldrich krystofwoldrich deleted the fix-native-components-expo-go branch March 27, 2025 08:56
@github-actions
Copy link
Copy Markdown
Contributor

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 397.54 ms 402.33 ms 4.78 ms
Size 7.15 MiB 8.40 MiB 1.25 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
9f0f6c8+dirty 365.53 ms 419.16 ms 53.63 ms
5852d77+dirty 378.83 ms 381.89 ms 3.06 ms
e46354e+dirty 389.74 ms 376.18 ms -13.56 ms
9c48b2c+dirty 270.82 ms 321.12 ms 50.30 ms
c81e67f+dirty 355.71 ms 364.96 ms 9.24 ms
cdf2bdf+dirty 391.69 ms 461.14 ms 69.45 ms
9a3ca65+dirty 344.96 ms 358.92 ms 13.96 ms
7fd512a+dirty 439.69 ms 503.71 ms 64.01 ms
22e31b6+dirty 295.75 ms 346.73 ms 50.98 ms
c4bd70f+dirty 404.70 ms 424.00 ms 19.30 ms

App size

Revision Plain With Sentry Diff
9f0f6c8+dirty 7.15 MiB 8.37 MiB 1.22 MiB
5852d77+dirty 7.15 MiB 8.38 MiB 1.22 MiB
e46354e+dirty 7.15 MiB 8.39 MiB 1.23 MiB
9c48b2c+dirty 7.15 MiB 8.07 MiB 947.16 KiB
c81e67f+dirty 7.15 MiB 8.39 MiB 1.23 MiB
cdf2bdf+dirty 7.15 MiB 8.38 MiB 1.23 MiB
9a3ca65+dirty 7.15 MiB 8.09 MiB 962.83 KiB
7fd512a+dirty 7.15 MiB 8.35 MiB 1.21 MiB
22e31b6+dirty 7.15 MiB 8.10 MiB 981.29 KiB
c4bd70f+dirty 7.15 MiB 8.39 MiB 1.23 MiB

@github-actions
Copy link
Copy Markdown
Contributor

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1225.45 ms 1218.79 ms -6.66 ms
Size 2.63 MiB 3.76 MiB 1.13 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
484813b+dirty 1222.45 ms 1220.79 ms -1.66 ms
60d7316+dirty 1219.13 ms 1221.74 ms 2.61 ms
22e31b6+dirty 1253.62 ms 1265.96 ms 12.34 ms
e22745e+dirty 1222.73 ms 1224.98 ms 2.25 ms
e1ea4a8+dirty 1233.49 ms 1237.71 ms 4.22 ms
0d3e677+dirty 1214.39 ms 1225.70 ms 11.31 ms
c639edf+dirty 1236.18 ms 1235.04 ms -1.14 ms
7d161c0+dirty 1215.20 ms 1218.64 ms 3.43 ms
abb7058+dirty 1255.42 ms 1268.86 ms 13.44 ms
22bcd92+dirty 1230.50 ms 1233.39 ms 2.89 ms

App size

Revision Plain With Sentry Diff
484813b+dirty 2.36 MiB 3.08 MiB 734.18 KiB
60d7316+dirty 2.63 MiB 3.74 MiB 1.11 MiB
22e31b6+dirty 2.36 MiB 2.87 MiB 520.67 KiB
e22745e+dirty 2.36 MiB 3.10 MiB 752.32 KiB
e1ea4a8+dirty 2.36 MiB 3.10 MiB 752.31 KiB
0d3e677+dirty 2.36 MiB 3.10 MiB 753.12 KiB
c639edf+dirty 2.36 MiB 3.08 MiB 736.63 KiB
7d161c0+dirty 2.63 MiB 3.75 MiB 1.12 MiB
abb7058+dirty 2.36 MiB 2.87 MiB 520.42 KiB
22bcd92+dirty 2.63 MiB 3.76 MiB 1.13 MiB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants