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

fix(metro): Avoid importing tslib in Sentry Metro Plugin #4573

Merged
merged 2 commits into from
Feb 20, 2025

Conversation

krystofwoldrich
Copy link
Member

@krystofwoldrich krystofwoldrich commented Feb 20, 2025

📢 Type of change

  • Bugfix

📜 Description

The Sentry RN Package doesn't depend on tslib so it should not import it in its dist files.

The only file where tslib was imported was metroconfig.js.

tslib was removed in Sentry JS already in v7 -> getsentry/sentry-javascript#9299

💚 How did you test it?

checked that tslib is not part of the output in dist.

📝 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

Copy link
Contributor

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 360.28 ms 349.40 ms -10.87 ms
Size 17.75 MiB 20.11 MiB 2.36 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
f54118b 441.24 ms 431.92 ms -9.32 ms
8900e1a+dirty 430.68 ms 456.13 ms 25.44 ms
cdf2f33 469.46 ms 462.17 ms -7.29 ms
83f6f6c 418.83 ms 410.94 ms -7.89 ms
24cb2a4 451.04 ms 446.07 ms -4.98 ms
40c35c5 438.38 ms 437.52 ms -0.86 ms
6e8584e 447.10 ms 474.71 ms 27.61 ms
baa882f 354.93 ms 356.18 ms 1.25 ms
d8668ce 452.13 ms 435.06 ms -17.07 ms
e540498 436.26 ms 433.00 ms -3.26 ms

App size

Revision Plain With Sentry Diff
f54118b 17.74 MiB 20.08 MiB 2.35 MiB
8900e1a+dirty 17.73 MiB 19.75 MiB 2.01 MiB
cdf2f33 17.74 MiB 20.08 MiB 2.34 MiB
83f6f6c 17.74 MiB 20.09 MiB 2.35 MiB
24cb2a4 17.75 MiB 20.11 MiB 2.36 MiB
40c35c5 17.75 MiB 20.11 MiB 2.37 MiB
6e8584e 17.73 MiB 19.86 MiB 2.12 MiB
baa882f 17.73 MiB 20.06 MiB 2.33 MiB
d8668ce 17.74 MiB 20.08 MiB 2.34 MiB
e540498 17.73 MiB 20.11 MiB 2.37 MiB

Copy link
Contributor

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 372.88 ms 384.53 ms 11.65 ms
Size 7.15 MiB 8.38 MiB 1.22 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
4161236+dirty 429.89 ms 498.74 ms 68.85 ms
ee4aab8+dirty 494.84 ms 574.57 ms 79.73 ms
ddc0552+dirty 405.80 ms 480.00 ms 74.20 ms
575f9da+dirty 337.15 ms 370.47 ms 33.32 ms
a38594f+dirty 393.83 ms 422.12 ms 28.29 ms
c6f01ea+dirty 379.95 ms 439.35 ms 59.40 ms
5446992+dirty 371.61 ms 390.00 ms 18.39 ms
8b86336+dirty 484.80 ms 537.94 ms 53.14 ms
e22745e+dirty 415.50 ms 448.76 ms 33.26 ms
205982c+dirty 383.94 ms 424.98 ms 41.04 ms

App size

Revision Plain With Sentry Diff
4161236+dirty 7.15 MiB 8.38 MiB 1.23 MiB
ee4aab8+dirty 7.15 MiB 8.38 MiB 1.23 MiB
ddc0552+dirty 7.15 MiB 8.37 MiB 1.22 MiB
575f9da+dirty 7.15 MiB 8.10 MiB 979.68 KiB
a38594f+dirty 7.15 MiB 8.38 MiB 1.23 MiB
c6f01ea+dirty 7.15 MiB 8.37 MiB 1.22 MiB
5446992+dirty 7.15 MiB 8.12 MiB 999.45 KiB
8b86336+dirty 7.15 MiB 8.38 MiB 1.23 MiB
e22745e+dirty 7.15 MiB 8.35 MiB 1.20 MiB
205982c+dirty 7.15 MiB 8.38 MiB 1.23 MiB

