Skip to content

System.register __moduleName support #6097

Closed
@guybedford

Description

@guybedford

I don't mean to be making work, but I think it's worth generically supporting this __moduleName identifier for System.register at this point and it is a relatively simple addition to the format of the form:

System.register([], function(_export, __moduleName) {
  // ...
});

This allows use cases like relative dynamic loading relative to the module being executed. The argument can even be omitted when it is not needed with binding detection as well.

Up until now I've been avoiding this hoping to make the second argument to System.register the ES loader module context which will provide similar functionality, but I don't think this contextual spec will be appearing for quite some time yet and the use case needs to be properly supported in the mean time.

For the original issue see systemjs/builder#416, and just let me know if there are any questions at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Effort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".FixedA PR has been merged for this issueHelp WantedYou can do thisSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions