Skip to content

[docs-infra] Update Index to Filter Private Entries#4239

Merged
dav-is merged 24 commits intomui:masterfrom
dav-is:docs-infra/update-index-to-allow-private-entries
Mar 10, 2026
Merged

[docs-infra] Update Index to Filter Private Entries#4239
dav-is merged 24 commits intomui:masterfrom
dav-is:docs-infra/update-index-to-allow-private-entries

Conversation

@dav-is
Copy link
Member

@dav-is dav-is commented Mar 2, 2026

Update pages index to use new format from mui/mui-public#1109 released in 0.5.1-canary.0

Adds private Calendar page: https://deploy-preview-4239--base-ui.netlify.app/react/components/calendar (this page will not appear at https://master--base-ui.netlify.app/). Based on this ENV variable: https://github.com/mui/mui-public/blob/df142b55588e09b911db8be848c133b0ebad1cc0/packages/docs-infra/src/withDocsInfra/withDeploymentConfig.ts#L8-L46

Also adds filtering from navigation and search when pages are marked with audience: private:

export const metadata =
  /** @type {import('@mui/internal-docs-infra/createSitemap/types').NextMetadata} */ ({
    robots: {
      index: false,
    },
    other: {
      audience: 'private',
    },
  });

metadata.robots.index: false is how Next.js adds the no-index meta: https://nextjs.org/docs/app/api-reference/functions/generate-metadata#robots

@dav-is dav-is added type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. scope: docs-infra Involves the docs-infra product (https://www.notion.so/mui-org/b9f676062eb94747b6768209f7751305). labels Mar 2, 2026
@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 2, 2026

commit: 811750b

@mui-bot
Copy link

mui-bot commented Mar 2, 2026

Bundle size report

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

Details of bundle changes


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

@netlify
Copy link

netlify bot commented Mar 2, 2026

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 0f21dc1
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/69b018019fa6890008857fb5
😎 Deploy Preview https://deploy-preview-4239--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.

Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

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

Let's revert the unnecessary changes to the mdx files, only keep the relevant changes and change one mdx to private just so we can test things out.

],
};
export const metadata =
/** @type {import('@mui/internal-docs-infra/pipeline/transformMarkdownMetadata/types').Metadata} */ ({
Copy link
Member

Choose a reason for hiding this comment

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

Can we add the typeonly on pages that actually use params not defined in the next.js type?

Copy link
Member Author

@dav-is dav-is Mar 4, 2026

Choose a reason for hiding this comment

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

Right now the metadata doesn't have any JSDocs so even the Next.js types aren't shown when hovering or autocomplete. If we have the type here, then our added metadata options are discoverable. This type extends Next.js' types too.

If we don't put our metadata type here, I think we should at least put the @type for Next.js metadata.

Edit: I reverted this for now

Copy link
Member

Choose a reason for hiding this comment

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

We can do it in a follow-up, just so we don't clatter this PR.

@dav-is
Copy link
Member Author

dav-is commented Mar 4, 2026

I'll separate out the unrelated changes into another PR to keep this one minimal

@dav-is dav-is requested a review from mnajdova March 4, 2026 20:12
@dav-is
Copy link
Member Author

dav-is commented Mar 4, 2026

@mnajdova Ok, the unrelated changes are reverted, I renamed to isPrivate, and I added an empty calendar page to test: https://deploy-preview-4239--base-ui.netlify.app/react/components/calendar

Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

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

Thanks for isolating some changes, can you answer few last questions?

@mnajdova
Copy link
Member

mnajdova commented Mar 5, 2026

It looks good to me 👌 Do you plan to add more things in this PR? I am asking because it's still in draft

@dav-is
Copy link
Member Author

dav-is commented Mar 5, 2026

Do you plan to add more things in this PR?

No, I can do it in a followup PR. It's a draft because we need to merge mui/mui-public#1109 before this PR can be merged. That PR should be ready to go whenever it is approved

/** @type {import('@mui/internal-docs-infra/createSitemap/types').NextMetadata} */ ({
keywords: [],
robots: {
index: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this work for the generateMetadata function ?

Copy link
Member Author

@dav-is dav-is Mar 6, 2026

Choose a reason for hiding this comment

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

generateMetadata is not supported by page indexes today because it requires running the build and rendering the page. When we use export const metadata, we can statically analyze by parsing the file. I want to support it eventually, but we need to further optimize Base UI's build pipeline so that a cached build takes less than 5 seconds (my target).

@dav-is dav-is marked this pull request as ready for review March 9, 2026 16:18
Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

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

I left two more comments, I don't see anything blocking. Let's update the infra package and merge this one 👌

@@ -0,0 +1,18 @@
# Calendar
Copy link
Member

Choose a reason for hiding this comment

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

We can drop this page as there are other pages where we can test the private flag.

import 'docs/src/css/index.css';
import './layout.css';

const showPrivatePages = process.env.SHOW_PRIVATE_PAGES === 'true';
Copy link
Member

Choose a reason for hiding this comment

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

We should make sure we don't forget to set this flag before the next deployment.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is set within docs-infra code withDeploymentConfig

@dav-is dav-is merged commit 50b1996 into mui:master Mar 10, 2026
22 checks passed
@dav-is dav-is deleted the docs-infra/update-index-to-allow-private-entries branch March 10, 2026 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: docs-infra Involves the docs-infra product (https://www.notion.so/mui-org/b9f676062eb94747b6768209f7751305). type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants