oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
73.3k stars 2.69k forks source link

URLPattern #2286

Open vamsaya opened 1 year ago

vamsaya commented 1 year ago

What is the problem this feature would solve?

https://developer.mozilla.org/en-US/docs/Web/API/URLPattern

What is the feature you are proposing to solve the problem?

Although this is an experimental function, it is undoubtedly very practical for bun routing, and deno has already implemented it, so we can't live without it.

What alternatives have you considered?

No response

Jarred-Sumner commented 1 year ago

URLPattern is designed to be slow, so we aren't going to support this officially unless it becomes a web standard (WICG != W3C). You can use JS polyfills until then

PodaruDragos commented 5 months ago

is it not a web standard ? link

ghost commented 3 months ago

URLPattern is designed to be slow, so we aren't going to support this officially unless it becomes a web standard (WICG != W3C). You can use JS polyfills until then

Please reconsider this. Make it an optional import and allow us to opt into using it if we are willing to accept the performance hit.

michaldo commented 19 hours ago

I would like to make http server with bun. Here: https://bun.sh/guides/http/server only trivial path matching is demonstrated. I need match segments, for example /foo/{bar}/baz I don't want use regexp because they are too complex for simple segment matching. Bun does not implement URLPattern

Then what is bun proposal for that?

kravetsone commented 18 hours ago

What is the problem this feature would solve?

https://developer.mozilla.org/en-US/docs/Web/API/URLPattern

What is the feature you are proposing to solve the problem?

Although this is an experimental function, it is undoubtedly very practical for bun routing, and deno has already implemented it, so we can't live without it.

What alternatives have you considered?

No response

Routing with regexp is painful and should be abandoned

kravetsone commented 18 hours ago

What is the problem this feature would solve?

https://developer.mozilla.org/en-US/docs/Web/API/URLPattern

What is the feature you are proposing to solve the problem?

Although this is an experimental function, it is undoubtedly very practical for bun routing, and deno has already implemented it, so we can't live without it.

What alternatives have you considered?

No response

Routing with regexp is painful and should be abandoned

It is great feature for web but not so for server-side