-
Notifications
You must be signed in to change notification settings - Fork 6k
remove window variable #13367
Copy link
Copy link
Closed
Labels
suggestionsuggestions for new features (yet to be agreed)suggestions for new features (yet to be agreed)
Description
The background for this is that many existing web frameworks incorrectly use window as a feature detect for web browsers. This breaks them when server side rendering in Deno, as they think they are running in a browser.
The web frameworks should be feature detecting document if they want to know if they have access to the DOM, not window.
Nonetheless this practice is so prevalent in the ecosystem, that it would be difficult to change all of these wrong feature detects. This Sourcegraph query illustrates how widespread this is: https://sourcegraph.com/search?q=context:global+typeof+window&patternType=literal.
Because of this, we should consider removing the window global from Deno at the earliest possible date (likely Deno 2.0).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
suggestionsuggestions for new features (yet to be agreed)suggestions for new features (yet to be agreed)