Copy link
Contributor

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1225.50 ms 1231.16 ms 5.66 ms
Size 2.63 MiB 3.74 MiB 1.11 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
d16beca+dirty 1215.94 ms 1228.20 ms 12.27 ms
5a22220+dirty 1209.49 ms 1220.94 ms 11.45 ms
2534337+dirty 1225.08 ms 1230.26 ms 5.17 ms
1d86dd6+dirty 1249.71 ms 1279.16 ms 29.45 ms
ddc0552+dirty 1236.13 ms 1248.17 ms 12.05 ms
205982c+dirty 1226.83 ms 1234.36 ms 7.53 ms
e4d9fe0+dirty 1221.43 ms 1238.51 ms 17.08 ms
b1e8712+dirty 1256.02 ms 1265.14 ms 9.12 ms
afe5fcb+dirty 1220.94 ms 1214.73 ms -6.21 ms
21a0abb+dirty 1225.31 ms 1227.00 ms 1.69 ms

App size

Revision Plain With Sentry Diff
d16beca+dirty 2.36 MiB 3.12 MiB 779.39 KiB
5a22220+dirty 2.36 MiB 2.92 MiB 570.21 KiB
2534337+dirty 2.36 MiB 2.88 MiB 525.47 KiB
1d86dd6+dirty 2.36 MiB 2.89 MiB 535.43 KiB
ddc0552+dirty 2.36 MiB 3.11 MiB 759.84 KiB
205982c+dirty 2.36 MiB 3.11 MiB 760.04 KiB
e4d9fe0+dirty 2.63 MiB 3.70 MiB 1.06 MiB
b1e8712+dirty 2.36 MiB 2.84 MiB 488.84 KiB
afe5fcb+dirty 2.63 MiB 3.70 MiB 1.06 MiB
21a0abb+dirty 2.63 MiB 3.70 MiB 1.06 MiB

Copy link
Contributor

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1233.48 ms 1235.73 ms 2.25 ms
Size 3.19 MiB 4.30 MiB 1.12 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
d16beca+dirty 1239.00 ms 1233.89 ms -5.11 ms
5a22220+dirty 1246.18 ms 1249.61 ms 3.43 ms
2534337+dirty 1220.87 ms 1221.47 ms 0.60 ms
1d86dd6+dirty 1289.25 ms 1293.36 ms 4.11 ms
ddc0552+dirty 1246.00 ms 1241.98 ms -4.02 ms
205982c+dirty 1228.06 ms 1237.72 ms 9.66 ms
e4d9fe0+dirty 1210.45 ms 1204.23 ms -6.21 ms
b1e8712+dirty 1284.11 ms 1297.82 ms 13.71 ms
afe5fcb+dirty 1223.53 ms 1223.90 ms 0.37 ms
21a0abb+dirty 1224.37 ms 1225.61 ms 1.24 ms

App size

Revision Plain With Sentry Diff
d16beca+dirty 2.92 MiB 3.69 MiB 790.48 KiB
5a22220+dirty 2.92 MiB 3.48 MiB 575.81 KiB
2534337+dirty 2.92 MiB 3.43 MiB 529.76 KiB
1d86dd6+dirty 2.92 MiB 3.44 MiB 538.27 KiB
ddc0552+dirty 2.92 MiB 3.67 MiB 772.47 KiB
205982c+dirty 2.92 MiB 3.67 MiB 772.63 KiB
e4d9fe0+dirty 3.19 MiB 4.26 MiB 1.08 MiB
b1e8712+dirty 2.92 MiB 3.40 MiB 494.15 KiB
afe5fcb+dirty 3.19 MiB 4.26 MiB 1.08 MiB
21a0abb+dirty 3.19 MiB 4.26 MiB 1.08 MiB

Copy link
Collaborator

@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 🚀

@krystofwoldrich krystofwoldrich merged commit c991c90 into main Feb 20, 2025
72 checks passed
@krystofwoldrich krystofwoldrich deleted the kw-avoid-importing-tslib branch February 20, 2025 12:25
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.

Error loading metro config: Cannot find module 'tslib'
2 participants