Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[website] Modernize the Base UI website #538

Merged
merged 160 commits into from
Sep 5, 2024
Merged

Conversation

michaldudak
Copy link
Member

@michaldudak michaldudak commented Aug 9, 2024

Overview

Created a new documentation website for Base UI. It does not use any of the Material UI-specific components from the Core repo, which simplifies the setup.

Notable changes in comparison to the old site:

  • Using the Next.js App Router and React Server Components.
  • Using MDX instead of the custom Markdown parser (@mui/markdown). This enables the use of arbitrary components in the docs, potentially improving consistency (for things like installation instructions etc.).
  • New mechanisms for including and showing demos. The previous functions were tied to the webpack loader from @mui/markdown. Using RSC allowed us to greatly simplify the implementation of the loader.
  • Demo viewer uses unstyled base components.
  • Live editing of demos is currently not supported.
  • Material UI components are not used. We use custom-styled Base UI components where needed.
  • The site is styled using plain CSS.
  • There is no need to generate .js/.ts pages per component anymore. The site uses dynamic routes to render markdown for each component using a single page.tsx file.

Breaking changes

  • Documentation files should be written using mdx (just for consistency, as plain markdown is still supported).
  • Components such as ComponentLinkHeader must be included as JSX elements (<ComponentLinkHeader />) instead of {{ "component": ... }} syntax.
  • The <p class="description"> in docs is replaced by the <Description /> component. It does not need children, as the content is taken from the description field in frontmatter.
  • The ComponentPageTabs component is no longer used.
  • Demos are included using the <Demo demo="(demo name)" /> component. The demo prop does not require extension and can point to either a file or a directory containing multiple variants.
  • Demos must have the "use client"; directive (this is strictly necessary only for demos using MUI System, but can prevent weird errors elsewhere as well).
  • Callouts (:::info, :::warning, etc.) are replaced by the <Callout type="..." /> component.
  • pnpm docs:api no longer generates pages. Next.js dynamic routes are used, so a single page component can render multiple pages.
  • pages.ts no is longer split into categories. Instead, all the components are listed alphabetically.

To do

  • SEO metadata
  • Callout components
  • Update all the pages to use components for common parts
  • ComponentLinkHeader component
  • Accessible demo toolbar
  • Demo file selector as tabs
  • Demo controls
    • Reset
    • Focus
    • Copy source
    • Expand/collapse code
    • View source on GitHub
  • CodeSandbox generation
  • StackBlitz generation
  • Code blocks in dark mode
  • Fix link checker script
  • Fix visual regression tests
  • Next/previous page links
  • "Edit this page on GitHub" link
  • Fix the Google Analytics component
  • Render Tailwind CSS demos
  • Remember package manager selection between pages and sessions
  • Remember styling engine selection between pages and sessions

Moved to separate issues

  • Light/dark mode switcher
  • Responsive sidebars
  • Feedback component
  • Source code preview generation (TBD if needed)

@michaldudak michaldudak added the website Related to the marketing pages label Aug 9, 2024
@mui-bot
Copy link

mui-bot commented Aug 9, 2024

Netlify deploy preview

https://deploy-preview-538--base-ui.netlify.app/

Generated by 🚫 dangerJS against 1976926

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Aug 9, 2024
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Aug 9, 2024
package.json Outdated
@@ -81,7 +81,7 @@
"@mui/internal-scripts": "^1.0.18",
"@mui/internal-test-utils": "1.0.11",
"@mui/material": "6.0.1",
"@mui/monorepo": "github:mui/material-ui#v6.0.0-beta.4",
"@mui/monorepo": "github:michaldudak/material-ui#3b7d609357",
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 will be changed to mui/material-ui once mui/material-ui#43574 is merged.

@michaldudak michaldudak marked this pull request as ready for review September 3, 2024 09:39
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Sep 3, 2024
@github-actions github-actions bot added PR: out-of-date The pull request has merge conflicts and can't be merged and removed PR: out-of-date The pull request has merge conflicts and can't be merged labels Sep 3, 2024
@github-actions github-actions bot added PR: out-of-date The pull request has merge conflicts and can't be merged and removed PR: out-of-date The pull request has merge conflicts and can't be merged labels Sep 4, 2024
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Sep 4, 2024
@michaldudak michaldudak merged commit 053b139 into mui:master Sep 5, 2024
18 checks passed
@michaldudak michaldudak deleted the new-docs branch September 5, 2024 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
website Related to the marketing pages
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants