Skip to content

jco exports uses invalid alias based on WIT world package name #292

Description

@DougAnderson444

Hi, it's me again

Given the following WIT that exports an interface named reactivity:

package wurbo:vowels;

interface reactivity {
  render: func(name: string) -> string;
  listen: func();
}

world example {
    import imports;
    export reactivity;
}

the resulting ES module code is invalid because the world package name is also used:

// ... 

await $init;
const reactivity = {
  listen: listen,
  render: render,
  
};

export { reactivity, reactivity as wurbo:vowels/reactivity };
//                                  ^^^^^^^^^^^^^^^^^^^______invalid javascript

The : is invalid JS syntax unfortunately

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions