Skip to content

Provide SourceTextModule sync versions of link and evaluate methods #59656

@SkReD

Description

@SkReD

What is the problem this feature will solve?

Allow to reimplement require(esm) logic with custom require. Current logic in jest covers only require(cjs) and native modules and to support require(esm) there is need of SourceTextModule sync version with sync link and evaluate methods.

jestjs/jest#15275

What is the feature you are proposing to solve the problem?

linkSync and evaluateSync methods for SourceTextModule or another sync way to programmaticaly create and initialize module.

What alternatives have you considered?

Customization hooks but looks like, according to #56241, there is fundamental problem with implementing evaluation hook for esm modules.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues that request new features to be added to Node.js.vmIssues and PRs related to the vm subsystem.

    Type

    No type

    Projects

    Status

    Awaiting Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions