Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { pathToFileURL } from 'node:url';

import {
FederationInfo,
fetchAndRegisterRemotes,
processRemoteInfos,
ImportMap,
mergeImportMaps,
processHostInfo,
Expand Down Expand Up @@ -53,7 +53,7 @@ async function createNodeImportMap(

const hostInfo = await loadFsFederationInfo(relBundlePath);
const hostImportMap = await processHostInfo(hostInfo, './' + relBundlePath);
const remotesImportMap = await fetchAndRegisterRemotes(remotes, {
const remotesImportMap = await processRemoteInfos(remotes, {
throwIfRemoteNotFound: options.throwIfRemoteNotFound,
cacheTag: options.cacheTag,
});
Expand Down
1 change: 1 addition & 0 deletions libs/native-federation-runtime/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './lib/get-shared';
export * from './lib/init-federation';
export * from './lib/load-remote-module';
export * from './lib/model/build-notifications-options';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,10 +447,10 @@ describe('initFederation - Browser Integration Test', () => {
// or test processRemoteInfos directly.

// For now, this test documents the expected behavior if the option were exposed
const { fetchAndRegisterRemotes } = await import('./init-federation');
const { processRemoteInfos } = await import('./init-federation');

await expect(
fetchAndRegisterRemotes(
processRemoteInfos(
createRemoteConfig({
name: 'mfe1',
url: TEST_URLS.MFE1_REMOTE_ENTRY,
Expand Down
4 changes: 2 additions & 2 deletions libs/native-federation-runtime/src/lib/init-federation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export async function initFederation(
// Each remote contributes:
// - Exposed modules to root imports
// - Shared dependencies to scoped imports
const remotesImportMap = await fetchAndRegisterRemotes(normalizedRemotes, {
const remotesImportMap = await processRemoteInfos(normalizedRemotes, {
throwIfRemoteNotFound: false,
...options,
});
Expand Down Expand Up @@ -146,7 +146,7 @@ function handleRemoteLoadError(
*
*/

export async function fetchAndRegisterRemotes(
export async function processRemoteInfos(
remotes: Record<string, string>,
options: ProcessRemoteInfoOptions = { throwIfRemoteNotFound: false },
): Promise<ImportMap> {
Expand Down