Skip to content

fix(sdk): issue where duplicate links were created when existing #3707

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

ScriptedAlchemy
Copy link
Member

@ScriptedAlchemy ScriptedAlchemy commented Apr 16, 2025

Description

This pull request addresses an issue in the @module-federation/sdk package where duplicate links were created when existing links had no rel attribute. It includes changes to the createLink function and adds a corresponding test to ensure the fix works correctly. Additionally, the changegen script in package.json has been updated to include the sdk package.

Bug Fixes and Tests:

  • .changeset/ai-eager-mouse.md: Documented the fix for the issue with duplicate links and added a test in dom.spec.ts to ensure links without rel attribute aren't duplicated.
  • packages/sdk/src/dom.ts: Modified the createLink function to treat null and undefined rel attributes as equivalent when checking for existing links.
  • packages/sdk/__tests__/dom.spec.ts: Added a test to ensure that a duplicate link is not created when an existing link has no rel attribute and the new link's rel attribute is undefined.

Build and Configuration:

  • package.json: Updated the changegen script to include the sdk package.

Related Issue

#3705

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have updated the documentation.

Sorry, something went wrong.

Copy link

netlify bot commented Apr 16, 2025

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit ff4685d
🔍 Latest deploy log https://app.netlify.com/sites/module-federation-docs/deploys/680328edd3eb910008204519
😎 Deploy Preview https://deploy-preview-3707--module-federation-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@ScriptedAlchemy ScriptedAlchemy marked this pull request as ready for review April 17, 2025 01:15
@ScriptedAlchemy ScriptedAlchemy requested a review from 2heal1 April 17, 2025 01:16
Copy link

changeset-bot bot commented Apr 19, 2025

🦋 Changeset detected

Latest commit: ff4685d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 32 packages
Name Type
@module-federation/sdk Patch
@module-federation/cli Patch
@module-federation/devtools Patch
@module-federation/data-prefetch Patch
@module-federation/dts-plugin Patch
@module-federation/enhanced Patch
@module-federation/esbuild Patch
@module-federation/managers Patch
@module-federation/manifest Patch
@module-federation/modern-js Patch
@module-federation/nextjs-mf Patch
@module-federation/node Patch
@module-federation/retry-plugin Patch
@module-federation/rsbuild-plugin Patch
@module-federation/rspack Patch
@module-federation/runtime-core Patch
@module-federation/runtime Patch
@module-federation/storybook-addon Patch
@module-federation/utilities Patch
@module-federation/webpack-bundler-runtime Patch
@module-federation/bridge-react-webpack-plugin Patch
@module-federation/bridge-react Patch
@module-federation/bridge-vue3 Patch
@module-federation/modernjsapp Patch
remote5 Patch
@module-federation/runtime-tools Patch
@module-federation/inject-external-runtime-core-plugin Patch
@module-federation/third-party-dts-extractor Patch
@module-federation/bridge-shared Patch
@module-federation/error-codes Patch
create-module-federation Patch
website-new Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants