Skip to content

Conversation

fi3ework
Copy link
Member

@fi3ework fi3ework commented Oct 11, 2025

Summary

previously, there's no difference when importing an external module with and without import attributes, as the ChunkInitFragment key didn't counting import attributes.

source

import { a1 } from 'a'
import { a2 } from 'a' with { type: "json" }
console.log(a1, a2)

result before

import { a1, a2 } from 'a' // sometimes it suffixs with attributes, it's a race condition.
console.log(a1, a2)

result now

import { a1 } from 'a'
import { a2 } from 'a' with { type: "json" }
console.log(a1, a2)

Related links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copy link

netlify bot commented Oct 11, 2025

Deploy Preview for rspack ready!

Name Link
🔨 Latest commit c694871
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/68ecb4248d29c30008f82e62
😎 Deploy Preview https://deploy-preview-11845--rspack.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 project configuration.

@github-actions github-actions bot added release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack. labels Oct 11, 2025
Copy link
Contributor

github-actions bot commented Oct 11, 2025

📦 Binary Size-limit

Comparing c694871 to chore(deps): update patch npm dependencies (#11806) by renovate[bot]

❌ Size increased by 1.63KB from 47.89MB to 47.89MB (⬆️0.00%)

Copy link

codspeed-hq bot commented Oct 11, 2025

CodSpeed Performance Report

Merging #11845 will not alter performance

Comparing distinguis-exter-attr (c694871) with main (dd19380)

Summary

✅ 17 untouched

@fi3ework fi3ework force-pushed the distinguis-exter-attr branch from 2477535 to 315c13b Compare October 13, 2025 05:35
@fi3ework fi3ework force-pushed the distinguis-exter-attr branch from 315c13b to c694871 Compare October 13, 2025 08:11
@fi3ework fi3ework marked this pull request as ready for review October 13, 2025 09:01
@fi3ework fi3ework requested review from JSerFeng and Copilot October 13, 2025 09:01
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a bug where external modules with import attributes were not being distinguished from those without attributes, causing incorrect import statement merging. The fix ensures that import attributes are properly considered when generating unique keys for external module fragments.

  • Added import attributes to external module identifier generation
  • Updated InitFragmentKey generation to include import attributes
  • Added test coverage to verify correct handling of imports with and without attributes

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
crates/rspack_core/src/external_module.rs Core fix implementing attribute-aware fragment key generation and module identification
tests/rspack-test/configCases/externals/import-attributes/index.js Added test cases for imports with and without attributes
tests/rspack-test/configCases/externals/import-attributes/rspack.config.js Added assertions to verify distinct handling of imports with different attributes

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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

Labels

release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant