Skip to content

feat: support using declaration#11395

Merged
ahabhgk merged 2 commits intomainfrom
feat-using
Aug 15, 2025
Merged

feat: support using declaration#11395
ahabhgk merged 2 commits intomainfrom
feat-using

Conversation

@ahabhgk
Copy link
Copy Markdown
Contributor

@ahabhgk ahabhgk commented Aug 15, 2025

Copilot AI review requested due to automatic review settings August 15, 2025 07:14
@netlify
Copy link
Copy Markdown

netlify bot commented Aug 15, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 96ef91a
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/689ee0b708439c0008ecc28a

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR ports webpack support for the JavaScript "using" declaration feature from webpack/webpack#19626. The changes implement parsing and handling of both using and await using declarations in JavaScript code, which are part of the ECMAScript explicit resource management proposal.

  • Adds test infrastructure to detect "using" declaration support in JavaScript engines
  • Implements parsing for using declarations in variable declaration contexts (for loops, statements)
  • Updates the JavaScript parser to handle using declarations alongside traditional var/let/const declarations

Reviewed Changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/webpack-test/helpers/supportsUsing.js Runtime detection utility for using declaration support
tests/webpack-test/cases/parsing/using/* Test cases for using declaration parsing and functionality
tests/webpack-test/configCases/source-map/exclude-modules-source-map/index.js Updated test expectations for source map generation
crates/rspack_plugin_javascript/src/visitors/dependency/parser/estree.rs Core abstraction for variable declarations including using declarations
crates/rspack_plugin_javascript/src/visitors/dependency/parser/walk*.rs Parser walker implementations updated for using declarations
crates/rspack_plugin_javascript/src/parser_plugin/*.rs Plugin interfaces updated to handle new variable declaration types
crates/rspack_plugin_javascript/src/parser_and_generator/mod.rs Enables explicit resource management in parser configuration
crates/rspack_plugin_devtool/src/*.rs Source map generation fixes for block-scoped code

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions github-actions bot added the release: feature release: feature related release(mr only) label Aug 15, 2025
@ahabhgk ahabhgk enabled auto-merge (squash) August 15, 2025 07:16
@github-actions github-actions bot added the team The issue/pr is created by the member of Rspack. label Aug 15, 2025
@github-actions
Copy link
Copy Markdown
Contributor

📦 Binary Size-limit

Comparing 96ef91a to refactor: distinguish free variable and tagged variable (#11389) by Gengkun

❌ Size increased by 1.63KB from 47.59MB to 47.59MB (⬆️0.00%)

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Aug 15, 2025

CodSpeed Performance Report

Merging #11395 will not alter performance

Comparing feat-using (96ef91a) with main (1e89e34)

🎉 Hooray! codspeed-rust just leveled up to 2.7.2!

A heads-up, this is a breaking change and it might affect your current performance baseline a bit. But here's the exciting part - it's packed with new, cool features and promises improved result stability 🥳!
Curious about what's new? Visit our releases page to delve into all the awesome details about this new version.

Summary

✅ 17 untouched benchmarks

@ahabhgk ahabhgk merged commit 62c8e9e into main Aug 15, 2025
44 checks passed
@ahabhgk ahabhgk deleted the feat-using branch August 15, 2025 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: feature release: feature related release(mr only) team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants