-
Notifications
You must be signed in to change notification settings - Fork 30k
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
url: simplify and improve url formatting #46736
Conversation
2e032a0
to
4c6bdff
Compare
Is this for better performance? |
Not for this specifically, but I'm preparing for the new Ada changes where we will focus on enabling node.js-specific APIs to improve the performance. This is mainly for removing the URL parsing logic from Node.js core, and moving it to C++/Ada. |
4c6bdff
to
c8f6c5a
Compare
Landed in 8073392 |
PR-URL: #46736 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
@anonrig this broke the build when landing in v18.x. Do you mind creating a backport PR? |
PR-URL: nodejs#46736 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This depends on #46723 |
PR-URL: nodejs#46736 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs#46736 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs#46736 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This pull request separates the logic of
kFormat
andURL
and moves the logic to C++.Quick summary:
search
setter whenever searchParams is changed, instead of calculating href on the JS layer. This was done to remove any URL logic inside Node.js.kFormat
since it isn't used anymore after step 1 and 2.hasOpaquePath
andhasHost
from URL, since it was only needed forkFormat
andsearchParams
setter.ToStringView()
andToString()
methods that @addaleax recommended.cc @nodejs/url @nodejs/cpp-reviewers