Skip to content

Conversation

@ahabhgk
Copy link
Contributor

@ahabhgk ahabhgk commented Oct 13, 2025

Summary

Eval simple expression for enum member

Related links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings October 13, 2025 11:20
@netlify
Copy link

netlify bot commented Oct 13, 2025

Deploy Preview for rspack ready!

Name Link
🔨 Latest commit cf411b5
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/68ece1336f2fc700081557fd
😎 Deploy Preview https://deploy-preview-11859--rspack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions bot added release: feature release: feature related release(mr only) team The issue/pr is created by the member of Rspack. labels Oct 13, 2025
@ahabhgk ahabhgk enabled auto-merge (squash) October 13, 2025 11:20
Copy link
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 implements expression evaluation for TypeScript enum members, enabling inlining of computed enum values like arithmetic operations, unary expressions, and references to other enum members.

Key changes:

  • Enhanced enum member value evaluation to handle expressions beyond simple literals
  • Added comprehensive expression evaluation methods supporting arithmetic, unary operators, member references, and template literals
  • Updated function signatures to pass syntax context information for proper identifier resolution

Reviewed Changes

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

Show a summary per file
File Description
tests/rspack-test/configCases/inline-enum/enum-expression/index.js Added test cases for evaluatable enum expressions
tests/rspack-test/configCases/inline-enum/enum-expression/enum.ts Added new enum with various expression types for testing
crates/swc_plugin_ts_collector/tests/fixture.rs Updated closure signature to match new API
crates/swc_plugin_ts_collector/src/enums.rs Implemented comprehensive expression evaluation for enum members
crates/rspack_loader_swc/src/lib.rs Updated to pass syntax context to TypeScript info collection
crates/rspack_loader_swc/src/collect_ts_info.rs Added syntax context parameter to collection function
crates/rspack_javascript_compiler/src/compiler/transform.rs Modified transform pipeline to provide syntax context
crates/rspack_javascript_compiler/examples/transform.rs Updated example to match new closure signature
crates/rspack_binding_api/src/swc.rs Updated binding to match new closure signature

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

@github-actions
Copy link
Contributor

📦 Binary Size-limit

Comparing cf411b5 to chore(deps): update patch npm dependencies (#11806) by renovate[bot]

🎉 Size decreased by 274.13KB from 47.89MB to 47.62MB (⬇️0.56%)

@codspeed-hq
Copy link

codspeed-hq bot commented Oct 13, 2025

CodSpeed Performance Report

Merging #11859 will not alter performance

Comparing add-enum-eval (cf411b5) with main (a915dab)

Summary

✅ 17 untouched

@ahabhgk ahabhgk merged commit a026ce5 into main Oct 13, 2025
91 of 96 checks passed
@ahabhgk ahabhgk deleted the add-enum-eval branch October 13, 2025 19:23
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