Skip to content

Upgrade to TypeScript 6#11268

Draft
nbudin wants to merge 13 commits intomainfrom
upgrade-typescript-6
Draft

Upgrade to TypeScript 6#11268
nbudin wants to merge 13 commits intomainfrom
upgrade-typescript-6

Conversation

@nbudin
Copy link
Copy Markdown
Contributor

@nbudin nbudin commented Apr 8, 2026

Summary

  • Upgrades the project to TypeScript 6 and fixes all resulting type errors
  • TypeScript 6 introduces stricter variance checking for generic type parameters, which surfaced a large number of type issues across the codebase

Key changes

  • React Select: Fix SingleValue/MultiValue component generic type constraints
  • TanStack Table: Fix ColumnDef variance and DateTime nullable comparator errors
  • FormAdmin: Fix property setter variance, form item editor types, and React Compiler dependency array
  • Permissions system: Add function overloads to PermissionsTableInput; cast useChangeSet add functions throughout
  • Form/Event components: Widen form_response_attrs callback parameter types to handle contravariance
  • Store/TicketTypeAdmin: Fix Dispatch<SetStateAction> variance; materialize functional updates in buildScheduledMoneyValueInput
  • GraphQL selects: Change TypedDocumentNode constraint to TypedDocumentNode<any, any> to handle TypeScript 6's proper variance checking of phantom type parameters
  • parsePageContent: Fix ProcessingInstruction<T> contravariance; fix reduce accumulator types
  • SignupAdmin route: Remove required prop from route component (must be ComponentType<{}>)
  • Various: Fix ProgressEvent type parameters, memo'd generic callback casts, reduce generics, flatMap with Set

Test plan

  • TypeScript compiles with zero errors (yarn run tsc --noEmit)
  • ESLint passes on all changed files
  • Manual smoke test of key areas: form editor, store/products, permissions admin, signup admin

🤖 Generated with Claude Code

@nbudin nbudin added enhancement minor Bumps the minor version number on release labels Apr 8, 2026
function EditSignup(): React.JSX.Element {
const data = useSingleSignupLoader();
const { eventId } = useParams();
const teamMembersUrl = `/events/${eventId}/team_members`;
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.

⚠️ [eslint] <i18next/no-literal-string> reported by reviewdog 🐶
disallow literal string: teamMembersUrl = /events/${eventId}/team_members

nbudin and others added 12 commits April 8, 2026 12:09
Handle null from SingleValue<T> (isClearable selects) and readonly
from MultiValue<T> across all affected components. For non-nullable
GraphQL fields (defaultLayout, rootPage), guard against null with
short-circuit evaluation since the API would reject null values anyway.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
TypeScript now types catch clause variables as unknown. Fix by using
instanceof guards, as-casts where the throw source guarantees Error
objects (Apollo mutations), and widening parseResponseErrors to accept
unknown instead of Error.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…r errors

ColumnDef<TData, TValue> has invariant TValue in TypeScript 6, so mixed arrays
must be typed as ColumnDef<T, any>[]. Also fix Timespan comparators to accept
nullable DateTime values.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add ambient module declaration for vite/modulepreload-polyfill (TS2882)
- Fix ColumnReservationSet properties initialized via clear() method (TS2564)
- Fix ScheduledValueTimespanRow valueChanged callback to accept undefined (TS2345)
- Fix setupI18Next formatter lng param to accept undefined (TS2345)
- Fix useAsyncFetcher resolve cast to match ref type (TS2322)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Use `as` casts with `typeof formItem` switch narrowing to handle
stricter Dispatch<SetStateAction<T>> variance in TypeScript 6.
Update formItemPropertyUpdater to accept Dispatch<SetStateAction<T>>.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add function overloads to PermissionsTableInput to fix JSX component usage
- Cast `add` function from useChangeSet to UsePermissionsChangeSetOptions type
  in CmsContentGroupFormFields, EditCmsContentGroup, NewCmsContentGroup,
  EditStaffPositionPermissions, and useOrganizationRoleForm

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Cast ObjectDiffDisplay before/after props in FormItemChangeDisplay
- Fix isValueOther type predicate in MultipleChoiceItemDisplay
- Fix run and onChange types in EditRunModal
- Widen newResponseValues parameter types in useEventForm,
  EventProposalForm, UserConProfileForm, and MyProfileForm

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Fix buildScheduledMoneyValueInput to materialize functional updates
  instead of forwarding SetStateAction (fixes PricingStructureForm)
- Fix EditPricingStructureModal local type to use NonNullable to avoid
  null in useState type, removing redundant cast
- Use PricingStructureFormProps/PricingStructureModalState as cast targets
  in EditProductForm and PricingStructureInput
- Fix AdminProductVariantsTable onChange type to accept SetStateAction
- Fix AdminOrderEntriesTable ProductSelect onChange cast
- Fix CouponForm MoneyInput onChange to handle functional updates
- Cast setProduct and setTicketType in EditTicketProvidingProductModal
  and EditTicketType

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Fix AuthenticityTokensContext key indexing
- Fix FileUploadForm ProgressEvent type parameter
- Cast memo'd generic callbacks in ScheduledValuePreview
- Cast DataModeApplicationEntry as ComponentType<unknown> in application.tsx
- Fix UserActivityAlerts notification destination cast types
- Cast setLanguage in ConventionFormGeneralSection and NewConventionModal
- Cast onChange in EventListFilterableFormItemDropdown
- Fix StaffPositionsTable reduce type to use generic parameter
- Spread Set to array in ReactTableExportButtonWithColumnTransform
- Cast setFormState in EditUser

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Change GraphQLAsyncSelect/UserConProfileSelectProps constraint to
  TypedDocumentNode<any, any> to handle TypeScript 6 variance checking
  of phantom type parameters (needed to bypass the contravariant
  TVariables check that bare TypedDocumentNode introduces)
- Cast DevModeGraphiql fetcher to resolve Observable type mismatch
- Fix parsePageContent reduce accumulator type to include CSSProperties,
  cast processNode callbacks and AUTHENTICATION_LINK_PROCESSING_INSTRUCTIONS
  to avoid contravariant ProcessingInstruction<T> errors

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove required teamMembersUrl prop from EditSignup and derive the URL
internally from useParams, allowing the component to be used as a
route Component (which requires ComponentType<{}>)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@nbudin nbudin force-pushed the upgrade-typescript-6 branch from 2aed159 to 248ce09 Compare April 8, 2026 19:09

useEffect(() => {
if (navigation.state === 'idle' && actionData != null && !error) {
// eslint-disable-next-line react-hooks/set-state-in-effect
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Return to this, see if we can eliminate it

}, [client]);

useEffect(() => {
// eslint-disable-next-line react-hooks/set-state-in-effect
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revisit this to see if we can remove it

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

Code Coverage Report: Only Changed Files listed

Package Base Coverage New Coverage Difference
app/javascript/TimeUtils.ts 🟠 56.86% 🟠 58.49% 🟢 1.63%
Overall Coverage 🟢 53.11% 🟢 53.09% 🔴 -0.02%

Minimum allowed coverage is 0%, this run produced 53.09%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement minor Bumps the minor version number on release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant