Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: consolidated sourceMap-related fields indevtool#19485

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
hai-x wants to merge2 commits intowebpack:main
base:main
Choose a base branch
Loading
fromhai-x:feat-devtool-object-notation

Conversation

@hai-x
Copy link
Member

@hai-xhai-x commentedMay 1, 2025
edited by evenstensberg
Loading

What kind of change does this PR introduce?

Follows#19389 (comment) Step 1.

Consolidated SourceMap-related fields underdevtool to enhance scalability and improve developer experience (DX). Now, devtool can be defined using an object literal, like so:

{devtool:{"namespace":"webpack","moduleFilenameTemplate":"webpack://[namespace]/[resource-path]","fallbackModuleFilenameTemplate":"webpack://[namespace]/[resource-path]?[hash]","filename":"[file].map[query]","module":true,"columns":true,"noSources":true,"debugIds":true,"eval":true// This is a newly introduced option. When set to true, it behaves the same as 'eval-source-map'.}}

Did you add tests for your changes?

Yes

Does this PR introduce a breaking change?

No

What needs to be documented once your changes are merged?

object notation ofdevtool

}
}

F(options,"devtool",()=>(development ?"eval" :false));
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

We put it after makingoptions.output default b/c we rely onoutput.uniqueName

@hai-xhai-x marked this pull request as ready for reviewMay 1, 2025 10:30
@hai-xhai-xforce-pushed thefeat-devtool-object-notation branch from42ee44e to9908283CompareMay 1, 2025 12:06
@codspeed-hq
Copy link

codspeed-hqbot commentedMay 1, 2025
edited
Loading

CodSpeed Performance Report

Merging#19485 willdegrade performances by 10.48%

Comparinghai-x:feat-devtool-object-notation (7c87b00) withmain (19ca741)

Summary

⚡ 80 improvements
❌ 1 regressions
✅ 40 untouched benchmarks
🆕 12 new benchmarks

⚠️Please fix the performance issues oracknowledge them on CodSpeed.

Benchmarks breakdown

BenchmarkBASEHEADChange
benchmark "future-defaults", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}'52.3 ms11.6 ms×4.5
🆕benchmark "lodash", scenario '{"name":"mode-development","mode":"development"}'N/A751.1 msN/A
🆕benchmark "lodash", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}'N/A30.1 msN/A
🆕benchmark "lodash", scenario '{"name":"mode-production","mode":"production"}'N/A9.8 sN/A
🆕benchmark "many-chunks-commonjs", scenario '{"name":"mode-development","mode":"development"}'N/A247.9 msN/A
🆕benchmark "many-chunks-commonjs", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}'N/A61.4 msN/A
🆕benchmark "many-chunks-commonjs", scenario '{"name":"mode-production","mode":"production"}'N/A2 sN/A
🆕benchmark "many-chunks-esm", scenario '{"name":"mode-development","mode":"development"}'N/A243.4 msN/A
🆕benchmark "many-chunks-esm", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}'N/A61.8 msN/A
🆕benchmark "many-chunks-esm", scenario '{"name":"mode-production","mode":"production"}'N/A2.3 sN/A
🆕benchmark "many-modules-commonjs", scenario '{"name":"mode-development","mode":"development"}'N/A306.1 msN/A
🆕benchmark "many-modules-commonjs", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}'N/A52.3 msN/A
🆕benchmark "many-modules-commonjs", scenario '{"name":"mode-production","mode":"production"}'N/A2.1 sN/A
benchmark "react", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}'31.3 ms35 ms-10.48%
md4 buffer benchmark (size: 10000)114.1 µs73 µs+56.26%
md4 buffer benchmark (size: 100000)447.6 µs406.7 µs+10.08%
md4 buffer benchmark (size: 120)76 µs35 µs×2.2
md4 buffer benchmark (size: 160)76 µs35 µs×2.2
md4 buffer benchmark (size: 16366)138.4 µs97.4 µs+42.13%
md4 buffer benchmark (size: 16368)138.6 µs97.4 µs+42.2%
...............

ℹ️Only the first 20 benchmarks are displayed.Go to the app to view all benchmarks.

@hai-xhai-xforce-pushed thefeat-devtool-object-notation branch 2 times, most recently from27ec59a to2ed2eacCompareMay 7, 2025 14:43
constcheap=devtool.type.includes("cheap");
constmoduleMaps=devtool.type.includes("module");
constnoSources=devtool.type.includes("nosources");
constdebugIds=devtool.type.includes("debugids");

Choose a reason for hiding this comment

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

Ideally we should do it innormalization.js, so indefault.js we will already have object, but I am afraid it can be breaking change, because some developers can rely onoutput.devtool as a string.

There is a good question should we want to supportdevtool: string in future, if yes - code looks good, if no - we need to addTODO.

I'm actually in favor of supporting the string value in the future.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I'm actually in favor of supporting the string value in the future.

Me too. I think it's not too bad to still supportingdevtool: string. So user can easily setting whendevelopment and as far as I know, if need to generate production sourcemaps they usually use plugin.

alexander-akait reacted with thumbs up emoji
namespace:options.output.devtoolNamespace,
namespace,
debugIds
}).apply(compiler);

Choose a reason for hiding this comment

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

So we don't allow to providecolumns/debugIds/etc values in the object notation or you want to finish it after this PR?

hai-x reacted with heart emoji
Copy link
MemberAuthor

@hai-xhai-xMay 22, 2025
edited
Loading

Choose a reason for hiding this comment

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

Currently,columns anddebugIds depend on thedevtool setting (i.e., devtool.includes("cheap") / "debugids").

Yeah, separating them into a dedicated field is a good idea - but should we still support specifying them via string literals or bydevtool.type (e.g., cheap-xxx, debugids-xxx)?

Choose a reason for hiding this comment

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

I think it makes sense only for an object notation, we already have string values which cover every option

hai-x reacted with heart emoji
@hai-xhai-xforce-pushed thefeat-devtool-object-notation branch 3 times, most recently from172c0bf tod98ffbfCompareMay 23, 2025 11:19
@hai-xhai-xforce-pushed thefeat-devtool-object-notation branch fromd98ffbf to6012ee0CompareMay 23, 2025 11:20
Copy link
Member

@alexander-akaitalexander-akait left a comment

Choose a reason for hiding this comment

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

Looks good, can we add a couple simple test cases?

hai-x reacted with heart emoji
Copy link
Member

@evenstensbergevenstensberg left a comment

Choose a reason for hiding this comment

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

lgtm

hai-x reacted with heart emoji
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@alexander-akaitalexander-akaitalexander-akait approved these changes

@evenstensbergevenstensbergevenstensberg approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@hai-x@alexander-akait@evenstensberg

[8]ページ先頭

©2009-2025 Movatter.jp