Repository navigation
Conversation
Prettier-only pass over files that were not formatted on master, so the following fix! commits show only functional changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`maxLength` was typed `string` and parsed with `parseInt` before reaching the DOM. It is now `number`. Strings are still parsed at runtime, and the component now calls its check-props, which warns in development when `maxLength` is a string. Wiring check-props also enables its existing `assistiveText`/`label` checks. BREAKING CHANGE: TextareaProps `maxLength` is `number`; passing a string is a type error (it still works at runtime, with a development warning). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`NavigationItem` had `[key: string]: unknown`, so `icon` and `notificationBadge` were undeclared and cast at the point of use. They are now declared as `ReactElement<IconProps>` and `ReactElement<BadgeProps>`, and the casts in the item renderer are gone. BREAKING CHANGE: NavigationItem no longer accepts arbitrary keys; extra fields on items are a type error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`type: 'branch' | 'item' | string` collapsed to `string`, and `nodes`, `expanded` and `loading` were allowed on any node. `TreeNode` is now `TreeBranchNode | TreeItemNode`; only branches take children or expand. Both members are exported. The hashmap story data, which did not type-check, now uses a hashmap node type with child ids. BREAKING CHANGE: TreeNode `type` must be 'branch' or 'item', and `nodes`/`expanded`/`loading` are a type error on items. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`SplitViewHeaderProps` and `SplitViewListboxItem` had index signatures, so the header lost PageHeader's types and list items lost theirs. `SplitViewHeaderProps` now extends `PageHeaderProps`, and `SplitViewListbox<T>` carries the item type through `options`, `selection`, `unread`, the event data and `listItem`. BREAKING CHANGE: SplitViewHeader and SplitViewListboxItem no longer accept arbitrary keys; a `listItem` component must accept the same item type as `options`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`swatchColors` and `defaultSelectedTab` were accepted with any `variant` and silently ignored where they do not apply. `ColorPickerProps` is now base props plus `ColorPickerVariantProps`: `base` takes both, `swatches` takes `swatchColors` only, and `custom` takes neither. BREAKING CHANGE: ColorPickerProps is a type alias rather than an interface, so it can no longer be extended with `interface ... extends`; passing `defaultSelectedTab` to `swatches` or `custom`, or `swatchColors` to `custom`, is a type error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every prop was accepted with every `variant`. `WelcomeMatProps` is now base props plus `WelcomeMatVariantProps`: `steps` and `trailhead-connected` take tiles (only the latter takes `infoBadge`), `info-only` takes tiles and actions, and `splash` takes actions only. BREAKING CHANGE: WelcomeMatProps is a type alias rather than an interface; `steps`, `trailhead-connected` and `info-only` require children, `splash` rejects them, and props outside a variant are a type error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`MenuDropdownOption` allowed every field on every option type, and `leftIcon.category` was a plain string. Options are now `MenuDropdownItemOption | MenuDropdownHeaderOption | MenuDropdownDividerOption`, keyed on `type`; only headers take `divider`, dividers take no label, and icon categories are `IconCategory`. BREAKING CHANGE: MenuDropdownOption is a union; fields that do not apply to an option's `type` are a type error, and icon `category` must be an IconCategory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`ComboboxOption.type` was `'separator' | 'header' | 'footer' | 'deselect' | string`, which collapsed to `string`: item options reused `type` as a grouping key for `comboboxAddSubheadings`, so the structural rows could not be told apart from items, and labels were cast to `string` throughout. Options are now a union keyed on `type`: items (no `type`, string label, new `category` field), separators, header/footer actions and the deselect row. `comboboxAddSubheadings` groups by `category`, falling back to a legacy `type`, and check-props warns in development when an item uses a non-structural `type`. `onRenderMenuItem` receives only item or deselect rows, which is all it is ever called with. `ComboboxProps` is now base props plus `ComboboxVariantProps`: the listbox variants require `options`, and `popover` requires `popover` and `assistiveText.popoverLabel` and rejects `options`. Both rules were previously runtime warnings only. `comboboxFilter` threw on a separator whose label is a render function; it now only matches string labels. Examples, stories and tests move from `type: 'account'` to `category: 'account'`; rendered markup is unchanged. BREAKING CHANGE: item options use `category` instead of a non-structural `type` (still honored at runtime, with a development warning). ComboboxProps is a type alias rather than an interface; listbox variants require `options`, and the popover variant requires `popover` and `assistiveText.popoverLabel`. `onRenderMenuItem` and `menuItem` components receive `ComboboxItemOption | ComboboxDeselectOption`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The build tsconfig excludes `__tests__`, so the type-level regression tests (`@ts-expect-error` assertions on the v11 type contracts) get their own project, and `typecheck` runs it after the main check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Additional description
Breaking change (types only, before GA). Several prop and data types let invalid combinations through, mostly because a
| stringor an index signature widened them. This PR tightens them into discriminated unions and declared fields. Runtime behaviour is unchanged except for thecomboboxFilterfix below. Where old input still works at runtime, a development-only warning now points to the new form.maxLength: string, parsed withparseIntmaxLength: numberNavigationItemindex signature;icon/notificationBadgeundeclared and castReactElement<IconProps>/ReactElement<BadgeProps>; casts removedtype: 'branch' | 'item' | stringwidened tostring;nodesallowed on any nodeTreeNode = TreeBranchNode | TreeItemNodeSplitViewHeaderPropsandSplitViewListboxItemdropped the PageHeader and item typesPageHeaderProps;SplitViewListbox<T>carries the item type throughoptions,selection,unread, events andlistItemswatchColors/defaultSelectedTabaccepted with anyvariantand silently ignoredColorPickerVariantPropsunionvariantWelcomeMatVariantPropsunion: tiles vs. actions;infoBadgeonly ontrailhead-connectedtype;leftIcon.category: stringIconCategorytype: ... | stringwidened tostring. Items reusedtypeas thecomboboxAddSubheadingsgrouping key, so structural rows couldn't be told apart and labels were cast tostringtype: item (newcategoryfield, string label), separator, header/footer, deselectaddSubheadingsreadscategory ?? type; dev warning when an item has a non-structuraltypeoptionsrequired unless popover" and "popover needsassistiveText.popoverLabel" were runtime warnings onlyComboboxVariantProps: listbox variants requireoptions;popoverrequirespopover+popoverLabeland rejectsoptionsAlso in this PR
comboboxFilterthrew on a separator whose label is a render function. It now matches only string labels (regression test added).onRenderMenuItem/menuItemreceiveComboboxItemOption | ComboboxDeselectOption. That's the only data the menu ever passes them.type: 'account'tocategory: 'account'. Rendered markup is identical, so there are no snapshot changes.components/*/__tests__/*.type-test.tsx, using@ts-expect-errorassertions. They get their owntsconfig.type-tests.jsonbecause the build config excludes__tests__, andnpm run typechecknow runs both projects. I checked that each assertion fails for its intended reason.Migration
type: '<group>'tocategory: '<group>'.typeis now only'separator' | 'header' | 'footer' | 'deselect'.maxLength={100}, notmaxLength="100".type: 'branch'ortype: 'item'. Only branches takenodes/expanded/loading.ColorPickerProps,ComboboxPropsandWelcomeMatPropsare now type aliases, sointerface X extends ComboboxPropsno longer compiles. Usetype X = ComboboxProps & {...}. Nothing in this repo extends them.MenuDropdownPropsstays an interface becausebuilder-headerandtrial-barextend it.TreeBranchNode,TreeItemNode,ColorPickerVariantProps,WelcomeMatVariantProps,MenuDropdownItemOption/HeaderOption/DividerOption,ComboboxItemOption/SeparatorOption/ActionOption/DeselectOption,ComboboxVariantProps.Not in scope: the other parts of these ROADMAP checklist items (renames, controlled state, child contracts), so no checkboxes are ticked. Runtime warnings for tree, color-picker and welcome-mat were skipped because the runtime already ignores the invalid props.
CONTRIBUTOR checklist (do not remove)
Please complete for every pull request.
Green gate — all of these must pass locally (CI runs the same):
npm run lintpasses with 0 errors (npm run lint:fixto auto-fix). Warnings are the tracked gradual-migration backlog; do not add new errors. (223 warnings, same as master)npm run typecheckis clean (tsc --noEmit). Now also runs the type-test project.npm test -- --runpasses — this runs both Vitest projects (jsdomunit+ real-browserbrowser) and the story HTML snapshots. If you changed rendered markup on purpose, update snapshots withnpm test -- --run -uand review the diff. (1035/1035 with--update=none; no snapshot changes)npm run buildsucceeds (type-check + Vite library build +.d.ts+ entry shims).Behavior & docs:
components/button/__tests__). New props and bug fixes should get a regression test. Tests that genuinely need a real browser (focus traversal, layout/measurement, canvas) go in a*.browser.test.jsxfile (thebrowserproject); everything else is jsdom.npm run storybook→ http://localhost:6007/. Confirm the story actually renders and behaves (deprecated Storyshots/Karma are gone; there is no separate browser-tests server). (Not yet done; snapshots are unchanged)onRenderContent/onRenderVisualPicker,iconprops,events), not assumptions — a common source of "component looks broken" reports has been stories authored against the wrong API. Cross-check againstcomponents/<name>/__examples__. (The combobox, color-picker, menu-dropdown and tree stories now type-check against the new types).d.ts(they're generated by the build); JS consumers rely on them via editor type-acquisition.REVIEWER checklist (do not remove)
CIworkflow: lint, typecheck, test, build). Chromatic visual review, if configured, has been checked.components/__tests__/__snapshots__/story-snapshots.test.jsx.snap).@salesforce/design-system-react/components/<name>and nested paths resolve for ESM, CJS, and types). Removing/renaming a public component or export is a breaking change →feat!:/BREAKING CHANGE:and a major version bump.