-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
Description
What is the problem this feature will solve?
https://esm.sh supports auto targeting the build (ie. bundling code for specific runtime) by looking at the user agent.
The user agent they support (and probably some other websites) is like Node/{version}
. Deno too uses a similar user agent - Deno/{version}
.
Since I don't see any specific user agent used officially by nodejs (other than the library name it uses, ie. undici on v18+ and node-fetch for below than v16), I would like to see a unified user agent system, considering nobody created an issue on this, I believe this wouldn't break any existing system, instead it would help unifying the system against everyone's code.
What is the feature you are proposing to solve the problem?
Use Node/{version}
as the user agent by default. Promotes URL imports usage from https://esm.sh and having same name across codes and having similar agent to Deno.
What alternatives have you considered?
I work on my own URL imports implementation, so I'm free to use URL imports from nodejs v16, have Node/*
as my user agent and fix stuff/improve performance. Incase anyone is interested, check out @reejs/imports
on npm.