Skip to content

Support fast refresh in workers #152

@itsdouges

Description

@itsdouges

Description

Currently this plugin assigns variables to window - which is unavailable inside workers. If instead we targeted globalThis as an alternative [...The globalThis property provides a standard way of accessing the global this value (and hence the global object itself) across environments.] that would be a way forward where the same code can function in both a DOM and worker environment.

Suggested solution

Replace all window usage with globalThis.

Alternative

No response

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions