Skip to content

Thoughts on globalThis vs window? #8

@bpevs

Description

@bpevs

Wondering if it makes sense to use globalThis for adapters (maybe like (window || globalThis).localStorage) kind of situation? My specific use case is that window global is not available in Deno 2, but afaik this is also applicable to a few other non-browser js contexts.

Not sure if usage of window here is primarily because of better legacy support, or if you are specifically trying to signal that usage should be in a browser context (since I guess the opening to more environments could also open adapters to more compat confusion).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions