Skip to content

Conversation

fi3ework
Copy link
Member

@fi3ework fi3ework commented Aug 28, 2025

Summary

the corresponding Rstest side PR is: web-infra-dev/rstest#519.

  • in Rstest, we will introduce a loader to convert all static imports into dynamic imports. this way, module hoisting only needs to ensure that it hoists the module before the InitFragmentStage::StageAsyncDependencies stage, as there will be no static imports or conflicting import orders.
  • since static imports will become dynamic imports for the parser, the parser will also undergo changes. this process is a bit messier than before.

Related links

Checklist

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

Copy link

netlify bot commented Aug 28, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 206104a
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/68b7e0f556e428000874da12

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

github-actions bot commented Aug 28, 2025

📦 Binary Size-limit

Comparing 206104a to chore(deps): update dependency @rspack/plugin-react-refresh to ^1.5.0 (#11565) by renovate[bot]

🎉 Size decreased by 4.13KB from 47.32MB to 47.32MB (⬇️0.01%)

@fi3ework fi3ework force-pushed the merge-async branch 2 times, most recently from 5db36e9 to a37ca02 Compare August 29, 2025 08:07
Copy link

codspeed-hq bot commented Aug 29, 2025

CodSpeed Performance Report

Merging #11521 will not alter performance

Comparing merge-async (206104a) with main (0fe3eea)

🎉 Hooray! codspeed-rust just leveled up to 2.7.2!

A heads-up, this is a breaking change and it might affect your current performance baseline a bit. But here's the exciting part - it's packed with new, cool features and promises improved result stability 🥳!
Curious about what's new? Visit our releases page to delve into all the awesome details about this new version.

Summary

✅ 17 untouched benchmarks

@fi3ework fi3ework marked this pull request as ready for review August 29, 2025 09:36
@Copilot Copilot AI review requested due to automatic review settings August 29, 2025 09:36
@fi3ework fi3ework requested a review from LingyuCoder as a code owner August 29, 2025 09:36
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 simplifies the mock logic in the rspack_plugin_rstest by transitioning from a static import to dynamic import based approach. The changes reduce complexity by removing hoisting-related parameters and dependencies while adding support for a new MOCKREQUIRE comment pattern.

  • Adds MOCKREQUIRE pattern support to the regex for parsing rstest comments
  • Removes complex hoisting logic with async factory parameters and position-based dependencies
  • Refactors parser plugin methods to handle rstest calls through declarator and statement hooks instead of call_member_chain

Reviewed Changes

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

File Description
crates/rspack_plugin_rstest/src/plugin.rs Adds MOCKREQUIRE pattern to the regex for processing rstest assets
crates/rspack_plugin_rstest/src/parser_plugin.rs Major refactoring removes complex hoisting logic and simplifies method call handling
crates/rspack_plugin_rstest/src/mock_module_id_dependency.rs Removes hoist and async_factory parameters and related template logic
crates/rspack_plugin_rstest/src/mock_method_dependency.rs Removes position-based dependencies and adds new mock method variants

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

@fi3ework fi3ework force-pushed the merge-async branch 2 times, most recently from 1cd207e to cb824d2 Compare September 3, 2025 03:32
@fi3ework fi3ework enabled auto-merge (squash) September 3, 2025 07:10
@fi3ework fi3ework merged commit 37f633e into main Sep 3, 2025
44 checks passed
@fi3ework fi3ework deleted the merge-async branch September 3, 2025 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release: feature release: feature 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.

2 participants