Repository navigation
NumberForm foundation 4: deprecate NumberWithSymbolForm, add eslint guard and migration guide #98172
Description
Sub-issue of #97970.
Migration plan: jmgraa comment.
The composition API is usable after #98171. This issue closes the door on the old one: it marks NumberWithSymbolForm deprecated, adds a lint guard so no new usages can land while migration is in flight, and writes the migration guide the five migration batches work from.
This is the gate. The migration batches #98173 to #98177 all unblock when this lands.
Scope
- Step: 4 of the migration plan
- Scope: deprecation markers, 1 eslint rule, 1 seatbelt baseline, 1 guide
Files
src/components/NumberWithSymbolForm.tsx—@deprecatedon the component and its exported typesconfig/eslint/eslint.config.mjs—no-restricted-importsconfig/eslint/eslint.seatbelt.tsv— baseline for the 14 files that import it todaycontributingGuides/— the migration guide
Deprecation guard
The migration plan has no guard, so new NumberWithSymbolForm call sites can land mid migration and silently extend the work. The Button decomposition solved this in its first batch and the same shape applies here:
- Add
no-restricted-importsfor@components/NumberWithSymbolFormwithimportNames: ['default']only, soNumberWithSymbolFormPropsandNumberWithSymbolFormRefstay importable while the type only call sites migrate. - Seed the existing usage baseline into
config/eslint/eslint.seatbelt.tsv. Current importers, verified onmain:
src/components/AmountForm.tsx
src/components/Form/types.ts
src/components/MoneyRequestAmountInput.tsx
src/components/MoneyRequestConfirmationList/sections/AmountField.tsx
src/components/MoneyRequestConfirmationList/sections/TaxFields.tsx
src/pages/ChronosScheduleOOOPage.tsx
src/pages/iou/MoneyRequestAmountForm.tsx
src/pages/iou/request/step/DistanceManualTabContent.tsx
src/pages/iou/request/step/IOURequestStepDistance.tsx
src/pages/iou/request/step/IOURequestStepDistanceManual.tsx
src/pages/iou/request/step/IOURequestStepHours.tsx
src/pages/workspace/taxes/ValuePage.tsx
src/pages/workspace/taxes/WorkspaceCreateTaxValuePage.tsx
src/stories/NumberWithSymbolForm.stories.tsx
Also note config/eslint/eslint.seatbelt.tsv:275-276, which grandfathers one @typescript-eslint/no-unsafe-type-assertion and two react-hooks/set-state-in-effect against the component path. Those rows retire in #98178 together with the file.
Migration guide contents
- V1 prop to composition mapping. One table, every public prop, mapping to a primitive, a root prop, or nothing.
- Dead props map to nothing. Say so explicitly so nobody tries to preserve them:
onChangeAmount— accepted publicly but overridden internally at line 584. TheOmiton the props type lists'onAmountChange', which is a typo and therefore a no-op, which is why the prop is still visible.selection— caller value ignoredrightHandSideComponent— caller value ignored, computed internally at line 576prefixStyle— hardcoded tostyles.colorMutedin thedisplayAsTextInputpath at line 562, forwarded in the other twoshouldAllowFocusInLandscapeMode— hardcodedtrueat line 632- In the
displayAsTextInputpath roughly 32 of the public props have no effect at all, and the type signature does not say so.
- Direct composition examples, one per shape found in the call sites: currency amount, unit suffix, plain text input,
Formregistered input. - Preset policy. Presets such as
NumberFormDistanceare not built ahead of time. Add one in the same PR as the first call site that needs the repeated pattern, and only when composing inline would otherwise copy the same structure. - Verification expected per migrated call site. At minimum: the ref contract still works, both orientations render, touch and non touch both render, and the screen's own tests pass.
Out of scope
Acceptance criteria
-
@deprecatedonNumberWithSymbolForm,NumberWithSymbolFormPropsandNumberWithSymbolFormRef -
no-restricted-importsblocks new default imports of@components/NumberWithSymbolForm - The type exports stay importable, so type only call sites can migrate later
- Seatbelt baseline seeded for all 14 files listed above
- Migration guide published with the prop mapping table, the dead prop list, one example per call site shape, the preset policy, and the per site verification checklist
- Lint passes on
mainwith the guard in place and no new violations - Verify that no errors appear in the JS console
Activity
melvin-bot commentedon Sep 2, 2026
This issue has not been updated in over 15 days. @mountiny, @bernhardoj, @jmgraa eroding to Monthly issue.
P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!