fix: clear Vite 8 / Rolldown INVALID_ANNOTATION pure-comment warnings#2739
Open
hrithik-infinite wants to merge 2 commits into
Open
fix: clear Vite 8 / Rolldown INVALID_ANNOTATION pure-comment warnings#2739hrithik-infinite wants to merge 2 commits into
hrithik-infinite wants to merge 2 commits into
Conversation
These pure-comments were on plain strings and a null value, not function calls, so they never actually did anything. Rolldown (Vite 8) is stricter and flags them as INVALID_ANNOTATION. Removing them (and the leftover parens) clears the warnings without changing the output - the minified bundle is byte-for-byte identical. Touches HTTP_DOT and _MS_PROCESSED_BY_METRICS_EXTRACTORS in spanUtils.ts and uInt8ArraySupported in extUtils.ts. Part of microsoft#2736.
ts-utils 0.15.0 fixes the same kind of pure-comment problem in its own bundles (nevware21/ts-utils#569) - the other half of microsoft#2736. Raised the floor everywhere and refreshed the shrinkwrap. 0.15.0 is slightly bigger, so the size checks just tip over. Nudged the budgets to match what's actually there: - core-js: raw 132->133, deflate 53->54 KB - web: raw 174->175, deflate 70->71 KB
Author
|
@microsoft-github-policy-service agree |
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates project dependencies and related bundle-size guards to align with a newer @nevware21/ts-utils baseline.
Changes:
- Bump
@nevware21/ts-utilsminimum version from0.14.0to0.15.0across packages/examples/tools. - Adjust bundle size threshold tests to match the new output sizes.
- Remove redundant
/*#__PURE__*/annotations around literal initializers in a couple of TS sources.
Reviewed changes
Copilot reviewed 29 out of 30 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/shims/package.json | Raise @nevware21/ts-utils minimum version. |
| tools/chrome-debug-extension/package.json | Raise @nevware21/ts-utils minimum version. |
| shared/AppInsightsCore/src/ext/extUtils.ts | Simplify literal initializer (remove redundant PURE wrapper). |
| shared/AppInsightsCore/package.json | Raise @nevware21/ts-utils minimum version. |
| shared/AppInsightsCore/Tests/Unit/src/ai/AppInsightsCoreSize.Tests.ts | Update size thresholds to reflect new bundle output. |
| shared/AppInsightsCommon/package.json | Raise @nevware21/ts-utils minimum version. |
| shared/1ds-core-js/package.json | Raise @nevware21/ts-utils minimum version. |
| extensions/applicationinsights-properties-js/package.json | Raise @nevware21/ts-utils minimum version. |
| extensions/applicationinsights-perfmarkmeasure-js/package.json | Raise @nevware21/ts-utils minimum version. |
| extensions/applicationinsights-osplugin-js/package.json | Raise @nevware21/ts-utils minimum version. |
| extensions/applicationinsights-dependencies-js/package.json | Raise @nevware21/ts-utils minimum version. |
| extensions/applicationinsights-debugplugin-js/package.json | Raise @nevware21/ts-utils minimum version. |
| extensions/applicationinsights-clickanalytics-js/package.json | Raise @nevware21/ts-utils minimum version. |
| extensions/applicationinsights-cfgsync-js/package.json | Raise @nevware21/ts-utils minimum version. |
| extensions/applicationinsights-analytics-js/package.json | Raise @nevware21/ts-utils minimum version. |
| examples/startSpan/package.json | Raise @nevware21/ts-utils minimum version. |
| examples/shared-worker/package.json | Raise @nevware21/ts-utils minimum version. |
| examples/dependency/package.json | Raise @nevware21/ts-utils minimum version. |
| examples/cfgSync/package.json | Raise @nevware21/ts-utils minimum version. |
| examples/AISKU/package.json | Raise @nevware21/ts-utils minimum version. |
| common/Tests/Framework/package.json | Raise @nevware21/ts-utils minimum version. |
| channels/tee-channel-js/package.json | Raise @nevware21/ts-utils minimum version. |
| channels/offline-channel-js/package.json | Raise @nevware21/ts-utils minimum version. |
| channels/applicationinsights-channel-js/package.json | Raise @nevware21/ts-utils minimum version. |
| channels/1ds-post-js/package.json | Raise @nevware21/ts-utils minimum version. |
| AISKULight/package.json | Raise @nevware21/ts-utils minimum version. |
| AISKU/src/internal/trace/spanUtils.ts | Simplify literal initializers (remove redundant PURE wrappers). |
| AISKU/package.json | Raise @nevware21/ts-utils minimum version. |
| AISKU/Tests/Unit/src/AISKUSize.Tests.ts | Update size thresholds to reflect new bundle output. |
Files not reviewed (1)
- common/config/rush/npm-shrinkwrap.json: Language not supported
| "@microsoft/applicationinsights-shims": "3.0.1", | ||
| "@microsoft/dynamicproto-js": "^2.0.3", | ||
| "@nevware21/ts-utils": ">= 0.14.0 < 2.x", | ||
| "@nevware21/ts-utils": ">= 0.15.0 < 2.x", |
Comment on lines
+54
to
+57
| private readonly MAX_RAW_SIZE = 133; | ||
| private readonly MAX_BUNDLE_SIZE = 133; | ||
| private readonly MAX_RAW_DEFLATE_SIZE = 54; | ||
| private readonly MAX_BUNDLE_DEFLATE_SIZE = 54; |
Comment on lines
+57
to
+60
| private readonly MAX_RAW_SIZE = 175; | ||
| private readonly MAX_BUNDLE_SIZE = 175; | ||
| private readonly MAX_RAW_DEFLATE_SIZE = 71; | ||
| private readonly MAX_BUNDLE_DEFLATE_SIZE = 71; |
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.
What
Fixes #2736 - Vite 8 / Rolldown prints INVALID_ANNOTATION warnings when it
bundles Application Insights, because a few
/*#__PURE__*/comments are inspots Rolldown won't accept.
Two causes, both handled:
calls), where they do nothing. Removed those.
Fix #__PURE__ annotations being ignored by Rolldown/Vite 8 (#568) nevware21/ts-utils#569. Bumped the dependency to >= 0.15.0.
How I checked
Built a small Vite 8 app against this: 3 warnings before, 0 after. All
core-js (873) and web (751) unit tests pass, and the minified bundle is
identical after removing the comments - no tree-shaking lost.
Note
The pure-comments on real function calls are left alone - their parentheses
keep tree-shaking working on older Rollup/Webpack/Terser (background in
nevware21/ts-utils#568). Size budgets were nudged up to fit ts-utils 0.15.0.