Skip to content

fix: remove invalid PURE literal annotations and add bundle validation tests#2737

Open
hectorhdzg wants to merge 3 commits into
microsoft:mainfrom
hectorhdzg:fix/rolldown-pure-annotation-validation
Open

fix: remove invalid PURE literal annotations and add bundle validation tests#2737
hectorhdzg wants to merge 3 commits into
microsoft:mainfrom
hectorhdzg:fix/rolldown-pure-annotation-validation

Conversation

@hectorhdzg

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings May 26, 2026 21:00
@hectorhdzg hectorhdzg requested a review from a team as a code owner May 26, 2026 21:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 addresses build/bundler compatibility by removing invalid /*#__PURE__*/ annotations placed on non-call/non-new expressions (e.g., string literals / null) and adds automated bundle validations to prevent regressions.

Changes:

  • Remove invalid /*#__PURE__*/ annotations applied to literals / null in source constants.
  • Switch ExtVersion back to the build-time #extVersion# placeholder.
  • Add unit “size” tests that scan built dist bundles for invalid PURE annotation placement (Rolldown-focused validation).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
shared/AppInsightsCore/Tests/Unit/src/ai/AppInsightsCoreSize.Tests.ts Adds a bundle scan test to detect invalid PURE annotation placement in the AppInsightsCore dist output.
shared/AppInsightsCore/src/ext/extUtils.ts Removes PURE-on-null and restores ExtVersion to the #extVersion# build placeholder.
AISKU/Tests/Unit/src/AISKUSize.Tests.ts Adds a bundle scan test to detect invalid PURE annotation placement in the AISKU dist output.
AISKU/src/internal/trace/spanUtils.ts Removes PURE annotations incorrectly applied to string literal constants.

Comment thread shared/AppInsightsCore/Tests/Unit/src/ai/AppInsightsCoreSize.Tests.ts Outdated
Comment thread AISKU/Tests/Unit/src/AISKUSize.Tests.ts Outdated
Keep legacy parenthesized PURE markers in source and canonicalize emitted bundle annotations as a final rollup plugin pass. Update AISKU and AppInsightsCore size tests to validate canonical PURE spacing in dist output.
@hectorhdzg hectorhdzg force-pushed the fix/rolldown-pure-annotation-validation branch from 37d850c to ad95fbd Compare May 27, 2026 23:21
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

Successfully merging this pull request may close these issues.

2 participants