Skip to content

ref(scraps): Move the form system into the package - #130251

Merged
natemoo-re merged 2 commits into
masterfrom
ref/scraps-move-form-into-package
Nov 9, 2026
Merged

natemoo-re merged 2 commits into
masterfrom
ref/scraps-move-form-into-package

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

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.

via nate.

--

View Session [Sentry]

Moves the rest of `static/app/components/core/form` into
`@sentry/scraps/form` and folds `@sentry/scraps/formPresentation` back
into it. The split existed because Select, CompactSelect, and the modal
still lived in the app; those have since been extracted.

The three remaining app couplings are replaced:

- `BaseField` reads the location hash from `useOverlayContext()`, which
  the app already fills from the router, instead of `useLocation`.
- `FieldGroup` renders its own panel styles instead of the app's
  `Panel`/`PanelHeader`.
- `Confirm`/`openConfirmModal` move to `@sentry/scraps/confirm`, using
  `useTranslation` for default copy. App callers import the package.

Stories and the existing app-level specs stay in the app.

Co-Authored-By: Nate Moore <nate.moore@sentry.io>
@sentry-junior
sentry-junior Bot requested review from a team as code owners November 6, 2026 16:35
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

@natemoo-re
natemoo-re enabled auto-merge (squash) November 9, 2026 16:13
@mchen-sentry mchen-sentry added the Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests label Nov 9, 2026
@natemoo-re
natemoo-re merged commit eeb2a21 into master Nov 9, 2026
98 checks passed
@natemoo-re
natemoo-re deleted the ref/scraps-move-form-into-package branch November 9, 2026 17:33
@linear-code

linear-code Bot commented Nov 9, 2026

Copy link
Copy Markdown

DE-1752

sentry-junior Bot added a commit that referenced this pull request Nov 9, 2026
master moved Confirm into the scraps package (#130251), and CI builds this
stack merged with master.
sentry-junior Bot added a commit that referenced this pull request Nov 9, 2026
master moved Confirm into the scraps package (#130251), and CI builds this
stack merged with master.

This branch was successfully deployed

1 active deployment
Preview — a4da2c12 Deployed Nov 9, 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 Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants