Skip to content

[docs] Fix style prop docs generation#4406

Merged
mj12albert merged 4 commits intomui:masterfrom
mj12albert:docs/fix-style-prop-description
Mar 29, 2026
Merged

[docs] Fix style prop docs generation#4406
mj12albert merged 4 commits intomui:masterfrom
mj12albert:docs/fix-style-prop-description

Conversation

@mj12albert
Copy link
Copy Markdown
Member

@mj12albert mj12albert commented Mar 20, 2026

In BaseUIComponentProps, style isn't omitted like className even though we redeclared it:

'className' | 'color' | 'defaultValue' | 'defaultChecked'

It should also be excluded from elementProps like className when passing to useRenderElement

Though this doesn't seem to cause any actual type errors but in the docs the description is missing:

Screenshot 2026-03-21 at 5 00 29 AM

@mj12albert mj12albert added the docs Improvements or additions to the documentation. label Mar 20, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Mar 20, 2026

commit: b5f85c0

@mui-bot
Copy link
Copy Markdown

mui-bot commented Mar 20, 2026

Bundle size report

Bundle Parsed size Gzip size
@base-ui/react 🔺+1.69KB(+0.37%) 🔺+490B(+0.34%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 20, 2026

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit b5f85c0
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/69c87804a5fc6500081f0453
😎 Deploy Preview https://deploy-preview-4406--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@mj12albert mj12albert force-pushed the docs/fix-style-prop-description branch from 85b32e1 to ae12cd9 Compare March 20, 2026 20:50
@mj12albert mj12albert changed the title [docs] Fix style prop docs generation [docs] Fix style prop docs generation Mar 20, 2026
@mj12albert mj12albert marked this pull request as ready for review March 20, 2026 21:26
@atomiks
Copy link
Copy Markdown
Contributor

atomiks commented Mar 21, 2026

Codex Review (GPT-5.4)

1. Bugs / Issues (None)

No concrete correctness bug stood out in the final branch diff.

No blocking issues found in this patch.

2. Pattern Consistency Assessment

Aspect Consistent? Notes
Central prop-model change Yes Moving the style docs fix into the shared BaseUIComponentProps contract is the right center of gravity for the change
Generated reference output Yes The generated API files now consistently describe style instead of leaving it blank
Composite follow-up Yes The fix composites commit restores style forwarding in the internal composite path and applies it consistently at the touched call sites

3. Simplification Opportunities

No meaningful simplification change stands out here. The large file count is mostly generated or mechanical churn driven by a small central typing/docs fix.

4. Edge Cases Worth Noting

Edge Case Status
Function-valued style prop in generated docs Handled
Composite-backed wrappers after destructuring style Handled by follow-up
Slider experiment spreading a function-valued style prop Handled

5. Test Coverage Assessment

Strengths:

  • Ran pnpm test:jsdom useRenderElement --no-watch; it passed.
  • Ran pnpm test:jsdom RadioGroup --no-watch; it passed.
  • The generated JSON and snapshot deltas line up with the intended docs output change.

Gaps:

  • One focused regression test in useRenderElement.test.tsx would make this stronger: pass style as a function and verify the callback is resolved to a style object rather than leaking a raw function into the DOM, since that is the shared contract this patch is formalizing.

Merge Confidence Score

Dimension Score Notes
Docs-generation correctness 4/5 The central type change and generated output look internally consistent
Regression risk 3/5 The broad mechanical churn and follow-up composite fix raise the value of one targeted regression test
Verification 4/5 Targeted utility and component tests passed

Overall merge confidence is 4/5. This looks safe to merge, and one small composite-style regression test would make the follow-up fix more durable.

@mj12albert mj12albert changed the title [docs] Fix style prop docs generation [docs] Fix style prop docs generation Mar 21, 2026
@mj12albert mj12albert requested a review from aarongarciah March 23, 2026 07:53
@flaviendelangle
Copy link
Copy Markdown
Member

0.37% bundle size increase for that kind of fix is so sad 😢
Could we imagine a way to not omit those props in every component but instead do it in useRenderElement or would that add to much performance overhead?

@mj12albert
Copy link
Copy Markdown
Member Author

not omit those props in every component but instead do it in useRenderElement

@flaviendelangle Tried this with codex and here's the comparison:

The prototype was validated in a temp worktree with pnpm typescript, pnpm test:jsdom useRenderElement --no-watch, and pnpm size:snapshot.
The bundle result was mixed:

  • @base-ui/react barrel entry got smaller: 468,552 -> 467,295 parsed (-0.268%), 146,960 -> 146,666 gzip (-0.200%).
  • The full local size snapshot across all measured entrypoints got slightly worse overall: +1,801 parsed (+0.075%) and +440 gzip (+0.054%).
  • Distribution matters more than the summed total: 35 entrypoints got bigger, 4 smaller, 40 were unchanged. Many leaf entries moved by about +110 to +130 parsed bytes and +24 to +42 gzip bytes.

Interpretation: the alternative helps the big barrel import a bit, but it pushes extra shared logic into many leaf entrypoints.
Conclusion: If the goal is minimizing leaf entrypoint size and avoiding extra work in a hot shared helper, the current explicit destructuring is the better trade.

@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Mar 23, 2026
@github-actions github-actions Bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Mar 29, 2026
@mj12albert mj12albert merged commit b353c1e into mui:master Mar 29, 2026
23 checks passed
Comment on lines +1 to +3
{
"name": "AccordionHeader",
"description": "A heading that labels the corresponding panel.\nRenders an `<h3>` element.",
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.

I think these files were intentionally removed by docs-infra upgrades? @mj12albert

@mj12albert mj12albert mentioned this pull request Mar 29, 2026
1 task
@oliviertassinari oliviertassinari added the scope: docs-infra Involves the docs-infra product (https://www.notion.so/mui-org/b9f676062eb94747b6768209f7751305). label Mar 29, 2026
atomiks pushed a commit to mj12albert/base-ui that referenced this pull request Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to the documentation. scope: docs-infra Involves the docs-infra product (https://www.notion.so/mui-org/b9f676062eb94747b6768209f7751305).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants