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

feat(expo): Dynamically resolve default integrations based on platform #3465

Merged
merged 5 commits into from
Jan 9, 2024

Conversation

krystofwoldrich
Copy link
Member

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Currently, the same default integrations are added for all types of builds. This causes multiple warnings and error logs during event processing. Although events are processed correctly this might confuse the SDK users.

Before:

Screenshot 2023-12-13 at 15 10 38

After:

Screenshot 2023-12-13 at 15 13 56

Note: The SDK Info warning will be removed in the next PR with Expo Modules implementation.

💚 How did you test it?

sample app

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled
  • All tests passing
  • No breaking changes

🔮 Next steps

@krystofwoldrich krystofwoldrich self-assigned this Dec 13, 2023
Copy link
Contributor

github-actions bot commented Dec 13, 2023

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against ecde2d0

Copy link
Contributor

github-actions bot commented Dec 13, 2023

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 380.16 ms 399.86 ms 19.70 ms
Size 17.73 MiB 19.84 MiB 2.11 MiB

Baseline results on branch: expo

Startup times

Revision Plain With Sentry Diff
bc4097b 419.25 ms 458.81 ms 39.56 ms

App size

Revision Plain With Sentry Diff
bc4097b 17.73 MiB 19.84 MiB 2.11 MiB

Copy link
Contributor

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 368.31 ms 390.04 ms 21.73 ms
Size 7.15 MiB 8.11 MiB 989.12 KiB

Baseline results on branch: expo

Startup times

Revision Plain With Sentry Diff
bc4097b+dirty 378.29 ms 413.31 ms 35.01 ms

App size

Revision Plain With Sentry Diff
bc4097b+dirty 7.15 MiB 8.11 MiB 988.88 KiB

@krystofwoldrich krystofwoldrich marked this pull request as ready for review December 13, 2023 15:30
Copy link
Contributor

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1212.35 ms 1216.16 ms 3.81 ms
Size 2.92 MiB 3.43 MiB 528.70 KiB

Baseline results on branch: expo

Startup times

Revision Plain With Sentry Diff
bc4097b+dirty 1229.02 ms 1235.65 ms 6.63 ms

App size

Revision Plain With Sentry Diff
bc4097b+dirty 2.92 MiB 3.43 MiB 528.75 KiB

Copy link
Collaborator

@lucas-zimerman lucas-zimerman left a comment

Choose a reason for hiding this comment

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

The comments that I made also applies to the old behaviour so it's not blocking this PR, with that I am approving the PR :D


integrations.push(createReactNativeRewriteFrames());

if (options.enableNative) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

users can set this parameter to true, should we also check for notweb() here?

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought about that too, probably isNativeAvailable would be even better, since there can be the case when we are not on the web but native is not available.

But since the enableNative was in the past enforcing I wanted to keep that.

if (options.enableNative) {
integrations.push(new DeviceContext());
integrations.push(new ModulesLoader());
if (options.attachScreenshot) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we warn users if debug is enabled that attachScreenshot will not be enabled because it's not supported on the web environment?

Copy link
Member Author

Choose a reason for hiding this comment

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

I see the point, I think it makes sense, but for now, I would leave the warning only for cases when we expected something to work and it doesn't. So in happy scenarios, there are no warnings.

@krystofwoldrich krystofwoldrich merged commit dc8966b into expo Jan 9, 2024
29 of 69 checks passed
@krystofwoldrich krystofwoldrich deleted the kw-add-dynamic-default-integrations branch January 9, 2024 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants