Open mischnic opened 2 years ago
This seems great. Can you confirm that this implementation/tests match every version of node that has this function?
Merging #59 (5a3f3e4) into master (b449442) will increase coverage by
0.16%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## master #59 +/- ##
==========================================
+ Coverage 97.00% 97.16% +0.16%
==========================================
Files 1 1
Lines 367 388 +21
Branches 133 140 +7
==========================================
+ Hits 356 377 +21
Misses 11 11
Impacted Files | Coverage Δ | |
---|---|---|
url.js | 97.16% <100.00%> (+0.16%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update b449442...5a3f3e4. Read the comment docs.
Can you confirm that this implementation/tests match every version of node that has this function?
The function was added in Node 10.12.0. All of the fileURLToPath
-related tests I added pass with Node 10.24.1, 12.22.7, 14.18.2, 16.13.1, 17.2.0. (By changing the test script to var url = require('url');
and running it with that version)
Is there any chance that this will be merged?
@JumpLink yes, or else it'd be closed.
I've been using a package which uses fileURLToPath
internally for a bunch of things inside webpack 5 and using this package to polyfill url
. I have been receving build errors for this.
Any chance we can merge this implementation?
yeah I have same experience as @starwiz-7, would be great to have this merged
I don't want to add to the pile of +1's, but we are in a similar situation. I'm willing to help out, is there anything we can do to help get this merged and released?
If you’re looking for solution where you can alias url
to userland implementation (e.g. bundler alias option), node-stdlib-browser (note: I’m the author of the module) adds additional exports to the ones provided by node-url
.
@niksy this package is that solution; if yours has functionality this one is missing, it’d be great to PR that in.
Absolutely! I’ve done the changes from my side since at the time it was easier to just patch it, but I would definitely like it if it’s done upstream.
From what I can see in this PR, everything is implemented, but from the comments I see that major blocker is URL
implementation that works all the way down to Node 0.4 and it isn’t big of a dependancy?
Yep, that’s right.
This adds
fileURLToPath
.In Node, this uses the current platform's file path format (windows vs posix). Since https://github.com/browserify/path-browserify also only implements posix, I think it makes sense to do the same here.
I've copied the implementations and the majority of the test cases from Node itself. I think this makes sense to ensure compatibility, but I'm not sure if this poses problems regarding the license