Skip to content

fix(react-compiler): Rename Tree.FromAssertion to fromAssertion - #121922

Closed
sentry[bot] wants to merge 1 commit into
masterfrom
seer/fix/rename-tree-fromassertion
Closed

fix(react-compiler): Rename Tree.FromAssertion to fromAssertion#121922
sentry[bot] wants to merge 1 commit into
masterfrom
seer/fix/rename-tree-fromassertion

Conversation

@sentry

@sentry sentry Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Renames the static method Tree.FromAssertion to Tree.fromAssertion in static/app/views/detectors/components/uptime/assertions/assertionFailure/models/tree.tsx and updates all its call sites.

This change addresses a no-capitalized-function-calls warning from the React Compiler. The compiler flags capitalized function calls as potential React components, which can lead to ambiguity and incorrect behavior if they are not actual components. By renaming the static helper method to use camelCase, we align with JavaScript/React naming conventions for non-component functions and resolve the linter warning.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

Fixes CODING-CONVENTIONS-1TE

@sentry
sentry Bot requested a review from a team as a code owner August 13, 2026 01:42
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Aug 13, 2026
@ryan953

ryan953 commented Aug 13, 2026

Copy link
Copy Markdown
Member

Closing as a duplicate — the same Tree.FromAssertion -> Tree.fromAssertion rename is consolidated in #121920, which now also references this issue's Sentry ticket so merging it will close it too.

@ryan953 ryan953 closed this Aug 13, 2026
ryan953 added a commit that referenced this pull request Aug 13, 2026
…ion (#121920)

This PR addresses an ESLint warning `no-capitalized-function-calls` that
was triggered by the static factory method `Tree.FromAssertion` in
`static/app/views/detectors/components/uptime/assertions/assertionFailure/models/tree.tsx`.

The `no-capitalized-function-calls` rule is designed to prevent React
components from being invoked as plain functions (e.g., `MyComponent()`
instead of `<MyComponent />`). Because `FromAssertion` was PascalCase,
the linter incorrectly flagged it as a potential React component call.

To resolve this, the static method `FromAssertion` has been renamed to
`fromAssertion` (camelCase) to align with standard JavaScript/TypeScript
naming conventions for non-component functions. All call sites in
`static/app/views/detectors/components/uptime/assertions/assertionFailure/assertionFailureTree.tsx`
and
`static/app/views/detectors/components/uptime/assertions/assertionFailure/models/tree.spec.tsx`
have been updated accordingly.

<!--

  Sentry employees and contractors can delete or ignore the following.

-->

### Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated
in the State of Delaware in 2015 as Functional Software, Inc. and is
gonna need some rights from me in order to utilize my contributions in
this here PR. So here's the deal: I retain all rights, title and
interest in and to my contributions, and by keeping this boilerplate
intact I confirm that Sentry can use, modify, copy, and redistribute my
contributions, under Sentry's choice of terms.

---
_Consolidated: issue CODING-CONVENTIONS-1TE reported a stale/renamed
file path that resolves to this same `Tree.FromAssertion` call site
(superseded PR #121922 closed as duplicate)._

Fixes
[CODING-CONVENTIONS-3XX](https://sentry.sentry.io/issues/7666633675/?seerDrawer=true)
Fixes
[CODING-CONVENTIONS-1TE](https://sentry.sentry.io/issues/7619788400/?seerDrawer=true)

Co-authored-by: Ryan Albrecht <ryan953@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant