Skip to content
This repository was archived by the owner on Feb 6, 2023. It is now read-only.
This repository was archived by the owner on Feb 6, 2023. It is now read-only.

Remove use of setImmediate from fbjs #2127

@thomassuckow

Description

@thomassuckow

Draft-js uses non-complaint setImmediate polyfill from fbjs. fbjs has had open tickets to fix this issue for years, it's time to assume it will never be fixed and stop using it.

fbjs assumes there is a global called global and attempts to polyfill setimmediate on it. Then fbjs tries to expose this polyfilled function incorrectly. In spec conformant environments there is no global called global and a runtime error occurs from trying to access a nonexistent variable.

Note the tc39 proposal where they got global from changed to globalThis nearly a year ago.

Why not just setTimeout(fn, 0)? It is only being used as a hack anyway for other event handlers to fire first.

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