GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — src: implement whatwg's URLPattern spec by anonrig · Pull Request #56452 · nodejs/node Conversation
|
|
Review requested:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Can you elaborate? libuv is a C library so I don't think exceptions exist there, and I'm pretty sure V8 is built with exceptions disabled. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
My bad UV does not enable exceptions. Referencing v8.gyp file: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This is not really V8. It's a build-time executable (torque) used to generate code for V8 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think the key challenge here is that this will copy the string on every call. Any chance of memoizing the string once created.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I'll follow up on a different PR for this
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Can you also include a fairly simple benchmark? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@ ## main #56452 +/- ## ========================================== - Coverage 89.21% 89.18% -0.03% ========================================== Files 663 665 +2 Lines 192001 192574 +573 Branches 36921 37046 +125 ========================================== + Hits 171286 171749 +463 - Misses 13582 13635 +53 - Partials 7133 7190 +57
🚀 New features to boost your workflow:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I don’t think this is a good pattern to land in Node.js. Specifically, a server using this will create one per route and iterate in a loop. This will be slow, specifically if you need to match the last of the list.
(This feedback was provided when URLPattern was standardized and essentially ignored).
For this to be useful, we would need to have a Node.js-specific API to organize these URLPattern in a radix prefix trie and actually do the matching all at once.
I can possibly be persuaded that we need this for Web platform compatibility, but it’s not that popular either (unlike fetch()).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@jasnell I’ll try to build this and get a benchmark going against the ecosystem routers. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Right now, this pull-request does not pass WPT, and not at all optimized. Any benchmarks will not be beneficial. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Co-authored-by: Daniel Lemire <[email protected]>
Co-authored-by: Daniel Lemire <[email protected]>
|
@nodejs/cpp-reviewers @nodejs/TSC appreciate it if you could review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| The constructor can throw a `TypeError` to indicate parsing failure. | ||
|
|
||
| #### `new URLPattern(objg[, baseURL][, options])` |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| #### `new URLPattern(objg[, baseURL][, options])` | |
| #### `new URLPattern(obj[, baseURL][, options])` |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
You have the eyes of an eagle.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I can't review the C++ but the parts I can look fine
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| Input can be a string or an object providing the individual URL parts. The | ||
| object members can be any of `protocol`, `username`, `password`, `hostname`, | ||
| `port`, `pathname`, `search`, `hash` or `baseURL`. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| `port`, `pathname`, `search`, `hash` or `baseURL`. | |
| `port`, `pathname`, `search`, `hash`, or `baseURL`. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| Input can be a string or an object providing the individual URL parts. The | ||
| object members can be any of `protocol`, `username`, `password`, `hostname`, | ||
| `port`, `pathname`, `search`, `hash` or `baseURL`. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| `port`, `pathname`, `search`, `hash` or `baseURL`. | |
| `port`, `pathname`, `search`, `hash`, or `baseURL`. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| constructor(input: Record<string, string> | string, options?: { ignoreCase: boolean }); | ||
| constructor(input: Record<string, string> | string, baseUrl?: string, options?: { ignoreCase: boolean }); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| constructor(input: Record<string, string> | string, options?: { ignoreCase: boolean }); | |
| constructor(input: Record<string, string> | string, baseUrl?: string, options?: { ignoreCase: boolean }); | |
| constructor(input: Record<string, string> | string, options?: { ignoreCase?: boolean }); | |
| constructor(input: Record<string, string> | string, baseUrl?: string, options?: { ignoreCase?: boolean }); |
since an empty options object is still permitted
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@nodejs/tsc @nodejs/platform-smartos ... I can not justify the reasoning for waiting for smartOS build to succeed for more than 5.5 hours (https://ci.nodejs.org/job/node-test-commit-smartos/58956/nodes=smartos22-x64/) but here we are... The latest discussion didn't involve cases like this, we only had a discussion about flaky tests. Please ask yourselves, if you were a new contributor, would you still continue contributing to Node.js after waiting for 5 hours for CI to succeed? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@anonrig As you know, this is currently being discussed in nodejs/build#4011 (which you opened), and there are proposals there to correct the issue. I'd like to keep the main discussion in that issue so that the conversation is all in one place. Thanks! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
@bahamat That discussion doesn't solve the frustration of this PR right now. Any suggestions on how to land this pull-request now? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Landed in 44d2648...b78df6c |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Not really qualified to review C++.
The rest LGTM. Nice job buddy!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
implement URLPattern
There was an error while loading. Please reload this page.