Skip to content

Remove misplaced pure annotations#66778

Open
TheAlexLichter wants to merge 2 commits into
dotnet:mainfrom
TheAlexLichter:remove-signalr-misplaced-pure-annotations
Open

Remove misplaced pure annotations#66778
TheAlexLichter wants to merge 2 commits into
dotnet:mainfrom
TheAlexLichter:remove-signalr-misplaced-pure-annotations

Conversation

@TheAlexLichter

@TheAlexLichter TheAlexLichter commented May 21, 2026

Copy link
Copy Markdown

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

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