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

Migrate to native URL #208

Open
pi0 opened this issue Feb 5, 2024 · 2 comments
Open

Migrate to native URL #208

pi0 opened this issue Feb 5, 2024 · 2 comments
Assignees

Comments

@pi0
Copy link
Member

pi0 commented Feb 5, 2024

Historically ufo was started as a polyfill for URL when there were no enough browser coverage and also due to behavior variations. Now that URL is an standard de-facto, we can migrate to it for all (for parse/stringify) or at least for resolve/normalize Utils.

One of the biggest breaking change side-effects of this is that we will encode more characters even then they not not necessary and parsable. The initial behavior was taken from vue-router that preferred to keep URL readability and encode in must-have situations only. (one example: #164)

Second thing to consider is the performance part which probably worth a decent benchmark against URL implementation of major JS runtimes (Browsers, Node, Bun, Deno, Cloudflare workers) comparing to current regex based parseURL.

--

Update: I am thinking if we could ship it even faster with ufo/url or ufo/web to allow progressive opt-in and later in v2, have backward compact with ufo/compat. Only have to figure out a way to make bundling work to switch impl of encoding utils.

@pi0
Copy link
Member Author

pi0 commented Feb 8, 2024

I get it from the Mulesoft - https://help.mulesoft.com/s/article/java-lang-IllegalArgumentException-Malformed-URI-while-migrating-to-Mule-4
Mulesoft still supports RFC 1738 where "{", "}", "|", "", "^", "~", "[", "]", and "`" are unsafe characters.

Originally posted by @enkot in #165 (comment)

@johnpyp
Copy link

johnpyp commented May 25, 2024

+1 on ufo/url, that'd be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants