This repository was archived by the owner on Jan 22, 2025. It is now read-only.
[web3.js] Eliminate dependency on URL class#27349
Merged
steveluscher merged 3 commits intosolana-labs:masterfrom Aug 24, 2022
steveluscher:why-url-why
Merged
[web3.js] Eliminate dependency on URL class#27349steveluscher merged 3 commits intosolana-labs:masterfrom steveluscher:why-url-why
URL class#27349steveluscher merged 3 commits intosolana-labs:masterfrom
steveluscher:why-url-why
Conversation
Codecov Report
@@ Coverage Diff @@
## master solana-labs/solana#27349 +/- ##
=========================================
- Coverage 76.9% 76.8% -0.2%
=========================================
Files 48 47 -1
Lines 2505 2507 +2
Branches 355 359 +4
=========================================
- Hits 1927 1926 -1
- Misses 448 452 +4
+ Partials 130 129 -1 |
Contributor
|
Sorry for the late review. Looks good, it's nice to kill that polyfill. |
This was referenced Oct 13, 2024
This was referenced Oct 20, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
URLclass is not available in all runtimes, namely React Native. For this, web3.js currently depends on a polyfill.Thing is, our use of
URLis very constrained:https:I'm all for relying on built-ins, but when the built-in doesn't exist on a target platform, it's worth taking a look at whether you can get away with a minimal implementation of it rather than a full polyfill.
Summary of Changes
URLclass in favor of purpose-built userspace implementations of URL parsing.URLpolyfill and regenerate lockfilesTest plan
new URLinsrc/; no more uses.Addresses solana-foundation/solana-web3.js#1103
Closes: #27001