Skip to content
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

taps inflation on serve mode #5398

Closed
xc2 opened this issue Jan 22, 2024 · 3 comments · Fixed by #5436
Closed

taps inflation on serve mode #5398

xc2 opened this issue Jan 22, 2024 · 3 comments · Fixed by #5436
Assignees
Labels
bug Something isn't working

Comments

@xc2
Copy link
Collaborator

xc2 commented Jan 22, 2024

System Info


  System:
    OS: macOS 14.3
    CPU: (12) arm64 Apple M2 Max
    Memory: 123.84 MB / 32.00 GB
    Shell: 3.7.0 - /opt/homebrew/bin/fish
  Binaries:
    Node: 20.10.0 - ~/.managed/n/bin/node
    npm: 10.2.3 - ~/.managed/n/bin/npm
    pnpm: 8.14.2 - ~/.managed/n/bin/pnpm
    bun: 1.0.22 - /opt/homebrew/bin/bun
  Browsers:
    Chrome: 120.0.6099.234
    Safari: 17.3
  npmPackages:
    @rspack/cli: canary => 0.5.1-canary-38ebbd3-20240118010407 
    @rspack/core: canary => 0.5.1-canary-38ebbd3-20240118010407 

Also produced with:

Not produced with:

  • 0.5.0

Details

image

Reproduce link

https://github.com/xc2/rspack-hooks-repro

Reproduce Steps

// a plugin in js
const plugin = {
    apply(compiler) {
        const name = 'plugin-xx';
        compiler.hooks.compilation.tap(name, (compilation) => {
            compilation.hooks.optimizeChunkModules.tap(name, () => {
                console.log('optimizeChunkModules called');
            })
            
            console.log('optimizeChunkModules taps:', compilation.hooks.optimizeChunkModules.taps.filter(tap => tap.name === name).length);
        })
    }
}

Steps

  • Run serve mode
  • See once optimizeChunkModules called following optimizeChunkModules taps: 1
  • Modify source codes like src/index.js
  • See double optimizeChunkModules called following optimizeChunkModules taps: 2
  • Modify source codes like src/index.js
  • See triple optimizeChunkModules called following optimizeChunkModules taps: 3

Expected

  • Always see once optimizeChunkModules called following optimizeChunkModules taps: 1 after every source change.

More

I use compiler.hooks.compilation and compilation.hooks.optimizeChunkModules just for instance - seems that this issue applies to not only these hooks.

@xc2 xc2 added bug Something isn't working pending triage The issue/PR is currently untouched. labels Jan 22, 2024
@h-a-n-a h-a-n-a removed the pending triage The issue/PR is currently untouched. label Jan 23, 2024
@h-a-n-a h-a-n-a self-assigned this Jan 23, 2024
@h-a-n-a
Copy link
Contributor

h-a-n-a commented Jan 23, 2024

Hi, thanks for reporting this to us. Would you like to fix this?

@xc2
Copy link
Collaborator Author

xc2 commented Jan 23, 2024

Hi, thanks for reporting this to us. Would you like to fix this?

sure i would

@h-a-n-a
Copy link
Contributor

h-a-n-a commented Jan 24, 2024

Original place that introduced this issue: #5202

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants