Closed loynoir closed 3 years ago
Safari support was fixed in https://github.com/sindresorhus/normalize-url/releases/tag/v7.0.1. I'm not interested in browser tests, browser-specific options, or the .sort
polyfill. You also have way too many unrelated changes in a single pull request.
Hi, @sindresorhus
I'm not interested in browser tests
But how can you guarantee this library works in browser, without testing it in browser?
Eg: issue#147
browser-specific options
I know that you may not like that option, so I did try to remove it. But test-runtime is modern, need to way to run all logic. So I restore them.
You also have way too many unrelated changes in a single pull request
I'm kind of non professional newbie.
Should I combine all commits as one, and break them into small features.
Then one feature -> contribute -> one feature -> contribute
?
FYI, there are something I found so far.
options validate should ASAP https://github.com/sindresorhus/normalize-url/blob/24560330a31eda9253172c02339ec610f5917d4b/index.js#L105
In modern and old browser, custom protocol error like issue#147 Fixed in my latest fork
In old browser, name capture group may break ok code like issues#105 https://github.com/sindresorhus/normalize-url/blob/24560330a31eda9253172c02339ec610f5917d4b/index.js#L8
In old browser, there is no URLSearchParams.prototype.sort
Have a nice day @sindresorhus 😊
But how can you guarantee this library works in browser, without testing it in browser?
I never made it for the browser. But it doesn't use anything specific to Node.js, so if it works in Node.js, it should work in modern browsers too.
In modern and old browser, custom protocol error like issue#147
options validate should ASAP
Not sure what you mean?
Old browser support is not a concern for this package. It's up to you to use Babel and polyfill if you need to use it in older browsers. I only merged the Safari fix as it applies to latest Safari.
In modern and old browser, custom protocol error like issue#147
132
Not sure for that pull, but existing today-test.js
failed for both modern and old browser issue#147
options validate should ASAP
Not sure what you mean?
function normalizeUrl(urlString, options) {
// ...code
if (options.forceHttp && options.forceHttps) {
throw new Error('The `forceHttp` and `forceHttps` options cannot be used together');
}
// ...code
}
function normalizeUrl(urlString, options) {
if (options.forceHttp && options.forceHttps) {
throw new Error('The `forceHttp` and `forceHttps` options cannot be used together');
}
// ...code
// ...code
}
But how can you guarantee this library works in browser, without testing it in browser?
I never made it for the browser. But it doesn't use anything specific to Node.js, so if it works in Node.js, it should work in modern browsers too.
But your "this child" seems to be also used in browser from recent issues?
Maybe consider using convert ava
to mocha+chai+karma
?
As it also provide automate browser test ability for headless browser drivers?
I'm not interested in browser testing.
But it doesn't use anything specific to Node.js, so if it works in Node.js, it should work in modern browsers too.
URL
implement is different. When custom protocol, node behavior is whatwg-url
,
but browser is not, A://B/C
host in browser is empty.
I'm not interested in browser testing.
But I saw issues related to browser, may it give a try, decrease future potential issues? As it can be automated?
Users
There are two ways if you want to test version >= 7.0.0 in real browser,
Changes
/JsRegexpLookbehind/
tonew RegExp(JsRegexpLookbehind)
, prevent syntax error breaks user code.reverse-lookahead-reverse
as fallback when not supportJsRegexpLookbehind
.preferJsRegexpLookbehind
andpreferURLSearchParamsSort
to run fallback logic in modern runtime..d.ts
.normalizeUrl(options)
options validation to most top.urlObject.toString
, to prevent pathname changed again.regexp named-capturing-groups
and bundle tests for browser.ava
tomocha+chai
, enable to test it in Node.js / Headless Chrome / Headless Firefox / Any real browsr.invalid urls
to match more than Node.js env.Test Status
(32/32) Test passed with