Skip to content

feat!: v11 RC breaking changes (key values, package exports) - #3333

Merged
interactivellama merged 5 commits into
masterfrom
feat/v11-rc-breaking
Nov 18, 2026
Merged

interactivellama merged 5 commits into
masterfrom
feat/v11-rc-breaking

Conversation

@interactivellama

Copy link
Copy Markdown
Contributor

Fixes #

Additional description

RC breaking changes: merge this first, then cut 11.0.0-rc.0. This PR is outside the merge-train stacks and based on master. It pulls the train's two breaking changes forward so the RC carries every public-API break, and the remaining stacks can be rebased onto it as non-breaking cleanups.

Commits (moved from #3327 and #3328):

BREAKING CHANGE:

  • @salesforce/design-system-react/utilities/*, components/*/private/* and the check-props modules no longer resolve. This includes the utilities/hooks hooks (useClickOutside, useControllableState, useLatestRef). They were never public API. Migration: copy the helper you need, or use the platform equivalent (event.key instead of utilities/key-code).
  • utilities/key-code now exports KeyboardEvent.key strings instead of numeric codes, and utilities/keyboard-navigate and keyboard-navigable-dialog take key. After the change above this only affects consumers who deep-imported internals.

Conflicts resolved while moving: in types/common.ts the React type imports from both sides are merged. In CHANGELOG.md this PR carries the exported-types entry; the deprecated-lint docs entry stays with #3311.

npm run test:ci is green locally: 1650 tests, typecheck, build, and lint with 0 errors (warnings are the tracked backlog).


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 lint passes with 0 errors (npm run lint:fix to auto-fix). Warnings are the tracked gradual-migration backlog; do not add new errors.
  • npm run typecheck is clean (tsc --noEmit).
  • npm test -- --run passes — this runs both Vitest projects (jsdom unit + real-browser browser) and the story HTML snapshots. If you changed rendered markup on purpose, update snapshots with npm test -- --run -u and review the diff.
  • npm run build succeeds (type-check + Vite library build + .d.ts + entry shims).

Behavior & docs:

  • First-time contributors: sign the CLA (a bot will comment with instructions).
  • Added/updated Vitest + React Testing Library tests for the change (template: 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.jsx file (the browser project); everything else is jsdom.
  • Reviewed the component's Storybook stories: 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).
  • Story/example code uses the component's real prop API (e.g. slots like content / visualPickerFigure, render props like renderItem, icon props, events), not assumptions — a common source of "component looks broken" reports has been stories authored against the wrong API. Cross-check against components/<name>/__examples__.
  • Storybook Accessibility (a11y) panel shows no new violations for the affected stories.
  • If you added or changed a type, remember runtime PropTypes were removed in the TS migration — types are the contract. Ship accurate .d.ts (they're generated by the build); JS consumers rely on them via editor type-acquisition.

REVIEWER checklist (do not remove)

  • CI is green (GitHub Actions CI workflow: lint, typecheck, test, build). Chromatic visual review, if configured, has been checked.
  • Change has adequate test coverage; bug fixes include a regression test.
  • Reviewed the affected Storybook stories and their a11y panels.
  • Rendered markup still conforms to SLDS — check the story HTML snapshot diff (components/__tests__/__snapshots__/story-snapshots.test.jsx.snap).
  • Public API / package surface: if exports changed, the deep-import contract still holds (@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.

@interactivellama
interactivellama changed the base branch from master to feat/v11-asks-1-release-policy November 17, 2026 22:47
@interactivellama
interactivellama removed this pull request from stack #3335 November 17, 2026 23:49
@interactivellama
interactivellama removed this pull request from stack #3336 November 18, 2026 00:38
@interactivellama interactivellama added this to the 11.0.0-rc.0 milestone Nov 18, 2026
@interactivellama
interactivellama removed this pull request from stack #3337 November 18, 2026 00:49
Base automatically changed from feat/v11-asks-1-release-policy to master November 18, 2026 19:16
Comment thread package.json
"require": "./dist/cjs/utilities/*.cjs",
"default": "./dist/es/utilities/*.js"
},
"./components/*check-props": null,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Would it be possible to regex for private like ./**/**/private/*?

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.

Good catch! Updated.

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.

My understanding is that we can't ** in node packages and only *

keyCode, which and charCode are deprecated DOM APIs. Keyboard handling across
components now reads event.key, and the key-code utilities hold key values.

Radio listened to the deprecated keypress event and selected on any key when
unchecked. It now listens to keydown and selects only on Space or Enter.

Unlike keyCode (229), event.key reports 'Enter' for the keydown that commits
an IME composition, so mapKeyEventCallbacks and Search's Enter handler now
skip composing keys (EventUtil.isComposing).

BREAKING CHANGE: utilities/key-code exports KeyboardEvent.key strings
('Enter', 'ArrowDown', ...) instead of numeric key codes, and keyObjects
entries carry only `key`. utilities/keyboard-navigate and
utilities/keyboard-navigable-dialog take `key` instead of `keyCode`.
Every type that a public component's props refer to is now declared in a
public file and can be named from a public entry point, so consumers don't
need a deep import into `utilities/` or a `private/` folder:

- `TriggerRender` moves to `types/common` and is exported from the root,
  `components/tooltip` and `components/menu-dropdown`.
- `ChildrenOf` and `IconCategory` are exported from the root, and
  `IconCategory` from `components/icon`.
- The combobox option types move from `private/menu` to a new
  `components/combobox/types.ts`. `components/combobox` now also exports
  `ComboboxOptionIcon`, `ComboboxOptionLabelRenderer`,
  `ComboboxActionOptionFields` and `ComboboxMenuRenderMenuItemData` (renamed
  from the private `MenuRenderMenuItemData`).
- `CarouselItemProps` moves to `components/carousel/types.ts`,
  `SplitViewListItem` to `components/split-view/types.ts`, and the props of
  page-header's legacy `Info`, `Title`, `DetailRow` and `DetailBlock` exports
  to `components/page-header/types.ts`. They are exported from
  `components/carousel`, `split-view/listbox` and `components/page-header`.
  The private implementation files import them from there.

The root barrel becomes `components/index.ts` so it can export types. Its
shipped declarations were already generated from `index.js`; the unused
hand-written `components/index.d.ts` (which had drifted from it) and the
ambient `components/settings.d.ts` are removed.
The `exports` map no longer publishes internals:

- `./utilities/*` is removed.
- Every `components/**/private` folder and everything under it, and every
  `check-props` module, map to `null`, so `import` and `require` throw
  `ERR_PACKAGE_PATH_NOT_EXPORTED` and TypeScript can't resolve them. One
  `./components/*/private` pattern blocks every folder (it ties
  `./components/*` on prefix and wins on length), but the files under each
  `private` folder need their own `./components/<path>/private/*` key: an
  exports key allows a single `*`, and Node ignores a key with two.

The build follows suit. `utilities/*/index` is no longer a Vite entry, the
entry shims are generated only for `components/` and skip `private/` folders,
and `build:types` prunes every internal `.d.ts` that no public declaration
imports (`scripts/prune-internal-types.ts`). Eight stay because public
declarations import them by relative path for value exports or class state
(`utilities/constants`, `utilities/log`, page-header's legacy subcomponents,
split-view's list-item HOC and simple-data-table's mode); they are not in
`exports`, so they are not entry points.

BREAKING CHANGE: `@salesforce/design-system-react/utilities/*` and
`@salesforce/design-system-react/components/*/private/*` (and the
`check-props` modules) no longer resolve. They were never public API. Copy
the helper you need, or use the platform equivalent (`event.key` instead of
`utilities/key-code`). This includes the `utilities/hooks` hooks
(`useClickOutside`, `useControllableState`, `useLatestRef`), which are
internal.
`check-package-exports` no longer treats `utilities/<name>` as an entry point
and adds two checks against the built package:

- Negative: every module under `utilities/`, every module and folder under a
  `private/` folder in `components/`, and every `check-props` module must
  fail to resolve for types (`bundler` and `node16`, `import` and `require`
  conditions), and `import()`/`require()` must throw
  `ERR_PACKAGE_PATH_NOT_EXPORTED`.
- Type surface: every type a public value export's signature refers to, and
  every type-only export of a public entry point, must be declared in a
  public file, not under `utilities/` or a `private/` folder. A shared type
  declared in `types/` must also be exported by name from a public entry
  point.
- CHANGELOG: a BREAKING entry for the `exports` change, with the 0.10.x
  deep imports most likely in use and how to migrate; the `utilities/hooks`
  hooks are no longer listed as added public API; the newly exported prop
  types are listed under Added.
- codebase-overview: state the public-surface rule next to the folder
  structure, add entry points to the breaking-change taxonomy, and note that
  `exports` now enforces the `private/` boundary for consumers.
- CONTRIBUTING: the root barrel is `components/index.ts`, with generated
  types.
@interactivellama
interactivellama merged commit 7e904c6 into master Nov 18, 2026
6 checks passed
@interactivellama
interactivellama deleted the feat/v11-rc-breaking branch November 18, 2026 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants