Skip to content

docs: require JSDoc on every public prop - #3314

Draft
interactivellama wants to merge 108 commits into
masterfrom
feat/v11-llm-3-prop-jsdoc
Draft

interactivellama wants to merge 108 commits into
masterfrom
feat/v11-llm-3-prop-jsdoc

Conversation

@interactivellama

@interactivellama interactivellama commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Replaces #3310, which GitHub closed as merged into its old stack base when the stack was reordered onto master.

Part of the v11 docs stack (1 of 3, stack #3316). Base: master. Merge last: this stack merges after the clean CI and GA requirements stacks, so it documents the final API.

Additional description

The generated LLM docs (#3308) and editor tooltips are only as good as the prop JSDoc. This PR makes JSDoc a checked requirement:

  • scripts/check-prop-docs.ts (npm run check:prop-docs, run in test:ci after build) walks every public props type in dist/types and fails on any prop without JSDoc. It also fails on a deprecated prop that lacks a @deprecated tag. Nested labels and assistiveText members count. Props inherited from @types/react are skipped. It has tests in scripts/__tests__/check-prop-docs.test.mjs.
  • 25 docs(<component>) commits document the props it found: labels/assistiveText members and their English defaults, disabled/readOnly branches of union props, trigger props, and the untagged date-picker deprecations. One style(progress-ring) commit has prettier's blank-line cleanup on its own.
  • The check started with an allowlist of 96 undocumented props and 4 untagged deprecations. It ends with none, and the allowlist is deleted.

No runtime or markup changes; only comments and the check.


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 removed this pull request from stack #3315 November 16, 2026 05:53
@interactivellama interactivellama added this to the 11.0.0-rc.1 milestone Nov 18, 2026
@interactivellama
interactivellama force-pushed the feat/v11-llm-3-prop-jsdoc branch from e6dd1ae to 9aaff38 Compare November 18, 2026 23:29
@interactivellama
interactivellama removed this pull request from stack #3316 November 18, 2026 23:30
@interactivellama
interactivellama changed the base branch from master to chore/remove-legacy-icons November 18, 2026 23:30
Base automatically changed from chore/remove-legacy-icons to master November 19, 2026 04:41
@interactivellama
interactivellama force-pushed the feat/v11-llm-3-prop-jsdoc branch from 9aaff38 to e2b678e Compare November 19, 2026 04:41
@interactivellama
interactivellama removed this pull request from stack #3344 November 19, 2026 04:42
@interactivellama
interactivellama changed the base branch from master to fix/v11-slds2-css-fixes November 19, 2026 04:42
@interactivellama
interactivellama removed this pull request from stack #3346 November 19, 2026 22:05
@interactivellama
interactivellama force-pushed the feat/v11-llm-3-prop-jsdoc branch from e2b678e to 3458526 Compare November 19, 2026 22:07
@interactivellama
interactivellama force-pushed the feat/v11-llm-3-prop-jsdoc branch from 3458526 to 98c8a03 Compare November 20, 2026 00:14
@interactivellama
interactivellama removed this pull request from stack #3348 November 20, 2026 00:23
@interactivellama
interactivellama force-pushed the feat/v11-llm-3-prop-jsdoc branch 4 times, most recently from b7ea241 to f4bed68 Compare November 20, 2026 23:51
ColorPicker, Combobox, DatePicker and Tooltip kept their generated id
in useRef(generateId()) and read .current during render, which the
react-hooks/refs rule reports. They now use React's useId: the id is
stable for the life of the component, needs no ref or state, and
matches between server render and hydration. An id prop still takes
precedence.

Since React 19.2, useId returns ids such as `_r_1_`, which are valid
CSS identifiers, so Tooltip's anchored-nubbin rule still matches them.
getAnchoredNubbinStyles called triggerRef.current.getBoundingClientRect()
during render. The trigger is now measured in a layout effect when an
anchored-nubbin tooltip opens or its align changes, and the size is
kept in state. The effect runs before paint, so the nubbin is placed
on open with no visible jump. A trigger that resizes while the tooltip
stays open keeps its offset until the next open.

The new test stubs the trigger at 40x20 and checks the bottom-aligned
nubbin sits at 20px/20px. It passes before and after the change; it
pins the positioning that jsdom's zero-size layout never exercised.
- Walk a type separately as a props type and as a labels type, so a props
  type first reached through another type's `labels` still has its own
  `labels` and `assistiveText` checked, whatever the export order.
- Require `@deprecated` on every declaration of a deprecated prop, not just
  on some prop of that name in the component, and key each
  `components/utilities/<name>` on its own instead of sharing one bucket.
- Create the test fixture's React types symlink with `fs.symlinkSync`, so a
  failure throws instead of leaving `React` unresolved.
Add the CHANGELOG line (JSDoc only, no type or runtime change) and the
ROADMAP note for the prop docs check.
PageHeaderDetailRowProps became public when master exported the types used
in public prop signatures, so check-prop-docs now covers its undocumented
children.
@interactivellama
interactivellama force-pushed the feat/v11-llm-3-prop-jsdoc branch from 028e97e to 8f42042 Compare November 24, 2026 00:04
Base automatically changed from chore/release-11.0.0-rc.1 to master November 24, 2026 21:45

This branch has not been deployed

No deployments
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.

1 participant