-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
expose Request, Response globally #2108
Comments
Is there a use case for exposing them globally? |
However both
|
True, it is global in the browser. We ought to make it global in deno too. |
Is there a way to generate a list of globals in chrome/Firefox/deno? That way could enumerate what is intentionally omitted vs what is awaiting implementation. This would also be nice as documentation... |
That would be a long long list. I think use case driven is still the best way. We are not going to implement |
I think there is merit in collaborating with the JS standard library spec proposal to see if Deno can have a say on what's exposed. There are things the browser exposes it makes no sense for Deno to expose and vice versa. |
I didn't mean to suggest that Deno should have feature parity with browsers - that would be very difficult and beyond the scope of Deno. But where we provide a certain API (in this case |
@ry true, though that might be confusing since the type
The two are not necessarily a different type. (This was intentional in the design of fetch and service workers). If projects like deno_std/http used |
It would be a long list but I imagine the vast majority will be labelled "intentionally omitted"! |
Looking at the code it looks like |
UPDATE: Not sure if am correct with this assessment. My opinion was based on an old thread. |
For a list of JS global objects (i.e. those from the language spec, not the DOM) see: (but some of them are not exposed as real globals - see my unexposed module on npm for more info) The host objects available in browser contexts are available on MDN here: (not everything on one place but a good start) It makes sense to make everything global that is global in browsers, and nothing else (to avoid conflicts in the future) |
Fixed in #2253 |
My advice, don't comment it out. 😄 |
If fetch is available as a global should we not also expose Request, Response and friends like the browser environment does?
The text was updated successfully, but these errors were encountered: