Skip to content

feat: support module subtype in js side#9613

Merged
SyMind merged 19 commits intomainfrom
module-subtype
Mar 13, 2025
Merged

feat: support module subtype in js side#9613
SyMind merged 19 commits intomainfrom
module-subtype

Conversation

@SyMind
Copy link
Member

@SyMind SyMind commented Mar 10, 2025

Summary

Adds support for identifying specific Module subtypes (e.g. NormalModule, ContextModule).

Enables dual validation approaches:

  1. module.constructor.name === "ContextModule"
  2. module instanceof ContextModule

TODO

Now Module class exports from napi bindiing. So when we read the zod.ts module before we compile the rspack binding, will throw error. So temporarily removed validation for documentation options.

Checklist

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

@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 Mar 10, 2025
@netlify
Copy link

netlify bot commented Mar 10, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 2c111e4
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/67d27ca6063e42000833846c

@codspeed-hq
Copy link

codspeed-hq bot commented Mar 10, 2025

CodSpeed Performance Report

Merging #9613 will improve performances by 11.2%

Comparing module-subtype (2c111e4) with main (1c7554b)

Summary

⚡ 2 improvements
✅ 6 untouched benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
Traverse compilation.modules 92.2 µs 85.4 µs +7.97%
Traverse module graph by connections 332.8 µs 299.3 µs +11.2%

@SyMind SyMind force-pushed the module-subtype branch 2 times, most recently from 09da01d to 413bdba Compare March 12, 2025 08:40
@SyMind SyMind marked this pull request as ready for review March 12, 2025 09:05
ahabhgk
ahabhgk previously approved these changes Mar 12, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Mar 13, 2025

📝 Ecosystem CI detail: Open

suite result
rspress ❌ failure
rslib ✅ success
modernjs ❌ failure
devserver ❌ failure
rsdoctor ❌ failure
rsbuild ✅ success
nuxt ✅ success
examples ✅ success

hardfist
hardfist previously approved these changes Mar 13, 2025
@SyMind SyMind dismissed stale reviews from hardfist and ahabhgk via acee5fb March 13, 2025 05:51
@github-actions
Copy link
Contributor

github-actions bot commented Mar 13, 2025

📝 Ecosystem CI detail: Open

suite result
rsbuild ✅ success
devserver ✅ success
modernjs ✅ success
examples ✅ success
rsdoctor ❌ failure
nuxt ✅ success
rslib ✅ success
rspress ❌ failure

@SyMind SyMind merged commit 6dadaa5 into main Mar 13, 2025
31 checks passed
@SyMind SyMind deleted the module-subtype branch March 13, 2025 06:59
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.

3 participants