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

Figure out Synthetic Modules and loaders #526

Description

@bmeck

Right now we always generate modules via a static/serializable blob. With the removal of dynamicInstantiate we need to figure out what we want to do with v8::Module::CreateSyntheticModule. In theory this would be easier for workflows like testdouble if we do expose a way to set the exports of a module directly, however a lot of decisions about where the list of export names etc. are determined is unclear.

Activity

  1. added
    brainstormingSafe place to discuss ideas and provide constructive feedback
    on Jun 3, 2020
  2. giltayar commented on Jun 3, 2020

    @giltayar

    If I understand correctly, a synthetic module would need to not only define the set of named/default exports, but also give a set of operations to execute (in testdouble's scenario, those steps would set the variables the export values). And we can do that either via giving JS code, or by giving the JS source code.

    The second option is basically what is being done in testdouble today, except that today it's giving the whole module's code.

    The first option is impossible, because it's JS code in the loader worker, and so inaccessible from the main threads.

    In any case, at least for testdouble's purposes, it's not a painpoint, and not something that I feel was sorely needed.

    Just my 2 cents.

  3. bmeck commented on Jun 3, 2020

    @bmeck
    MemberAuthor

    That's good feedback, thanks :)

  4. GeoffreyBooth commented on Jun 4, 2020

    @GeoffreyBooth
    Member

    And we can do that either via giving JS code, or by giving the JS source code.

    I'm sorry, what's the difference between these two?

  5. giltayar commented on Jun 4, 2020

    @giltayar

    Js code: passing a function. Js source code: passing a string.

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

    brainstormingSafe place to discuss ideas and provide constructive feedbackdiscussion

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions