Skip to content

[Angular] [Module Federation] Make remoteEntry filename configurable #13688

@Saafine

Description

@Saafine

Description

I would like to add an optional argument with remoteEntryName to 2 functions:
loadRemoteModule and loadRemoteContainer from packages/angular/mf/mf.ts

At the moment, the value is hard-coded here:

...
const containerUrl = `${remoteUrl}${
  remoteUrl.endsWith('/') ? '' : '/'
}remoteEntry.mjs`;
...

Motivation

Due to the nature of dynamic imports, this function will only try to fetch remoteEntry file once (regardless if it's success or error):
(tc39/proposal-dynamic-import#80)

function loadModule(url: string) {
  return import(/* webpackIgnore:true */ url);
}

If user encounters temporary connection issues, then they will have to refresh the entire page to load the module, as there is no way to implement retriability (for example by importing the same file again with different query parameters)

Suggested Implementation

async function loadRemoteContainer(remoteName: string, remoteEntryName = 'remoteEntry.mjs')

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions