Repository navigation
chore: more ssr! - #9260
chore: more ssr!#9260avivkeller wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report❌ Patch coverage is 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. |
📦 Build Size ComparisonSummary
Changes🔄 Modified Routes (4)
|
| import styles from './index.module.css'; | ||
|
|
||
| type DownloadButtonProps = { release: NodeRelease }; | ||
| type DownloadButtonProps = { release: NodeRelease } & Pick< |
There was a problem hiding this comment.
Why is this better? Those functions are already SSR.
| const release = use(ReleaseContext); | ||
| const t = useTranslations(); | ||
|
|
||
| useEffect(() => { |
There was a problem hiding this comment.
Why are you removing this? This was intentional...
|
|
||
| const PlatformDropdown: FC = () => { | ||
| const { architecture, bitness } = useClientContext(); | ||
| const { architecture, bitness } = use(DetectedOSContext); |
There was a problem hiding this comment.
Make a Hook for the Provider please 🙇
| // 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); |
There was a problem hiding this comment.
const groupToUse = navKeys.length === 1 ? sideNavigation[0].items : sideNavigation
const groups = groupToUse.map(toGroup);
ovflowd
left a comment
There was a problem hiding this comment.
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)
5d10c1d to
e0ab973
Compare
| const CarbonSidebar: FC = () => { | ||
| const { frontmatter } = useClientContext(); | ||
|
|
||
| const CarbonSidebar: FC<{ layout?: Layouts }> = ({ layout }) => { |
There was a problem hiding this comment.
add type CarbonSidebarProps for regularity
|
|
||
| const WebsiteBanner: FC<{ section: string }> = ({ section }) => { | ||
| const banner = siteConfig.websiteBanners[section]; | ||
| const Banner: FC<{ banner: WebsiteBanner }> = ({ banner }) => { |
| // 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'}` |
There was a problem hiding this comment.
what about using https://next-intl.dev/docs/usage/translations#cardinal-pluralization
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).
<details>instead of a Select that duplicated every link. Desktop is unchanged; browsers without::details-contentkeep the toggle.