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
Other features like async/await could be added in another PR
Summary
馃 Generated by Copilot at 9bb35fb
This pull request enhances the DefinePlugin class to optimize the code generation for object expressions that are replaced by RuntimeValue instances. It also adds support for tracking the used keys of destructuring assignment expressions in object patterns, and updates the JavascriptParser class accordingly. It includes a new test case to verify the functionality of the DefinePlugin with RuntimeValue instances.
Details
馃 Generated by Copilot at 9bb35fb
Add a new parameter objKeys to the RuntimeValue class and its methods to optimize the code generation for object expressions (link, link, link, link, link, link)
Pass the objKeys parameter to the toCode function call in the DefinePlugin class, where it replaces expressions with RuntimeValue instances (link, link)
Obtain the objKeys parameter from the parser.destructuringAssignmentKeysFor method, which returns the set of used keys for a destructuring assignment expression (link, link)
Add a new property destructuringAssignmentKeys and a new method destructuringAssignmentKeysFor to the JavascriptParser class to store and retrieve the used keys for each destructuring assignment expression node (link, link)
Update the blockPreWalkStatements, preWalkStatements, and preWalkAssignmentExpression methods of the JavascriptParser class to handle expression statements, variable declarators, and assignment expressions with object patterns, and set the destructuringAssignmentKeys property accordingly (link, link, link, link)
Initialize and reset the destructuringAssignmentKeys property of the JavascriptParser class in the enterBlock and leaveBlock methods, which are called when entering and leaving a block scope (link, link)
Add a new test case to the define-plugin config case in test/configCases/plugins/define-plugin/index.js and test/configCases/plugins/define-plugin/webpack.config.js to check the functionality and optimization of the DefinePlugin with object expressions and destructuring assignments (link, link)
The text was updated successfully, but these errors were encountered:
A pull request by @vankop was merged and maintainers requested a documentation change.
See pull request: webpack/webpack#16941
related to webpack/webpack#14800
TODO
Other features like async/await could be added in another PR
Summary
馃 Generated by Copilot at 9bb35fb
This pull request enhances the
DefinePlugin
class to optimize the code generation for object expressions that are replaced byRuntimeValue
instances. It also adds support for tracking the used keys of destructuring assignment expressions in object patterns, and updates theJavascriptParser
class accordingly. It includes a new test case to verify the functionality of theDefinePlugin
withRuntimeValue
instances.Details
馃 Generated by Copilot at 9bb35fb
objKeys
to theRuntimeValue
class and its methods to optimize the code generation for object expressions (link, link, link, link, link, link)objKeys
parameter to thetoCode
function call in theDefinePlugin
class, where it replaces expressions withRuntimeValue
instances (link, link)objKeys
parameter from theparser.destructuringAssignmentKeysFor
method, which returns the set of used keys for a destructuring assignment expression (link, link)destructuringAssignmentKeys
and a new methoddestructuringAssignmentKeysFor
to theJavascriptParser
class to store and retrieve the used keys for each destructuring assignment expression node (link, link)blockPreWalkStatements
,preWalkStatements
, andpreWalkAssignmentExpression
methods of theJavascriptParser
class to handle expression statements, variable declarators, and assignment expressions with object patterns, and set thedestructuringAssignmentKeys
property accordingly (link, link, link, link)destructuringAssignmentKeys
property of theJavascriptParser
class in theenterBlock
andleaveBlock
methods, which are called when entering and leaving a block scope (link, link)define-plugin
config case intest/configCases/plugins/define-plugin/index.js
andtest/configCases/plugins/define-plugin/webpack.config.js
to check the functionality and optimization of theDefinePlugin
with object expressions and destructuring assignments (link, link)The text was updated successfully, but these errors were encountered: