Skip to content

fix(transport): Fallback to fetch transport if native not available#2695

Merged
krystofwoldrich merged 22 commits into5.0.0from
ref-client-constructor
Dec 20, 2022
Merged

fix(transport): Fallback to fetch transport if native not available#2695
krystofwoldrich merged 22 commits into5.0.0from
ref-client-constructor

Conversation

@krystofwoldrich
Copy link
Copy Markdown
Contributor

@krystofwoldrich krystofwoldrich commented Dec 13, 2022

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Fixes the unreachable fallback to the fetch transport.

Simplify client constructor. Make it more readable.

💡 Motivation and Context

Not working fetch transport.

💚 How did you test it?

unit tests

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • All tests passing
  • No breaking changes

🔮 Next steps

@krystofwoldrich krystofwoldrich changed the title ref(client): Remove dep on BrowserClient ref(client): Simplify client constructor Dec 13, 2022
@krystofwoldrich krystofwoldrich marked this pull request as draft December 14, 2022 09:42
* @param options Configuration options for this SDK.
*/
public constructor(options: ReactNativeClientOptions) {
if (!options.transport) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

option.transport is required and has a fallback in sdk.tsx, so this if statement wasn't working

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 14, 2022

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 294.29 ms 310.28 ms 15.99 ms
Size 17.73 MiB 19.95 MiB 2.22 MiB

Baseline results on branch: 5.0.0

Startup times

Revision Plain With Sentry Diff
b868b53+dirty 339.52 ms 369.84 ms 30.32 ms
d091239+dirty 425.61 ms 447.11 ms 21.50 ms

App size

Revision Plain With Sentry Diff
b868b53+dirty 17.73 MiB 19.95 MiB 2.22 MiB
d091239+dirty 17.73 MiB 19.95 MiB 2.22 MiB

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 14, 2022

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 307.61 ms 324.45 ms 16.83 ms
Size 7.15 MiB 8.00 MiB 874.26 KiB

Baseline results on branch: 5.0.0

Startup times

Revision Plain With Sentry Diff
b868b53+dirty 321.42 ms 342.74 ms 21.32 ms
d091239+dirty 340.16 ms 366.42 ms 26.26 ms

App size

Revision Plain With Sentry Diff
b868b53+dirty 7.15 MiB 8.00 MiB 874.27 KiB
d091239+dirty 7.15 MiB 8.00 MiB 874.38 KiB

@krystofwoldrich krystofwoldrich marked this pull request as ready for review December 14, 2022 13:06
@krystofwoldrich krystofwoldrich changed the title ref(client): Simplify client constructor fix(transport): Fallback to fetch transport if native not available Dec 14, 2022
@github-actions
Copy link
Copy Markdown
Contributor

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1272.82 ms 1287.68 ms 14.86 ms
Size 2.92 MiB 3.30 MiB 387.20 KiB

Base automatically changed from refactor-client-event-from to 5.0.0 December 16, 2022 10:49
@krystofwoldrich
Copy link
Copy Markdown
Contributor Author

This is ready for review.

* This is a workaround for now using fetch on RN, this is a known issue in react-native and only generates a warning
* YellowBox deprecated and replaced with with LogBox in RN 0.63
*/
export function ignoreRequireCycleLogs(): void {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I agree with the refactoring here and separating the concerns.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 20, 2022

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1240.00 ms 1279.57 ms 39.57 ms
Size 2.36 MiB 2.74 MiB 384.61 KiB

Baseline results on branch: 5.0.0

Startup times

Revision Plain With Sentry Diff
b868b53+dirty 1274.90 ms 1305.68 ms 30.78 ms
d091239+dirty 1251.49 ms 1276.75 ms 25.26 ms

App size

Revision Plain With Sentry Diff
b868b53+dirty 2.36 MiB 2.74 MiB 384.64 KiB
d091239+dirty 2.36 MiB 2.74 MiB 384.64 KiB

@krystofwoldrich krystofwoldrich merged commit cd7054e into 5.0.0 Dec 20, 2022
@krystofwoldrich krystofwoldrich deleted the ref-client-constructor branch December 20, 2022 16:03
@krystofwoldrich krystofwoldrich mentioned this pull request Jan 30, 2023
9 tasks
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