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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document webpack change: support destructuring assignment with AwaitExpression #6760

Open
webpack-bot opened this issue Apr 15, 2023 · 0 comments

Comments

@webpack-bot
Copy link

A pull request by @vankop was merged and maintainers requested a documentation change.

See pull request: webpack/webpack#16995


related to webpack/webpack#14800

Summary

馃 Generated by Copilot at 3824bee

This pull request adds support for import statements with destructuring assignment in the ImportParserPlugin and fixes a bug in the JavascriptParser that affected dynamic imports with await. It also adds new test cases and warnings to cover the new functionality and the incompatible option.

Details

馃 Generated by Copilot at 3824bee

  • Add a helper function exportsFromEnumerable to the ImportParserPlugin class to format the requested exports from an import statement (link)
  • Refactor the use of Array.from with exportsFromEnumerable to avoid code duplication and improve readability (link)
  • Handle the case of import statements using destructuring assignment, such as const { default: def } = await import("./dir1/a");, by using the destructuringAssignmentPropertiesFor method from the JavascriptParser class and adding a warning if the webpackExports option is used (link, link, link)
  • Add test case files test/cases/chunks/destructuring-assignment/dir1/a.js, test/cases/chunks/destructuring-assignment/index.js, and test/cases/chunks/destructuring-assignment/warnings.js to verify the functionality and warnings of the ImportParserPlugin and the destructuringAssignmentPropertiesFor method (link, link, link)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant