@module-federation/webpack-bundler-runtime
Advanced tools
Comparing version 0.0.0-next-20240104103738 to 0.0.0-next-20240105113752
@@ -257,3 +257,34 @@ 'use strict'; | ||
function isLegacyHost(shareScope) { | ||
function _define_property(obj, key, value) { | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
function _object_spread(target) { | ||
for(var i = 1; i < arguments.length; i++){ | ||
var source = arguments[i] != null ? arguments[i] : {}; | ||
var ownKeys = Object.keys(source); | ||
if (typeof Object.getOwnPropertySymbols === "function") { | ||
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { | ||
return Object.getOwnPropertyDescriptor(source, sym).enumerable; | ||
})); | ||
} | ||
ownKeys.forEach(function(key) { | ||
_define_property(target, key, source[key]); | ||
}); | ||
} | ||
return target; | ||
} | ||
function isLegacyHost(shareScope, remoteEntryInitOptions) { | ||
if (remoteEntryInitOptions && typeof remoteEntryInitOptions === "object" && remoteEntryInitOptions.hostId) { | ||
return false; | ||
} | ||
if ("version" in shareScope && typeof shareScope["version"] !== "object") { | ||
@@ -268,11 +299,11 @@ return true; | ||
function initContainerEntry(options) { | ||
var webpackRequire = options.webpackRequire, shareScope = options.shareScope, initScope = options.initScope, shareScopeKey = options.shareScopeKey; | ||
var webpackRequire = options.webpackRequire, shareScope = options.shareScope, initScope = options.initScope, shareScopeKey = options.shareScopeKey, remoteEntryInitOptions = options.remoteEntryInitOptions; | ||
if (!webpackRequire.S) return; | ||
if (!webpackRequire.federation || !webpackRequire.federation.instance || !webpackRequire.federation.initOptions) return; | ||
var name = shareScopeKey || "default"; | ||
webpackRequire.federation.instance.initOptions({ | ||
webpackRequire.federation.instance.initOptions(_object_spread({ | ||
name: webpackRequire.federation.initOptions.name, | ||
remotes: [] | ||
}); | ||
if (isLegacyHost(shareScope)) { | ||
}, remoteEntryInitOptions)); | ||
if (isLegacyHost(shareScope, remoteEntryInitOptions)) { | ||
var prevShareScope = globalThis.__FEDERATION__.__SHARE__["default"]; | ||
@@ -279,0 +310,0 @@ if (prevShareScope) { |
@@ -235,3 +235,34 @@ import * as runtime from '@module-federation/runtime'; | ||
function isLegacyHost(shareScope) { | ||
function _define_property(obj, key, value) { | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
function _object_spread(target) { | ||
for(var i = 1; i < arguments.length; i++){ | ||
var source = arguments[i] != null ? arguments[i] : {}; | ||
var ownKeys = Object.keys(source); | ||
if (typeof Object.getOwnPropertySymbols === "function") { | ||
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { | ||
return Object.getOwnPropertyDescriptor(source, sym).enumerable; | ||
})); | ||
} | ||
ownKeys.forEach(function(key) { | ||
_define_property(target, key, source[key]); | ||
}); | ||
} | ||
return target; | ||
} | ||
function isLegacyHost(shareScope, remoteEntryInitOptions) { | ||
if (remoteEntryInitOptions && typeof remoteEntryInitOptions === "object" && remoteEntryInitOptions.hostId) { | ||
return false; | ||
} | ||
if ("version" in shareScope && typeof shareScope["version"] !== "object") { | ||
@@ -246,11 +277,11 @@ return true; | ||
function initContainerEntry(options) { | ||
var webpackRequire = options.webpackRequire, shareScope = options.shareScope, initScope = options.initScope, shareScopeKey = options.shareScopeKey; | ||
var webpackRequire = options.webpackRequire, shareScope = options.shareScope, initScope = options.initScope, shareScopeKey = options.shareScopeKey, remoteEntryInitOptions = options.remoteEntryInitOptions; | ||
if (!webpackRequire.S) return; | ||
if (!webpackRequire.federation || !webpackRequire.federation.instance || !webpackRequire.federation.initOptions) return; | ||
var name = shareScopeKey || "default"; | ||
webpackRequire.federation.instance.initOptions({ | ||
webpackRequire.federation.instance.initOptions(_object_spread({ | ||
name: webpackRequire.federation.initOptions.name, | ||
remotes: [] | ||
}); | ||
if (isLegacyHost(shareScope)) { | ||
}, remoteEntryInitOptions)); | ||
if (isLegacyHost(shareScope, remoteEntryInitOptions)) { | ||
var prevShareScope = globalThis.__FEDERATION__.__SHARE__["default"]; | ||
@@ -257,0 +288,0 @@ if (prevShareScope) { |
import * as runtime from '@module-federation/runtime'; | ||
import type { RemoteEntryInitOptions } from '@module-federation/runtime/types'; | ||
import { initializeSharing } from './initializeSharing'; | ||
@@ -89,2 +90,3 @@ import { attachShareScopeMap } from './attachShareScopeMap'; | ||
webpackRequire: WebpackRequire; | ||
remoteEntryInitOptions?: RemoteEntryInitOptions; | ||
initScope?: InitializeSharingOptions['initScope']; | ||
@@ -91,0 +93,0 @@ } |
{ | ||
"public": true, | ||
"name": "@module-federation/webpack-bundler-runtime", | ||
"version": "0.0.0-next-20240104103738", | ||
"version": "0.0.0-next-20240105113752", | ||
"license": "MIT", | ||
@@ -23,4 +23,4 @@ "description": "Module Federation Runtime for webpack", | ||
"dependencies": { | ||
"@module-federation/runtime": "0.0.0-next-20240104103738", | ||
"@module-federation/sdk": "0.0.0-next-20240104103738" | ||
"@module-federation/runtime": "0.0.0-next-20240105113752", | ||
"@module-federation/sdk": "0.0.0-next-20240105113752" | ||
}, | ||
@@ -27,0 +27,0 @@ "exports": { |
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
38436
782
+ Added@module-federation/runtime@0.0.0-next-20240105113752(transitive)
+ Added@module-federation/sdk@0.0.0-next-20240105113752(transitive)
- Removed@module-federation/runtime@0.0.0-next-20240104103738(transitive)
- Removed@module-federation/sdk@0.0.0-next-20240104103738(transitive)