Skip to content

Commit

Permalink
fix(sdk): createLink hook error dom attr rel
Browse files Browse the repository at this point in the history
  • Loading branch information
KyrieLii committed Jan 27, 2025
1 parent f141396 commit 3f532ca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/fair-lies-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@module-federation/sdk': patch
---

fix(sdk): createLink hook error dom attr rel
6 changes: 3 additions & 3 deletions packages/sdk/src/dom.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CreateScriptHookDom, CreateScriptHookReturnDom } from './types';
import type { CreateScriptHookDom, CreateScriptHookReturnDom } from './types';
import { warn } from './utils';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export async function safeWrapper<T extends (...args: Array<any>) => any>(
Expand Down Expand Up @@ -155,11 +155,11 @@ export function createLink(info: {
for (let i = 0; i < links.length; i++) {
const l = links[i];
const linkHref = l.getAttribute('href');
const linkRef = l.getAttribute('ref');
const linkRel = l.getAttribute('rel');
if (
linkHref &&
isStaticResourcesEqual(linkHref, info.url) &&
linkRef === info.attrs['ref']
linkRel === info.attrs['rel']
) {
link = l;
needAttach = false;
Expand Down

0 comments on commit 3f532ca

Please sign in to comment.