Skip to content

Remove misplaced pure annotations - #66778

Merged
BrennanConroy merged 5 commits into
dotnet:mainfrom
TheAlexLichter:remove-signalr-misplaced-pure-annotations
Jun 16, 2026
Merged

BrennanConroy merged 5 commits into
dotnet:mainfrom
TheAlexLichter:remove-signalr-misplaced-pure-annotations

Conversation

@TheAlexLichter

@TheAlexLichter TheAlexLichter commented May 21, 2026 •

Copy link
Copy Markdown
Contributor

This PR removes invalid /*#__PURE__*/ comments from private helper function.

These annotations only apply to call/new expressions, so they are ignored in this position and can produce INVALID_ANNOTATION warnings in downstream bundlers.

Resolves #55286

See also rolldown/rolldown#9496

Copilot AI review requested due to automatic review settings May 21, 2026 16:42
@TheAlexLichter
TheAlexLichter requested a review from halter73 as a code owner May 21, 2026 16:42
@github-actions github-actions Bot added the area-signalr Includes: SignalR clients and servers label May 21, 2026
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label May 21, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Thanks for your PR, @TheAlexLichter. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

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

Removes misplaced /*#__PURE__*/ annotations from private helper function declarations in the SignalR TypeScript client to avoid downstream bundler INVALID_ANNOTATION warnings, without changing helper behavior.

Changes:

  • Removed /*#__PURE__*/ annotations and the associated eslint suppression from getOsName and getRuntimeVersion helper declarations.
  • Kept the helper implementations and call sites unchanged.

@TheAlexLichter
TheAlexLichter force-pushed the remove-signalr-misplaced-pure-annotations branch from 7aef69e to 1b96b6e Compare May 21, 2026 16:47
@TheAlexLichter TheAlexLichter changed the title Remove misplaced SignalR pure annotations Remove wrong pure annotations May 21, 2026
@TheAlexLichter TheAlexLichter changed the title Remove wrong pure annotations Remove misplaced pure annotations May 21, 2026
@baevm

baevm commented May 22, 2026

Copy link
Copy Markdown

there is also a related issue: #55286

@BrennanConroy

Copy link
Copy Markdown
Member

Some context #55496 (comment)

Although, re-reading the webpack docs it looks like #__PURE__ is meant for the caller of the function not the function itself 😲

Looks like if we update webpack to 5.107.0+ we can use the #__NO_SIDE_EFFECTS attribute https://webpack.js.org/guides/tree-shaking/#mark-a-function-declaration-as-side-effect-free

@BrennanConroy BrennanConroy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you update the https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/clients/ts/CHANGELOG.md with a one-liner about this change? Will need a new heading as well: 11.0.0-preview.6

@TheAlexLichter

Copy link
Copy Markdown
Contributor Author

@dotnet-policy-service agree

@TheAlexLichter

Copy link
Copy Markdown
Contributor Author

@BrennanConroy done 👍🏻

@BrennanConroy
BrennanConroy self-requested a review June 16, 2026 16:26
@BrennanConroy

Copy link
Copy Markdown
Member

/ba-g Unrelated failure

@BrennanConroy
BrennanConroy merged commit 0217526 into dotnet:main Jun 16, 2026
21 of 25 checks passed
@BrennanConroy BrennanConroy added this to the 11.0-preview6 milestone Jun 16, 2026
@TheAlexLichter
TheAlexLichter deleted the remove-signalr-misplaced-pure-annotations branch June 16, 2026 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-signalr Includes: SignalR clients and servers community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/*#__PURE__*/ annotations dont work well with Vite / Rollup

5 participants