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: crash with React Native #1724

Merged
merged 3 commits into from
Oct 30, 2023
Merged

fix: crash with React Native #1724

merged 3 commits into from
Oct 30, 2023

Conversation

horstleung
Copy link
Contributor

RN support Websocket, better to use it directly.

Sample code for detecting is React native:
https://snack.expo.dev/-QQjqDN-8

Discussion:

  • navigator.product is removed from modern web standard
  • React native is not a browser, should we put it in isBrowser function?

Escape using ws package for websocket in React native app
fix typo in comment
@horstleung horstleung changed the title fix crash with React Native fix: crash with React Native Oct 25, 2023
robertsLando
robertsLando previously approved these changes Oct 26, 2023
@robertsLando
Copy link
Member

React native is not a browser, should we put it in isBrowser function?

The is-browser env is useful only to prevent loading nodejs related protocols, if react-native doesn't support them that's like a browser so it's ok

@robertsLando
Copy link
Member

robertsLando commented Oct 26, 2023

Please fix lint issues: npm run lint-fix

@codecov
Copy link

codecov bot commented Oct 26, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (cc48d45) 81.03% compared to head (2a16b39) 81.03%.

❗ Current head 2a16b39 differs from pull request most recent head b0dffad. Consider uploading reports for the commit b0dffad to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1724   +/-   ##
=======================================
  Coverage   81.03%   81.03%           
=======================================
  Files          21       21           
  Lines        1366     1366           
  Branches      323      323           
=======================================
  Hits         1107     1107           
  Misses        182      182           
  Partials       77       77           
Files Coverage Δ
src/lib/is-browser.ts 66.66% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@robertsLando robertsLando enabled auto-merge (squash) October 30, 2023 08:13
@robertsLando robertsLando merged commit f6123f2 into mqttjs:main Oct 30, 2023
3 checks passed
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