Skip to content

ref(scraps): Extract legacy Select and virtual rows - #129523

Merged
natemoo-re merged 2 commits into
masterfrom
ref/de-1737-legacy-select
Nov 3, 2026
Merged

natemoo-re merged 2 commits into
masterfrom
ref/de-1737-legacy-select

Conversation

@natemoo-re

@natemoo-re natemoo-re commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Migrates the legacy Select into @sentry/scraps. Unfortunately this means we have a dependency on react-select, but #128354 decoupled the API from this.

Certainly not opposed to using the move as an excuse to drop the legacy dep, but opted for a direct move approach here.

closes DE-1737

@linear-code

linear-code Bot commented Nov 2, 2026

Copy link
Copy Markdown

DE-1737

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 2, 2026
@natemoo-re
natemoo-re marked this pull request as ready for review November 2, 2026 22:15
@natemoo-re
natemoo-re requested review from a team as code owners November 2, 2026 22:16
Package Select with its private React 19 compatibility wrapper and generic virtual row hook. Preserve legacy consumers and normalize react-select module exports for standalone ESM consumers.

Refs DE-1737
Keep packed-consumer validation local and remove react-select dependencies from the app now that Scraps owns the implementation.
@natemoo-re
natemoo-re force-pushed the ref/de-1737-legacy-select branch from 32241fa to 8ef3be7 Compare November 3, 2026 14:27
@natemoo-re
natemoo-re enabled auto-merge (squash) November 3, 2026 14:29
@natemoo-re
natemoo-re merged commit c1de5f4 into master Nov 3, 2026
80 checks passed
@natemoo-re
natemoo-re deleted the ref/de-1737-legacy-select branch November 3, 2026 14:33
natemoo-re added a commit that referenced this pull request Nov 4, 2026
Allow `== null` and `!= null` checks in `@sentry/scraps` by configuring
`eqeqeq` with `['error', 'always', {null: 'ignore'}]`. Other loose
comparisons still fail lint.

Replace the shared `defined()` helper and the local Select helpers with
direct null checks, and remove the shared helper's tests. This follows
#129523 and preserves checks for both null and undefined, including
Select's option filtering.
natemoo-re added a commit that referenced this pull request Nov 9, 2026
Moves the rest of `static/app/components/core/form` (the form engine,
`AutoSaveForm`, field controls, `FieldGroup`, and the error-mapper
context) into `@sentry/scraps/form`, and merges
`@sentry/scraps/formPresentation` back into it.

#128650 split out the presentation layer because the field controls
still depended on Select, CompactSelect, and the modal, which lived in
the app at the time. Those moved out in #129523, #129596, and #129847.
The three app couplings left in `core/form` are replaced:

- **Hash focus:** `BaseField` reads the hash from
`useOverlayContext().location`. `SentryOverlayProvider` already fills
that from the router, so it no longer calls `useLocation`.
- **`FieldGroup`:** renders its own panel and header styles, copied from
the app's `Panel`/`PanelHeader`, and wraps children in `PanelProvider`.
- **Confirm:** `Confirm` and `openConfirmModal` move to
`@sentry/scraps/confirm`. Default copy now comes from `useTranslation`
instead of `sentry/locale`. About 100 app callers change one import line
each. `require-render-prop-spread` exempts `@sentry/scraps/confirm`
because `Confirm`'s render prop passes `{open}`, not element props.

Package changes:

- Exports `./form`, `./form/formErrorContext`, and `./confirm`. Drops
`./formPresentation`.
- `@tanstack/react-query` and `zod` are peer dependencies and dev
dependencies. `@tanstack/react-pacer` is a dependency.

Stories, MDX docs, and the existing app-level specs stay in the app. The
specs use `sentry-test` helpers and now import from the package. No
visual or behavior changes are intended.

<!-- junior-request-attribution:start -->
via **nate**.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:slack%3AD0BA0V4G47K%3A1793981613.461909 -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/slack%3AD0BA0V4G47K%3A1793981613.461909)
[[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AD0BA0V4G47K%3A1793981613.461909/?project=4510944073809921)

<!-- junior-session-footer:end -->

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Nate Moore <[email protected]>
Co-authored-by: Nate Moore <[email protected]>

This branch was successfully deployed

1 active deployment
Preview — 8ef3be7d Deployed Nov 3, 2026 by vercel[bot]
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.

2 participants