Skip to content

Keep dynamic requires synchronous in module #9

@jsinterface

Description

@jsinterface

meta/sanitize currently converts dynamic requires to awaited dynamic imports,
along with making their corresponding enclosing functions async.
This was a tradeoff to support conditional dependency (if(true)require()) instead of all being hoisted as a static import to keep them synchronous.

Synchronous internal or peer dependant calls to the resulting asynchronized functions can be edited to be async as well, but this can get complex beyond simple library initializations, in eg. opaque object hierarchies.

Such peers, relying extensively on commonjs's synchronous loading of what are supposed to be modules, may deserve to be deprecated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions