Skip to content

remove window variable #13367

@ry

Description

@ry

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    suggestionsuggestions for new features (yet to be agreed)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions