Skip to content

Conversation

@oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Sep 10, 2025

A quick, fun one.

  1. There are 359 HTML errors on https://base-ui.com/react/components/slider, if we can trust https://validator.w3.org/nu/?doc=https%3A%2F%2Fbase-ui.com%2Freact%2Fcomponents%2Fslider.
SCR-20250910-qgic

I see this as a regression in Base UI vs. MUI Base https://v6.mui.com/base-ui/react-slider/ that only has errors from the components (or almost).
I can't find one clear PR that broke this in Base UI, it seems to have been ignored from the start, so only a pattern of not considering those errors in the Definition of Done. Which I think we can turn into: mui/mui-public#682.

  1. There are Axe regressions introduced from [docs] New props table #2135.
SCR-20250910-qtjy

Which I think we can turn into: mui/mui-public#683.


After this PR change, we only have the bugs that our components have. For example, on the Slider docs page:

SCR-20250910-qjwd

https://validator.w3.org/nu/?doc=https%3A%2F%2Fdeploy-preview-2718--base-ui.netlify.app%2Freact%2Fcomponents%2Fslider

Someone could now easily spot the issues and fix them:

  1. The aria-valuemin is redundant, to delete.
  2. The aria-valuemax is redundant, to delete.
  3. The name default value is wrong, the docs say it's empty but it's "". This is not the same: an input without a name doesn't get sent, one with an empty string gets sent with an empty string as key.

cc @mj12albert

Preview: https://deploy-preview-2718--base-ui.netlify.app/react/components/slider

@oliviertassinari oliviertassinari added the docs Improvements or additions to the documentation. label Sep 10, 2025
@oliviertassinari oliviertassinari added type: regression A bug, but worse, it used to behave as expected. scope: docs-infra Involves the docs-infra product (https://www.notion.so/mui-org/b9f676062eb94747b6768209f7751305). labels Sep 10, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 10, 2025

Open in StackBlitz

pnpm add https://pkg.pr.new/mui/base-ui/@base-ui-components/react@2718
pnpm add https://pkg.pr.new/mui/base-ui/@base-ui-components/utils@2718

commit: 2040900

@netlify
Copy link

netlify bot commented Sep 10, 2025

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 2040900
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/68c1ecee8a1de10008c8ee8a
😎 Deploy Preview https://deploy-preview-2718--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.

@mui-bot
Copy link

mui-bot commented Sep 10, 2025

Bundle size report

Bundle Parsed size Gzip size
@base-ui-components/react 0B(0.00%) 0B(0.00%)

Details of bundle changes

Copy link
Member Author

@oliviertassinari oliviertassinari left a comment

Choose a reason for hiding this comment

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

Extra context added. Normally, those changes lead to no visual diff (that are not bug fixes).

Comment on lines -4 to +5
export function Code({ className, ...props }: React.ComponentProps<'code'>) {
return <code className={clsx('Code', className)} {...props} />;
export function Code(props: React.ComponentProps<'code'>) {
return <code {...props} className={clsx('Code', props.className)} />;
Copy link
Member Author

Choose a reason for hiding this comment

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

Avoid JS object destructuring; it's faster. This components is rendered a bunch on the page.

}

export function Panel({ className, children, ...props }: React.ComponentPropsWithoutRef<'div'>) {
export function Panel({ className, children, ...other }: React.ComponentPropsWithoutRef<'div'>) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Usual naming convention in the codebase (move closer to have a single convetion in use, to help others navigate it).

Copy link
Member

Choose a reason for hiding this comment

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

In the repo (package and docs) ...props is still by far the most common though

Comment on lines -74 to +75
event.key === 'a' &&
(event.metaKey || event.ctrlKey) &&
(event.ctrlKey || event.metaKey) &&
String.fromCharCode(event.keyCode) === 'A' &&
Copy link
Member Author

Choose a reason for hiding this comment

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

The logic was wrong; it ignored, e.g. Dvorak keyboard. This is a straight copy & paste from Material UI, not related to the PR, but I saw it, so why not? For those who wonder, at the root, it's an issue with the web standard.

Comment on lines -25 to +26
<Accordion.Scrollable gradientColor="var(--color-gray-50)">
<pre {...props} className="text-xs p-0 m-0" style={{ backgroundColor: 'none' }} />
<Accordion.Scrollable component="div" gradientColor="var(--color-gray-50)">
<pre {...props} className="text-xs p-0 m-0" style={{ backgroundColor: undefined }} />
Copy link
Member Author

@oliviertassinari oliviertassinari Sep 10, 2025

Choose a reason for hiding this comment

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

background-color: none doesn't exist: https://stackoverflow.com/questions/8739665/is-background-colornone-valid-css. Instead, remove the inline style applied.

</DescriptionList.Details>
</DescriptionList.Item>
)}

Copy link
Member Author

Choose a reason for hiding this comment

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

Avoid blank lines in JSX; those always feel arbitrarily placed with no meaning (component separation usually works a lot better to convey context).

Comment on lines -118 to +117
p: (props) => <p {...props} />,
p: (props) => props.children,
Copy link
Member Author

Choose a reason for hiding this comment

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

We don't need an extra <p> when we inline code, so flatten it.

const {
children,
className,
component: Component = 'span',
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this component prop is necessary; is it because div is shorter than span? If so this could just always be a div

Copy link
Member Author

@oliviertassinari oliviertassinari Sep 18, 2025

Choose a reason for hiding this comment

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

SCR-20250918-tswb

<Accordion.Scrollable> is used as a child of a <summary> which only allows phrasing content, so it can't be a div, a span works.

But <Accordion.Scrollable> is also used as a parent of a <pre> element, which only allows its parent to be a flow content, so it can't be a span; a div works.

So it needs to be parameterized.

Copy link
Member

Choose a reason for hiding this comment

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

How about tag instead of component? We already use this convention a bit in the package, e.g.

rehypePlugins: rehypeSyntaxHighlighting,
useMDXComponents: () => ({
code: ExpandedCode,
...inlineMdxComponents,
Copy link
Member

Choose a reason for hiding this comment

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

Why does this need to be spread here now?

Copy link
Member Author

Choose a reason for hiding this comment

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

I expect that all use of createMdxComponent() must extend the default typography set, so:

diff --git a/docs/src/mdx/createMdxComponent.ts b/docs/src/mdx/createMdxComponent.ts
index 6314f9b9..98c99684 100644
--- a/docs/src/mdx/createMdxComponent.ts
+++ b/docs/src/mdx/createMdxComponent.ts
@@ -1,5 +1,6 @@
 import * as jsxRuntime from 'react/jsx-runtime';
 import { evaluate, EvaluateOptions } from '@mdx-js/mdx';
+import { mdxComponents } from '../mdx-components';

 export async function createMdxComponent(
   markdown = '',
@@ -8,6 +9,7 @@ export async function createMdxComponent(
 ) {
   const { default: Component } = await evaluate(markdown, {
     ...jsxRuntime,
+    ...mdxComponents,
     ...options,
   } as EvaluateOptions);
   return Component;

It's only about a step to make this migration easier.

@mj12albert mj12albert mentioned this pull request Sep 11, 2025
1 task
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Sep 30, 2025
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. PR: out-of-date The pull request has merge conflicts and can't be merged. scope: docs-infra Involves the docs-infra product (https://www.notion.so/mui-org/b9f676062eb94747b6768209f7751305). type: regression A bug, but worse, it used to behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants