@module-federation/webpack-bundler-runtime
Advanced tools
Comparing version 0.0.0-canary-1702191364859 to 0.0.0-canary-1702278361811
@@ -25,11 +25,8 @@ 'use strict'; | ||
function proxyShareScopeMap(webpackRequire) { | ||
if (!webpackRequire.S || webpackRequire.federation.hasProxyShareScopeMap || !webpackRequire.federation.initOptions) { | ||
function attachShareScopeMap(webpackRequire) { | ||
if (!webpackRequire.S || webpackRequire.federation.hasAttachShareScopeMap || !webpackRequire.federation.instance || !webpackRequire.federation.instance.shareScopeMap) { | ||
return; | ||
} | ||
if (!webpackRequire.g["__FEDERATION__"].__SHARE__[webpackRequire.federation.initOptions.name]) { | ||
return; | ||
} | ||
webpackRequire.S = webpackRequire.g["__FEDERATION__"].__SHARE__[webpackRequire.federation.initOptions.name]; | ||
webpackRequire.federation.hasProxyShareScopeMap = true; | ||
webpackRequire.S = webpackRequire.federation.instance.shareScopeMap; | ||
webpackRequire.federation.hasAttachShareScopeMap = true; | ||
} | ||
@@ -85,3 +82,3 @@ | ||
var chunkId = options.chunkId, promises = options.promises, chunkMapping = options.chunkMapping, idToExternalAndNameMapping = options.idToExternalAndNameMapping, webpackRequire = options.webpackRequire, idToRemoteMap = options.idToRemoteMap; | ||
proxyShareScopeMap(webpackRequire); | ||
attachShareScopeMap(webpackRequire); | ||
if (webpackRequire.o(chunkMapping, chunkId)) { | ||
@@ -188,3 +185,3 @@ chunkMapping[chunkId].forEach(function(id) { | ||
var chunkId = options.chunkId, promises = options.promises, chunkMapping = options.chunkMapping, installedModules = options.installedModules, moduleToHandlerMapping = options.moduleToHandlerMapping, webpackRequire = options.webpackRequire; | ||
proxyShareScopeMap(webpackRequire); | ||
attachShareScopeMap(webpackRequire); | ||
if (webpackRequire.o(chunkMapping, chunkId)) { | ||
@@ -271,3 +268,3 @@ chunkMapping[chunkId].forEach(function(id) { | ||
var promises = webpackRequire.federation.instance.initializeSharing(shareScopeName); | ||
proxyShareScopeMap(webpackRequire); | ||
attachShareScopeMap(webpackRequire); | ||
var bundlerRuntimeRemotesOptions = webpackRequire.federation.bundlerRuntimeOptions.remotes; | ||
@@ -339,3 +336,3 @@ if (bundlerRuntimeRemotesOptions) { | ||
}, | ||
proxyShareScopeMap: proxyShareScopeMap, | ||
attachShareScopeMap: attachShareScopeMap, | ||
bundlerRuntimeOptions: {} | ||
@@ -342,0 +339,0 @@ }; |
import * as runtime from '@module-federation/runtime'; | ||
function proxyShareScopeMap(webpackRequire) { | ||
if (!webpackRequire.S || webpackRequire.federation.hasProxyShareScopeMap || !webpackRequire.federation.initOptions) { | ||
function attachShareScopeMap(webpackRequire) { | ||
if (!webpackRequire.S || webpackRequire.federation.hasAttachShareScopeMap || !webpackRequire.federation.instance || !webpackRequire.federation.instance.shareScopeMap) { | ||
return; | ||
} | ||
if (!webpackRequire.g["__FEDERATION__"].__SHARE__[webpackRequire.federation.initOptions.name]) { | ||
return; | ||
} | ||
webpackRequire.S = webpackRequire.g["__FEDERATION__"].__SHARE__[webpackRequire.federation.initOptions.name]; | ||
webpackRequire.federation.hasProxyShareScopeMap = true; | ||
webpackRequire.S = webpackRequire.federation.instance.shareScopeMap; | ||
webpackRequire.federation.hasAttachShareScopeMap = true; | ||
} | ||
@@ -62,3 +59,3 @@ | ||
var chunkId = options.chunkId, promises = options.promises, chunkMapping = options.chunkMapping, idToExternalAndNameMapping = options.idToExternalAndNameMapping, webpackRequire = options.webpackRequire, idToRemoteMap = options.idToRemoteMap; | ||
proxyShareScopeMap(webpackRequire); | ||
attachShareScopeMap(webpackRequire); | ||
if (webpackRequire.o(chunkMapping, chunkId)) { | ||
@@ -165,3 +162,3 @@ chunkMapping[chunkId].forEach(function(id) { | ||
var chunkId = options.chunkId, promises = options.promises, chunkMapping = options.chunkMapping, installedModules = options.installedModules, moduleToHandlerMapping = options.moduleToHandlerMapping, webpackRequire = options.webpackRequire; | ||
proxyShareScopeMap(webpackRequire); | ||
attachShareScopeMap(webpackRequire); | ||
if (webpackRequire.o(chunkMapping, chunkId)) { | ||
@@ -248,3 +245,3 @@ chunkMapping[chunkId].forEach(function(id) { | ||
var promises = webpackRequire.federation.instance.initializeSharing(shareScopeName); | ||
proxyShareScopeMap(webpackRequire); | ||
attachShareScopeMap(webpackRequire); | ||
var bundlerRuntimeRemotesOptions = webpackRequire.federation.bundlerRuntimeOptions.remotes; | ||
@@ -316,3 +313,3 @@ if (bundlerRuntimeRemotesOptions) { | ||
}, | ||
proxyShareScopeMap: proxyShareScopeMap, | ||
attachShareScopeMap: attachShareScopeMap, | ||
bundlerRuntimeOptions: {} | ||
@@ -319,0 +316,0 @@ }; |
{ | ||
"public": true, | ||
"name": "@module-federation/webpack-bundler-runtime", | ||
"version": "0.0.0-canary-1702191364859", | ||
"version": "0.0.0-canary-1702278361811", | ||
"license": "MIT", | ||
@@ -19,5 +19,5 @@ "description": "Module Federation Runtime for webpack", | ||
"dependencies": { | ||
"@module-federation/runtime": "0.0.0-canary-1702191364859" | ||
"@module-federation/runtime": "0.0.0-canary-1702278361811" | ||
}, | ||
"peerDependencies": {} | ||
} |
import * as runtime from '@module-federation/runtime'; | ||
import { initializeSharing } from './initializeSharing'; | ||
import { proxyShareScopeMap } from './proxyShareScopeMap'; | ||
import { attachShareScopeMap } from './attachShareScopeMap'; | ||
type ExcludeUndefined<T> = T extends undefined ? never : T; | ||
@@ -92,5 +92,5 @@ type NonUndefined<T = Shared> = ExcludeUndefined<T>; | ||
}; | ||
proxyShareScopeMap?: typeof proxyShareScopeMap; | ||
hasProxyShareScopeMap?: boolean; | ||
attachShareScopeMap?: typeof attachShareScopeMap; | ||
hasAttachShareScopeMap?: boolean; | ||
} | ||
export {}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34267
751
+ Added@module-federation/runtime@0.0.0-canary-1702278361811(transitive)
+ Added@module-federation/sdk@0.0.0-canary-1702278361811(transitive)
- Removed@module-federation/runtime@0.0.0-canary-1702191364859(transitive)
- Removed@module-federation/sdk@0.0.0-canary-1702191364859(transitive)
Updated@module-federation/runtime@0.0.0-canary-1702278361811