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: support react-native #97

Merged
merged 3 commits into from
Dec 10, 2023
Merged

Conversation

achingbrain
Copy link
Collaborator

React-native has a hobbled URL class that seems to make it's own WebSocket class cause a fatal crash so stringify it before passing it in.

Otherwise the URL class is supported everywhere now so no need to use iso-url any more.

Also noteworthy is that react-native doesn't have any node core modules so we have to use a similar browser override system to ensure the pure-js/browser APIs are used instead.

React-native has a hobbled URL class that seems to make it's own
WebSocket class cause a fatal crash so stringify it before passing
it in.

Otherwise the URL class is supported everywhere now so no need to
use iso-url any more.

Also noteworthy is that react-native doesn't have any node core
modules so we have to use a similar browser override system to ensure
the pure-js/browser APIs are used instead.
Copy link

codecov bot commented Dec 8, 2023

Codecov Report

Attention: 19 lines in your changes are missing coverage. Please review.

Comparison is base (7a96e45) 96.07% compared to head (9407b67) 94.71%.
Report is 22 commits behind head on master.

Files Patch % Lines
test/error.spec.ts 57.14% 15 Missing ⚠️
src/source.ts 92.59% 2 Missing ⚠️
src/server.ts 93.33% 1 Missing ⚠️
src/sink.ts 90.90% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #97      +/-   ##
==========================================
- Coverage   96.07%   94.71%   -1.36%     
==========================================
  Files          22       22              
  Lines         967     1021      +54     
  Branches      160      183      +23     
==========================================
+ Hits          929      967      +38     
- Misses         38       54      +16     
Flag Coverage Δ
chrome 90.25% <88.31%> (-9.75%) ⬇️
node 94.59% <89.36%> (-1.47%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@achingbrain
Copy link
Collaborator Author

Refs: libp2p/js-libp2p#2229

@achingbrain achingbrain merged commit 440af16 into master Dec 10, 2023
16 of 18 checks passed
@achingbrain achingbrain deleted the feat/add-react-native-support branch December 10, 2023 12:14
github-actions bot pushed a commit that referenced this pull request Dec 10, 2023
## [6.1.0](v6.0.5...v6.1.0) (2023-12-10)

### Features

* support react-native ([#97](#97)) ([440af16](440af16))

### Trivial Changes

* add or force update .github/workflows/js-test-and-release.yml ([#77](#77)) ([96f4c7b](96f4c7b))
* delete templates [skip ci] ([#76](#76)) ([e8b6c1f](e8b6c1f))
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.

1 participant