Skip to content

feat: warn when a file is emitted with the same name#3503

Merged
underfin merged 1 commit intomainfrom
FILE_NAME_CONFLICT
Feb 6, 2025
Merged

feat: warn when a file is emitted with the same name#3503
underfin merged 1 commit intomainfrom
FILE_NAME_CONFLICT

Conversation

@underfin
Copy link
Copy Markdown
Contributor

@underfin underfin commented Feb 6, 2025

Description

close #3444

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 6, 2025

Benchmarks Rust

group                                                               pr                                     target
-----                                                               --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol                     1.00     72.2±1.54ms        ? ?/sec    1.00     72.5±1.09ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-minify              1.02     95.7±3.31ms        ? ?/sec    1.00     93.5±1.05ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-minify-sourcemap    1.00    104.8±1.31ms        ? ?/sec    1.02    107.2±1.52ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap           1.00     81.8±1.21ms        ? ?/sec    1.00     82.2±0.98ms        ? ?/sec
bundle/bundle@rome-ts                                               1.00    121.8±1.30ms        ? ?/sec    1.01    122.8±1.11ms        ? ?/sec
bundle/bundle@rome-ts-minify                                        1.00    199.7±3.08ms        ? ?/sec    1.00    199.7±2.42ms        ? ?/sec
bundle/bundle@rome-ts-minify-sourcemap                              1.00    236.2±4.54ms        ? ?/sec    1.00    235.5±2.19ms        ? ?/sec
bundle/bundle@rome-ts-sourcemap                                     1.00    134.7±1.55ms        ? ?/sec    1.03    138.8±2.97ms        ? ?/sec
bundle/bundle@threejs                                               1.00     40.9±3.32ms        ? ?/sec    1.00     40.8±1.92ms        ? ?/sec
bundle/bundle@threejs-minify                                        1.00     89.5±2.40ms        ? ?/sec    1.01     90.4±0.55ms        ? ?/sec
bundle/bundle@threejs-minify-sourcemap                              1.00    103.4±1.46ms        ? ?/sec    1.04    107.8±1.01ms        ? ?/sec
bundle/bundle@threejs-sourcemap                                     1.00     50.3±0.69ms        ? ?/sec    1.02     51.2±0.43ms        ? ?/sec
bundle/bundle@threejs10x                                            1.00    423.5±3.70ms        ? ?/sec    1.02    431.9±4.68ms        ? ?/sec
bundle/bundle@threejs10x-minify                                     1.00   1055.2±9.13ms        ? ?/sec    1.02   1076.2±5.26ms        ? ?/sec
bundle/bundle@threejs10x-minify-sourcemap                           1.00  1236.3±12.85ms        ? ?/sec    1.01  1249.0±12.25ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                                  1.00   494.4±14.00ms        ? ?/sec    1.01    501.5±5.91ms        ? ?/sec
remapping/remapping                                                 1.00     25.6±0.17ms        ? ?/sec    1.00     25.5±0.17ms        ? ?/sec
remapping/render-chunk-remapping                                    1.02     66.2±3.49ms        ? ?/sec    1.00     64.9±3.22ms        ? ?/sec
scan/scan@rome-ts                                                   1.00     95.2±1.13ms        ? ?/sec    1.00     95.1±1.09ms        ? ?/sec
scan/scan@threejs                                                   1.00     31.0±0.69ms        ? ?/sec    1.02     31.8±1.88ms        ? ?/sec
scan/scan@threejs10x                                                1.01    322.1±5.54ms        ? ?/sec    1.00    317.4±4.68ms        ? ?/sec

@underfin underfin added this pull request to the merge queue Feb 6, 2025
Merged via the queue into main with commit 4bb775f Feb 6, 2025
22 checks passed
@underfin underfin deleted the FILE_NAME_CONFLICT branch February 6, 2025 04:29
IWANABETHATGUY added a commit that referenced this pull request Mar 27, 2026
## Summary

`FileEmitter::clear()` was missing `emitted_filenames.clear()`, causing
false `FILE_NAME_CONFLICT` warnings on every watch rebuild. Files
emitted by plugins would conflict with themselves from the previous
build.

Fixes #8912

## Changes

- Add `self.emitted_filenames.clear()` to `FileEmitter::clear()` — this
field was added in #3503 but never included in the watch-mode reset
- Add JS watch test that verifies no false `FILE_NAME_CONFLICT` on
rebuild

## Test plan

- [x] Rust unit test confirms false warning without fix, no warning with
fix
- [x] JS watch test (`watch should not emit false FILE_NAME_CONFLICT on
rebuild`) fails without fix, passes with fix
- [x] Existing `onwarn/filename-conflict` fixture still passes
(intra-build conflicts unaffected)

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.

[Feature Request]: warn when a file is emitted with the same name

2 participants