fix: remove invalid PURE literal annotations and add bundle validation tests#2737
Open
hectorhdzg wants to merge 3 commits into
Open
fix: remove invalid PURE literal annotations and add bundle validation tests#2737hectorhdzg wants to merge 3 commits into
hectorhdzg wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
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 /nullin source constants. - Switch
ExtVersionback 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. |
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.
37d850c to
ad95fbd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.