@module-federation/sdk 0.0.0-next-20240812084439 → 0.0.0-next-20240813065037

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
@@ -513,13 +513,13 @@ function createLink(info) {
513
513
  link = document.createElement('link');
514
514
  link.setAttribute('href', info.url);
515
515
  let createLinkRes = undefined;
516
+ const attrs = info.attrs;
516
517
  if (info.createLinkHook) {
517
- createLinkRes = info.createLinkHook(info.url);
518
+ createLinkRes = info.createLinkHook(info.url, attrs);
518
519
  if (createLinkRes instanceof HTMLLinkElement) {
519
520
  link = createLinkRes;
520
521
  }
521
522
  }
522
- const attrs = info.attrs;
523
523
  if (attrs && !createLinkRes) {
524
524
  Object.keys(attrs).forEach((name)=>{
525
525
  if (link && !link.getAttribute(name)) {
package/dist/index.esm.js CHANGED
@@ -509,13 +509,13 @@ function createLink(info) {
509
509
  link = document.createElement('link');
510
510
  link.setAttribute('href', info.url);
511
511
  let createLinkRes = undefined;
512
+ const attrs = info.attrs;
512
513
  if (info.createLinkHook) {
513
- createLinkRes = info.createLinkHook(info.url);
514
+ createLinkRes = info.createLinkHook(info.url, attrs);
514
515
  if (createLinkRes instanceof HTMLLinkElement) {
515
516
  link = createLinkRes;
516
517
  }
517
518
  }
518
- const attrs = info.attrs;
519
519
  if (attrs && !createLinkRes) {
520
520
  Object.keys(attrs).forEach((name)=>{
521
521
  if (link && !link.getAttribute(name)) {
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/sdk",
3
- "version": "0.3.5",
3
+ "version": "0.4.0",
4
4
  "license": "MIT",
5
5
  "description": "A sdk for support module federation",
6
6
  "keywords": [
package/dist/src/dom.d.ts CHANGED
@@ -19,12 +19,12 @@ export declare function createLink(info: {
19
19
  cb: (value: void | PromiseLike<void>) => void;
20
20
  attrs: Record<string, string>;
21
21
  needDeleteLink?: boolean;
22
- createLinkHook?: (url: string) => HTMLLinkElement | void;
22
+ createLinkHook?: (url: string, attrs?: Record<string, any>) => HTMLLinkElement | void;
23
23
  }): {
24
24
  link: HTMLLinkElement;
25
25
  needAttach: boolean;
26
26
  };
27
27
  export declare function loadScript(url: string, info: {
28
28
  attrs?: Record<string, any>;
29
- createScriptHook?: (url: string, attrs?: Record<string, any> | undefined) => CreateScriptHookReturn;
29
+ createScriptHook?: (url: string, attrs?: Record<string, any>) => CreateScriptHookReturn;
30
30
  }): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/sdk",
3
- "version": "0.0.0-next-20240812084439",
3
+ "version": "0.0.0-next-20240813065037",
4
4
  "license": "MIT",
5
5
  "description": "A sdk for support module federation",
6
6
  "keywords": [