Skip to content

chore: more ssr! - #9260

Open
avivkeller wants to merge 1 commit into
mainfrom
fix/sidebar-mobile-disclosure
Open

avivkeller wants to merge 1 commit into
mainfrom
fix/sidebar-mobile-disclosure

Conversation

@avivkeller

@avivkeller avivkeller commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

NavBar, Sidebar, Breadcrumbs and MetaBar become Server Components, which removes MatterProvider (it serialized the page context into every page) and about 240 KB of first-load JS per route (per the build-size bot on the earlier revision).

  • Sidebar: on mobile the navigation is a native <details> instead of a Select that duplicated every link. Desktop is unchanged; browsers without ::details-content keep the toggle.
  • Breadcrumbs: mobile truncation is done in CSS (mobileMaxLength) instead of useMediaQuery.
  • NavBar: the menu icon swaps through :has(:checked); the language dropdown renders locale links instead of calling the router.
  • Client islands that remain: theme toggle, search, banner, sidebar scroll restore, avatars.
  • Side effects: the 500 page no longer shows the NavBar/Footer (error boundaries are client-only); language links on the 404 page go to the home page.

Copilot AI balanced review requested due to automatic review settings November 1, 2026 13:06
@avivkeller
avivkeller requested a review from a team as a code owner November 1, 2026 13:06
@vercel

vercel Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nodejs-org Ready Ready Preview Nov 27, 2026 6:21pm UTC

Request Review

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@codecov

codecov Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.65237% with 99 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.71%. Comparing base (73b1a59) to head (e0ab973).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
apps/site/components/Sidebar/index.tsx 73.91% 12 Missing ⚠️
...rc/Containers/Sidebar/SidebarCollapsible/index.tsx 67.74% 10 Missing ⚠️
apps/site/components/AvatarGroup/Avatars.tsx 71.87% 9 Missing ⚠️
...ages/ui-components/src/Containers/NavBar/index.tsx 0.00% 9 Missing ⚠️
apps/site/components/AvatarGroup/index.tsx 66.66% 7 Missing ⚠️
...ges/ui-components/src/Common/Breadcrumbs/index.tsx 86.27% 7 Missing ⚠️
apps/site/components/Sidebar/ScrollRestore.tsx 76.92% 6 Missing ⚠️
apps/site/components/NavBar/index.tsx 61.53% 5 Missing ⚠️
...mmon/Breadcrumbs/BreadcrumbTruncatedItem/index.tsx 54.54% 5 Missing ⚠️
apps/site/components/WebsiteBanner/Banner.tsx 55.55% 4 Missing ⚠️
... and 8 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9260      +/-   ##
==========================================
- Coverage   87.12%   85.71%   -1.41%     
==========================================
  Files          92      110      +18     
  Lines        6656     7449     +793     
  Branches      405      454      +49     
==========================================
+ Hits         5799     6385     +586     
- Misses        853     1057     +204     
- Partials        4        7       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

📦 Build Size Comparison

Summary

Metric Value
Old Total First Load JS 7.23 MB
New Total First Load JS 6.22 MB
Delta -1.01 MB (-14.03%)

Changes

🔄 Modified Routes (4)
Route Old First Load JS New First Load JS Delta
/[locale] 1.70 MB 1.44 MB 📉 -259.58 KB (-14.93%)
/[locale]/[...path] 1.70 MB 1.44 MB 📉 -259.58 KB (-14.93%)
/[locale]/blog/[...path] 1.70 MB 1.44 MB 📉 -259.58 KB (-14.93%)
/[locale]/download/archive/[version] 1.70 MB 1.44 MB 📉 -259.58 KB (-14.93%)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hoiw is this related?

import styles from './index.module.css';

type DownloadButtonProps = { release: NodeRelease };
type DownloadButtonProps = { release: NodeRelease } & Pick<

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is this better? Those functions are already SSR.

const release = use(ReleaseContext);
const t = useTranslations();

useEffect(() => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why are you removing this? This was intentional...


const PlatformDropdown: FC = () => {
const { architecture, bitness } = useClientContext();
const { architecture, bitness } = use(DetectedOSContext);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Make a Hook for the Provider please 🙇

Comment thread apps/site/components/Sidebar/index.tsx Outdated
// If there's only a single navigation key, use its sub-items as our navigation
const groups = (
navKeys.length === 1 ? sideNavigation[0].items : sideNavigation
).map(toGroup);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

const groupToUse = navKeys.length === 1 ? sideNavigation[0].items : sideNavigation
const groups = groupToUse.map(toGroup);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit ☝️

@ovflowd ovflowd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As usual, please, add PR description, explain the changes, how they tie together, add screenshots, if there's any side-effect and confirm that you have tested every single one of these pages and confirmed all sort of behaviors in all sort of scenarios that the previous code held are still working.

It's hard to validate when a PR is touching so many different things seeminlgy not tied together (+ changing styles)

Comment thread apps/site/components/NavBar/index.tsx Resolved
Comment thread apps/site/components/Breadcrumbs.tsx Resolved
Comment thread apps/site/components/MetaBar.tsx Resolved
Comment thread apps/site/providers/releaseProvider.tsx Resolved
Comment thread apps/site/next.dynamic.page.mjs Resolved
const CarbonSidebar: FC = () => {
const { frontmatter } = useClientContext();

const CarbonSidebar: FC<{ layout?: Layouts }> = ({ layout }) => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

add type CarbonSidebarProps for regularity


const WebsiteBanner: FC<{ section: string }> = ({ section }) => {
const banner = siteConfig.websiteBanners[section];
const Banner: FC<{ banner: WebsiteBanner }> = ({ banner }) => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

dito BannerProps

// the number of avatars manually for the resolutions below
const isSmallerThanDesktop = useMediaQuery('(max-width: 1280px)');
const authorsLabel = t(
`components.metabar.${usernames.length > 1 ? 'authors' : 'author'}`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This branch was successfully deployed

2 active deployments
Preview — e0ab9732 Deployed Nov 27, 2026 by vercel[bot]
Storybook — e0ab9732 Deployed Nov 27, 2026 by avivkeller via Chromatic #2515
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.

4 participants