Repository navigation
feat!: rename v11 labels, assistiveText and onRender* slot props - #3257
Merged
Merged
Conversation
Niznikr
force-pushed
the
feat/v11-labels-naming
branch
from
October 28, 2026 20:07
98901a7 to
b754f30
Compare
interactivellama
previously approved these changes
Oct 29, 2026
Contributor
|
I love the element, render and slot categories. Well thought out! |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Theme 7 of the v11 prop API freeze review. Old names keep working and emit a dev-only deprecation warning through each component's check-props. - split-view: assistiveText.toggleButtonOpen/toggleButtonClose (inverted) -> closeToggle/openToggle - tree: heading and assistiveText.label -> labels.heading and assistiveText.heading - trial-bar: labels.timeLeftUnit + timeLeftUnitAfter -> a single labels.timeLeftAfter; onRenderActions -> actions - slider, textarea: label -> labels.label; errorText -> labels.error + hasError - zero-argument onRender* thunks -> ReactNode slots: page-header actions/controls, builder-header toolbar actions, welcome-mat infoActions, info-badge completeActions, setup-assistant step action/content/figure, progress-indicator steps[].setupAssistantAction, checkbox/radio visualPickerFigure* Also wires the previously unused check-props for textarea and page-header, and exposes the setup-assistant step fields on the public ProgressStep type. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Render props that take data keep the onRender prefix; zero-argument content is a named ReactNode slot. Co-Authored-By: Claude Opus 5.5 <[email protected]>
`on*` names are now reserved for events. Render props that take data
follow React Aria and Base UI: `render<Part>: (data) => ReactNode`,
called with one data object (`is*` state names) rather than mounted as
a component. Static content stays a `ReactNode` slot (shadcn/Radix).
- Carousel `onRenderItem` -> `renderItem({ item })`
- Combobox `onRenderMenuItem` / `menuItem` (components) ->
`renderMenuItem({ assistiveText, isSelected, option })`
- SimpleDataTable `onRenderSubHeadingRow` -> `renderSubHeadingRow`
(no `key`; the table keys the row)
- MenuDropdown `listItemRenderer` (component) ->
`renderMenuItem({ icon, isSelected, option, optionIndex })`
- SplitViewListbox `listItem` (component) ->
`renderListItem({ isFocused, isSelected, isUnread, item })`
The old props keep working, warn once through check-props, and are
ignored when the new prop is passed. Examples and stories use the new
props. Updates the Props Conventions doc, PR template, ROADMAP and
CHANGELOG (including the theme 7 slot renames from the previous commit).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Content that a component only renders is now `ReactNode`, matching the slots and render props: SplitView `master`/`detail`, PageHeader `trail`, TabsPanel `label`, SetupAssistantStep `figure`, and the return types of the deprecated Carousel `onRenderItem`, SetupAssistantStep `onRenderFigure` and MenuDropdown `listItemRenderer`. SetupAssistantStep checks `isValidElement` before resizing an `Icon` figure. `ReactElement` stays on element props, which the component clones or reads props from (Combobox `input`/`popover`, File `icon`, etc.). The Props Conventions doc now names that third category. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Niznikr
force-pushed
the
feat/v11-labels-naming
branch
from
October 29, 2026 21:09
b754f30 to
8d78a10
Compare
interactivellama
approved these changes
Oct 29, 2026
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
Renames props that break the v11 naming rules. Every old name keeps working: it logs a one-time warning through
check-props.jsand is ignored when the new name is passed. Nothing here is breaking, and the story HTML snapshots are unchanged, so rendered markup is the same.Naming (now in
docs/codebase-overview.md→ Callback Details)on*names are for events only.onRender*reads as "a callback that runs after render", which these props were not. Content props now follow shadcn/Radix for slots and React Aria/Base UI for render props.Every public content prop is one of three kinds. All 18 remaining
onRender*props are marked@deprecatedand point to their replacement.ReactNodeactions,content,figure,visualPickerFigure*render<Part>: (data) => ReactNoderenderItem,renderMenuItem,renderSubHeadingRow,renderListItemReactElement<XProps>input/popover, DatePickerinput, Fileicon, InputfieldLevelHelpTooltip, PageHeader and ScopedNotificationiconA render prop takes one data object with
is*names for state, and the component calls it rather than mounting it as a component. Each data type is named<Component>Render<Part>Dataand exported with that component's other types. The component keeps the element that carries roles, ARIA, focus andkey, and the render prop returns what goes inside it. Table rows are the one exception:renderSubHeadingRowreturns the<tr>.ReactElement vs ReactNode
Every render prop already returned
ReactNode. Eight props that are only rendered were still typedReactElement, so they are nowReactNode:SplitViewmaster/detail,PageHeadertrail,TabsPanellabel, andSetupAssistantStepfigure.SetupAssistantStepstill shrinks anIconfigure tosmall; it now checks the figure is an element first.CarouselonRenderItem,SetupAssistantSteponRenderFigureandMenuDropdownlistItemRenderer.This only widens what the types accept, so existing consumer code still type-checks. The element props in the table stay
ReactElement: the component clones them or reads their props, so a string or fragment wouldn't work.Labels and assistiveText
assistiveText.toggleButtonOpen/toggleButtonClose(inverted)assistiveText.closeToggle/openToggleheading,assistiveText.labellabels.heading,assistiveText.headinglabels.timeLeftUnit,labels.timeLeftUnitAfterlabels.timeLeftAfterlabel,errorTextlabels.label,labels.error+hasErrorZero-argument
onRender*→ slotsonRenderActions,onRenderControlsactions,controlsonRenderActionsactionsonRenderInfoActionsinfoActionsonCompleteRenderActionscompleteActionsonRenderAction,onRenderContent,onRenderFigureaction,content,figuresteps[].onRenderSetupAssistantActionsteps[].setupAssistantActiononRenderVisualPicker*visualPickerFigure*Data render props →
render<Part>(data)onRenderItemrenderItem({ item })onRenderMenuItem,menuItem(component)renderMenuItem({ assistiveText, isSelected, option }), whereselectedbecomesisSelectedonRenderSubHeadingRowrenderSubHeadingRow(data), same data withoutkey; the table sets the row keylistItemRenderer(component)renderMenuItem({ icon, isSelected, option, optionIndex })listItem(component)renderListItem({ isFocused, isSelected, isUnread, item })Consumers who passed a component write
renderMenuItem={(data) => <MyItem {...data} />}.Commits
style:formatting of the touched files only (prettier line wrapping and blank lines, 21 files). Review this one separately or skip it.feat:labels, assistiveText and slot renamesdocs:convention write-up, ROADMAP theme 7 progress, PR template examplefeat:data render props →render<Part>(data)fix(types):ReactNodewideningExamples and stories use the new names. CHANGELOG
Unreleasedlists every rename under Deprecated, and the widening under Changed.Tests
52 new tests. Each rename is covered three ways: the new prop works, the old prop still works and warns, and the new prop wins when both are passed. Render props also check the exact data object. The full suite passes: 56 files, 1220 tests.
Still open (theme 7)
errorTexton Input, Checkbox and ComboboxCONTRIBUTOR 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.npm run typecheckis clean (tsc --noEmit).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.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).content/visualPickerFigure, render props likerenderItem,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__..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.