You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This pull request adds a new feature to webpack that allows setting the fetch priority of dynamic imports, either globally or individually. This feature can improve the loading performance of async chunks by using the fetchPriority attribute on script tags. The pull request modifies several files in the lib, schemas and test folders to implement, validate and test this feature. It also updates the cspell.json file to add a new word related to this feature.
Add a new parser option dynamicImportFetchPriority to specify the global fetch priority for dynamic imports in lib/config/defaults.js (link)
Add a new property fetchPriority to the ChunkGroup class to store the fetch priority option for a chunk group in lib/ChunkGroup.js (link)
Add a new case for the fetchPriority property in the ImportMetaContextDependencyParserPlugin class to parse the import.meta object for dynamic imports in lib/dependencies/ImportMetaContextDependencyParserPlugin.js (link)
Add a new condition to the ImportParserPlugin class to check the dynamicImportFetchPriority option and set the groupOptions.fetchPriority accordingly in lib/dependencies/ImportParserPlugin.js (link)
Add a new condition to the ImportParserPlugin class to check the webpackFetchPriority property in the importOptions object and set the groupOptions.fetchPriority accordingly or add a warning in lib/dependencies/ImportParserPlugin.js (link)
Add a new class ChunkFetchPriorityFunctionRuntimeModule to generate the runtime code for the getFetchPriority function that returns the fetch priority for a given chunk id in lib/prefetch/ChunkFetchPriorityFunctionRuntimeModule.js (link)
Add a new hook to the ChunkPrefetchPreloadPlugin class to iterate over the async chunks and collect the fetch priorities and add a new ChunkFetchPriorityFunctionRuntimeModule and the getFetchPriority requirement if needed in lib/prefetch/ChunkPrefetchPreloadPlugin.js (link)
Add a new parameter hasGetFetchPriority to the LoadScriptRuntimeModule class to determine if the loadScript function should use the fetchPriority attribute or not in lib/runtime/LoadScriptRuntimeModule.js (link)
Add a new condition to the LoadScriptRuntimeModule class to generate the code to set the fetchPriority attribute on the script tag using the getFetchPriority function and the chunk id in lib/runtime/LoadScriptRuntimeModule.js (link)
Add a new argument fetchPriority to the loadScript function signature and pass it to the createScript function call in lib/runtime/LoadScriptRuntimeModule.js (link)
Add a new runtime global function getFetchPriority to return the fetch priority for a given chunk id in lib/RuntimeGlobals.js (link)
Add a new condition to the RuntimePlugin class to check the getFetchPriority requirement and pass it as an argument to the LoadScriptRuntimeModule constructor in lib/RuntimePlugin.js (link)
Add a new condition to the JsonpChunkLoadingRuntimeModule class to check the getFetchPriority requirement and store it in a local variable withFetchPriority in lib/web/JsonpChunkLoadingRuntimeModule.js (link)
Add a new condition to the JsonpChunkLoadingRuntimeModule class to generate the code to declare and assign the fetchPriority variable using the getFetchPriority function and the chunk id in lib/web/JsonpChunkLoadingRuntimeModule.js (link)
Add a new argument fetchPriority to the loadScript function call and pass it if the withFetchPriority variable is true in lib/web/JsonpChunkLoadingRuntimeModule.js (link)
Add a new schema definition for the dynamicImportFetchPriority option to validate the webpack configuration in schemas/WebpackOptions.json (link)
Add a new test case to test the inline webpackFetchPriority option for dynamic imports in test/cases/chunks/inline-options/index.js (link)
Add new files a.js, b.js and c.js to test the inline webpackFetchPriority option for dynamic imports in test/cases/chunks/inline-options/dir14/ (link, link, link)
Swap the order of the words "IIFE" and "IIFE's" and "webpack" and "webpack's" in the cspell.json file to keep the words in alphabetical order (link, link)
Remove the second argument of false from the call to the getChildIdsByOrdersMap method of the chunk object in the ChunkPrefetchPreloadPlugin class, which is not needed since the fetch priority is optional (link)
Destructure the dynamicImportFetchPriority option from the options object and store it in a local variable in the ImportParserPlugin class, which is a minor refactoring (link)
Add a new file a.js to test the global dynamicImportFetchPriority option for dynamic imports in test/configCases/web/fetch-priority-2/ (link)
Add new files b.js and c.js to test the global dynamicImportFetchPriority option for dynamic imports in test/configCases/web/fetch-priority-2/ (link, link)
Add a new default value for the dynamicImportFetchPriority option to test the default values of the webpack configuration in test/Defaults.unittest.js (link)
The text was updated successfully, but these errors were encountered:
A pull request by @alexander-akait was merged and maintainers requested a documentation change.
See pull request: webpack/webpack#17249
due to outdated fork I recreate a new
fixes #16991
fixes #16989
Summary
馃 Generated by Copilot at 4b6eed7
This pull request adds a new feature to webpack that allows setting the fetch priority of dynamic imports, either globally or individually. This feature can improve the loading performance of async chunks by using the
fetchPriority
attribute on script tags. The pull request modifies several files in the lib, schemas and test folders to implement, validate and test this feature. It also updates thecspell.json
file to add a new word related to this feature.Details
馃 Generated by Copilot at 4b6eed7
fetchPriority
attribute on script tags (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link)dynamicImportFetchPriority
to specify the global fetch priority for dynamic imports inlib/config/defaults.js
(link)fetchPriority
to theChunkGroup
class to store the fetch priority option for a chunk group inlib/ChunkGroup.js
(link)fetchPriority
property in theImportMetaContextDependencyParserPlugin
class to parse theimport.meta
object for dynamic imports inlib/dependencies/ImportMetaContextDependencyParserPlugin.js
(link)ImportParserPlugin
class to check thedynamicImportFetchPriority
option and set thegroupOptions.fetchPriority
accordingly inlib/dependencies/ImportParserPlugin.js
(link)ImportParserPlugin
class to check thewebpackFetchPriority
property in theimportOptions
object and set thegroupOptions.fetchPriority
accordingly or add a warning inlib/dependencies/ImportParserPlugin.js
(link)ChunkFetchPriorityFunctionRuntimeModule
to generate the runtime code for thegetFetchPriority
function that returns the fetch priority for a given chunk id inlib/prefetch/ChunkFetchPriorityFunctionRuntimeModule.js
(link)ChunkPrefetchPreloadPlugin
class to iterate over the async chunks and collect the fetch priorities and add a newChunkFetchPriorityFunctionRuntimeModule
and thegetFetchPriority
requirement if needed inlib/prefetch/ChunkPrefetchPreloadPlugin.js
(link)hasGetFetchPriority
to theLoadScriptRuntimeModule
class to determine if theloadScript
function should use thefetchPriority
attribute or not inlib/runtime/LoadScriptRuntimeModule.js
(link)LoadScriptRuntimeModule
class to generate the code to set thefetchPriority
attribute on the script tag using thegetFetchPriority
function and the chunk id inlib/runtime/LoadScriptRuntimeModule.js
(link)fetchPriority
to theloadScript
function signature and pass it to thecreateScript
function call inlib/runtime/LoadScriptRuntimeModule.js
(link)getFetchPriority
to return the fetch priority for a given chunk id inlib/RuntimeGlobals.js
(link)RuntimePlugin
class to check thegetFetchPriority
requirement and pass it as an argument to theLoadScriptRuntimeModule
constructor inlib/RuntimePlugin.js
(link)JsonpChunkLoadingRuntimeModule
class to check thegetFetchPriority
requirement and store it in a local variablewithFetchPriority
inlib/web/JsonpChunkLoadingRuntimeModule.js
(link)JsonpChunkLoadingRuntimeModule
class to generate the code to declare and assign thefetchPriority
variable using thegetFetchPriority
function and the chunk id inlib/web/JsonpChunkLoadingRuntimeModule.js
(link)fetchPriority
to theloadScript
function call and pass it if thewithFetchPriority
variable is true inlib/web/JsonpChunkLoadingRuntimeModule.js
(link)dynamicImportFetchPriority
option to validate the webpack configuration inschemas/WebpackOptions.json
(link)webpackFetchPriority
option for dynamic imports intest/cases/chunks/inline-options/index.js
(link)a.js
,b.js
andc.js
to test the inlinewebpackFetchPriority
option for dynamic imports intest/cases/chunks/inline-options/dir14/
(link, link, link)cspell.json
file to keep the words in alphabetical order (link, link)getChildIdsByOrdersMap
method of the chunk object in theChunkPrefetchPreloadPlugin
class, which is not needed since the fetch priority is optional (link)dynamicImportFetchPriority
option from the options object and store it in a local variable in theImportParserPlugin
class, which is a minor refactoring (link)a.js
to test the globaldynamicImportFetchPriority
option for dynamic imports intest/configCases/web/fetch-priority-2/
(link)b.js
andc.js
to test the globaldynamicImportFetchPriority
option for dynamic imports intest/configCases/web/fetch-priority-2/
(link, link)dynamicImportFetchPriority
option to test the default values of the webpack configuration intest/Defaults.unittest.js
(link)The text was updated successfully, but these errors were encountered: