Skip to content

Provide SourceTextModule sync versions of link and evaluate methods #59656

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues requesting new Node.js features.vmIssues and PRs related to the vm subsystem.

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions