@module-federation/runtime 0.3.3 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -597,9 +597,10 @@ useLinkPreload = true) {
597
597
  getRemoteEntry({
598
598
  remoteInfo: moduleInfo,
599
599
  remoteEntryExports: module.remoteEntryExports,
600
- createScriptHook: (url)=>{
600
+ createScriptHook: (url, attrs)=>{
601
601
  const res = host.loaderHook.lifecycle.createScript.emit({
602
- url
602
+ url,
603
+ attrs
603
604
  });
604
605
  if (!res) return;
605
606
  if (typeof document === 'undefined') {
@@ -619,9 +620,10 @@ useLinkPreload = true) {
619
620
  getRemoteEntry({
620
621
  remoteInfo: moduleInfo,
621
622
  remoteEntryExports: undefined,
622
- createScriptHook: (url)=>{
623
+ createScriptHook: (url, attrs)=>{
623
624
  const res = host.loaderHook.lifecycle.createScript.emit({
624
- url
625
+ url,
626
+ attrs
625
627
  });
626
628
  if (!res) return;
627
629
  if (typeof document === 'undefined') {
@@ -712,11 +714,13 @@ useLinkPreload = true) {
712
714
  url: jsUrl,
713
715
  cb: ()=>{},
714
716
  attrs: {
715
- fetchpriority: 'high'
717
+ fetchpriority: 'high',
718
+ type: (remoteInfo == null ? void 0 : remoteInfo.type) === 'module' ? 'module' : 'text/javascript'
716
719
  },
717
- createScriptHook: (url)=>{
720
+ createScriptHook: (url, attrs)=>{
718
721
  const res = host.loaderHook.lifecycle.createScript.emit({
719
- url
722
+ url,
723
+ attrs
720
724
  });
721
725
  if (res instanceof HTMLScriptElement) {
722
726
  return res;
@@ -2062,7 +2066,7 @@ class FederationHost {
2062
2066
  // maybe will change, temporarily for internal use only
2063
2067
  initContainer: new AsyncWaterfallHook('initContainer')
2064
2068
  });
2065
- this.version = "0.3.3";
2069
+ this.version = "0.3.4";
2066
2070
  this.moduleCache = new Map();
2067
2071
  this.loaderHook = new PluginSystem({
2068
2072
  // FIXME: may not be suitable , not open to the public yet
package/dist/index.esm.js CHANGED
@@ -595,9 +595,10 @@ useLinkPreload = true) {
595
595
  getRemoteEntry({
596
596
  remoteInfo: moduleInfo,
597
597
  remoteEntryExports: module.remoteEntryExports,
598
- createScriptHook: (url)=>{
598
+ createScriptHook: (url, attrs)=>{
599
599
  const res = host.loaderHook.lifecycle.createScript.emit({
600
- url
600
+ url,
601
+ attrs
601
602
  });
602
603
  if (!res) return;
603
604
  if (typeof document === 'undefined') {
@@ -617,9 +618,10 @@ useLinkPreload = true) {
617
618
  getRemoteEntry({
618
619
  remoteInfo: moduleInfo,
619
620
  remoteEntryExports: undefined,
620
- createScriptHook: (url)=>{
621
+ createScriptHook: (url, attrs)=>{
621
622
  const res = host.loaderHook.lifecycle.createScript.emit({
622
- url
623
+ url,
624
+ attrs
623
625
  });
624
626
  if (!res) return;
625
627
  if (typeof document === 'undefined') {
@@ -710,11 +712,13 @@ useLinkPreload = true) {
710
712
  url: jsUrl,
711
713
  cb: ()=>{},
712
714
  attrs: {
713
- fetchpriority: 'high'
715
+ fetchpriority: 'high',
716
+ type: (remoteInfo == null ? void 0 : remoteInfo.type) === 'module' ? 'module' : 'text/javascript'
714
717
  },
715
- createScriptHook: (url)=>{
718
+ createScriptHook: (url, attrs)=>{
716
719
  const res = host.loaderHook.lifecycle.createScript.emit({
717
- url
720
+ url,
721
+ attrs
718
722
  });
719
723
  if (res instanceof HTMLScriptElement) {
720
724
  return res;
@@ -2060,7 +2064,7 @@ class FederationHost {
2060
2064
  // maybe will change, temporarily for internal use only
2061
2065
  initContainer: new AsyncWaterfallHook('initContainer')
2062
2066
  });
2063
- this.version = "0.3.3";
2067
+ this.version = "0.3.4";
2064
2068
  this.moduleCache = new Map();
2065
2069
  this.loaderHook = new PluginSystem({
2066
2070
  // FIXME: may not be suitable , not open to the public yet
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/runtime",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "author": "zhouxiao <codingzx@gmail.com>",
5
5
  "main": "./index.cjs.js",
6
6
  "module": "./index.esm.js",
package/dist/share.cjs.js CHANGED
@@ -212,7 +212,7 @@ function getGlobalFederationConstructor() {
212
212
  function setGlobalFederationConstructor(FederationConstructor, isDebug = isDebugMode()) {
213
213
  if (isDebug) {
214
214
  globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor;
215
- globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.3.3";
215
+ globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.3.4";
216
216
  }
217
217
  }
218
218
  // eslint-disable-next-line @typescript-eslint/ban-types
package/dist/share.esm.js CHANGED
@@ -210,7 +210,7 @@ function getGlobalFederationConstructor() {
210
210
  function setGlobalFederationConstructor(FederationConstructor, isDebug = isDebugMode()) {
211
211
  if (isDebug) {
212
212
  globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor;
213
- globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.3.3";
213
+ globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.3.4";
214
214
  }
215
215
  }
216
216
  // eslint-disable-next-line @typescript-eslint/ban-types
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/runtime",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "author": "zhouxiao <codingzx@gmail.com>",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.esm.js",
@@ -45,6 +45,6 @@
45
45
  }
46
46
  },
47
47
  "dependencies": {
48
- "@module-federation/sdk": "0.3.3"
48
+ "@module-federation/sdk": "0.3.4"
49
49
  }
50
50
  }