nodejs / node

Node.js JavaScript runtime ✨🐢🚀✨
https://nodejs.org
Other
107.6k stars 29.59k forks source link

implement URLPattern #40844

Open jimmywarting opened 2 years ago

jimmywarting commented 2 years ago

Don't know if you have heard of this new URLPattern Deno shipped it, and browser supports it, would be a cool util to have globally avalible to pear up with web standards and for usage in express routing for instance

DerekNonGeneric commented 2 years ago

Thanks for the heads up — obviously our feature request template is not very well-suited for these kinds of issues, but given that the specification for URLPattern is still in draft, I imagine that we would be setting the Webcompat Priority value of this to either ? or revisit if we were to use a triage system similar to what Mozilla uses for their WebCompat Tracking and Triage workflow.

Mainly being a volunteer-run organization, we have no real priorities (whatever gets done, gets done); that being said, this issue cannot be represented by one of the N values in that system…

I would say to perhaps set it as revisit and come back later once spec becomes a recommendation.

targos commented 2 years ago

Spec is at https://github.com/WICG/urlpattern WPT: https://github.com/web-platform-tests/wpt/tree/master/urlpattern

targos commented 2 years ago

@nodejs/url what do you think?

Jamesernator commented 2 years ago

Deno shipped it, and browser supports it, would be a cool util to have globally avalible to pear up with web standards and for usage in express routing for instance

So I opened the original issue for support in Deno, I opened it on Deno as Deno tends to support considerably more cutting edge things.

Having said this, having it Node would be particularly valuable for libraries that are currently using path-to-regexp for patterns. The syntax is essentially the same (aside from a few bug fixes to work with URLs more generally), so libraries that are currently using path-to-regexp could use the builtin URLPattern instead, allowing them to remove a external dependency.

And having a common pattern syntax for things like routing would just generally be nice to have, so that libraries don't have a bunch of different microsyntaxes for essentially the same thing.

jasnell commented 2 years ago

@targos ... I'm +1 on an having an implementation in core. I have some concerns about the performance as spec'd but having an implementation makes sense.

github-actions[bot] commented 2 years ago

There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment.

For more information on how the project manages feature requests, please consult the feature request management document.

github-actions[bot] commented 2 years ago

There has been no activity on this feature request and it is being closed. If you feel closing this issue is not the right thing to do, please leave a comment.

For more information on how the project manages feature requests, please consult the feature request management document.

dionsaur84 commented 1 year ago

+1

anonrig commented 1 year ago

Let's open this issue. I'm +1 on having this on core.

AugustinMauroy commented 1 year ago

+1 It's can be good to create an simple routing system with nodejs built-in module.

jdhrivas commented 1 year ago

+1

lucianmot commented 1 year ago

+1

mharis commented 1 year ago

+1

bj-nostra commented 1 year ago

+1

jimmywarting commented 1 year ago

Stop posting +1

Hello everyone,

I've noticed that several people are posting "+1" on this issue thread. While I understand that this is meant to indicate support for the issue, it's actually causing a lot of unnecessary notifications for everyone who is subscribed to this thread. Additionally, posting "+1" does not add any meaningful contribution to the conversation and only make scrolling through the page more annoying in order to find the most meaningful comments.

Instead of posting a comment with "+1", I suggest that you simply use the "subscribe" button at the top of the issue thread to receive updates. Additionally, if you want to show support, you can use the "thumbs up" reaction on the original post. This will help keep the thread clean and reduce notifications for everyone.

I appreciate your interest in this issue, but please keep in mind that posting "+1" repeatedly can become frustrating and annoying to those who are subscribed. By using the subscribe button and reactions, we can keep the conversation focused and productive.

I don't want to have to unsubscribe to this topic if more ppl are going to post +1

Thank you for your understanding and cooperation.

anonrig commented 1 year ago

I've locked and limited the issue to collaborators.

anonrig commented 1 year ago

Update: @miguelteixeiraa started working on adding URLPattern to Ada - https://github.com/ada-url/ada/pull/381