Skip to content

Update docs page to use new File component#80

Merged
amadeus merged 17 commits intomainfrom
amadeus/docs-page-use-file
Oct 25, 2025
Merged

Update docs page to use new File component#80
amadeus merged 17 commits intomainfrom
amadeus/docs-page-use-file

Conversation

@amadeus
Copy link
Copy Markdown
Member

@amadeus amadeus commented Oct 20, 2025

Quite a big rework to get all the diffs and code snippets on our docs pages fully server rendered.

CleanShot.2025-10-25.at.15.55.05.mp4

Notes

This is a bit of a monster PR because a lot of deliberate changes had to go into how things where structured to ensure the serverside rendering doesn't happen in 'use client' components. I tried to at least keep things organized, but it's still a lot.

  • Added a new server rendering API for files
  • Added the ability for File.ts to hydrate server rendered code
  • Tons of hydration improvements and fixes to File.ts and FileDiff.ts
  • Added a shiki preloader to the docs/homepage help reduce the potential chance of having to load themes or languages
  • Reworked File.tsx as the react component for rendering individual files to handle server hydration
    • Shared some of the hydration logic with FileDiff.tsx (probably still more we could do there)
  • Tweaked some of the transformer generation logic to be better shared between DiffHunksRenderer and FileRenderer

@amadeus amadeus force-pushed the amadeus/docs-page-use-file branch from e09059d to a43456c Compare October 20, 2025 21:06
@amadeus amadeus force-pushed the amadeus/file-component branch from 833e0f6 to a48a8d1 Compare October 20, 2025 22:51
Base automatically changed from amadeus/file-component to main October 20, 2025 22:54
@amadeus amadeus force-pushed the amadeus/docs-page-use-file branch from a43456c to 1c984e2 Compare October 20, 2025 23:34
@vercel
Copy link
Copy Markdown

vercel Bot commented Oct 20, 2025

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

Project Deployment Preview Updated (UTC)
pierrejs-diff-demo Ready Ready Preview Oct 25, 2025 11:04pm
pierrejs-docs Ready Ready Preview Oct 25, 2025 11:04pm

@amadeus amadeus force-pushed the amadeus/docs-page-use-file branch from 1c984e2 to 341c3b1 Compare October 20, 2025 23:58
@amadeus amadeus force-pushed the amadeus/docs-page-use-file branch from 3e00bf3 to 65e9b0e Compare October 21, 2025 21:39
@amadeus amadeus force-pushed the amadeus/docs-page-use-file branch from 65e9b0e to c306ac6 Compare October 23, 2025 19:48
@amadeus amadeus force-pushed the amadeus/docs-page-use-file branch from c306ac6 to 67bee2b Compare October 25, 2025 05:58
The sloppy AI refactor definitely messed some of this up
* Reworked the code to be more adaptable
* Ensure that handlers can never get doubled up
* Actually clean up scroll handling now
* Move from left/right naming conventions to deletions/additions because
  it's easier to follow
@amadeus amadeus requested review from SlexAxton and fat October 25, 2025 23:11
@amadeus amadeus merged commit a0b5bf4 into main Oct 25, 2025
2 checks passed
@amadeus amadeus deleted the amadeus/docs-page-use-file branch October 25, 2025 23:17
SlexAxton added a commit that referenced this pull request Apr 21, 2026
Improves the packages/trees file-tree profiler startup path for large pre-expanded/open trees. The change stack removes redundant prepared-input validation, represents profiler workloads with initialExpansion: 'open', slims PathStore node/storage shapes, reduces cold startup writes, tunes visible-child chunk summaries, and removes redundant FileTreeView mount/render work.

Experiments: kept runs #1, #16, #18, #24, #25, #26, #28, #36, #41, #42, #43, #44, #51, #65, #67, #68, #71, #74, #80, #82, #137, #139, #140, #142, #143, #147, #149, #153, #155, #163, #165, #171, #180, #182, #186, #196
Metric: visibleRowsReadyMs 334.8ms -> 253.8ms best (-24.2%); final kept sample 267.8ms (-20.0%).
SlexAxton added a commit that referenced this pull request Apr 22, 2026
Improves the packages/trees file-tree profiler startup path for large pre-expanded/open trees. The change stack removes redundant prepared-input validation, represents profiler workloads with initialExpansion: 'open', slims PathStore node/storage shapes, reduces cold startup writes, tunes visible-child chunk summaries, and removes redundant FileTreeView mount/render work.

Experiments: kept runs #1, #16, #18, #24, #25, #26, #28, #36, #41, #42, #43, #44, #51, #65, #67, #68, #71, #74, #80, #82, #137, #139, #140, #142, #143, #147, #149, #153, #155, #163, #165, #171, #180, #182, #186, #196
Metric: visibleRowsReadyMs 334.8ms -> 253.8ms best (-24.2%); final kept sample 267.8ms (-20.0%).
SlexAxton added a commit that referenced this pull request Apr 22, 2026
)

Optimize file-tree startup for large open trees

Improves the packages/trees file-tree profiler startup path for large pre-expanded/open trees. The change stack removes redundant prepared-input validation, represents profiler workloads with initialExpansion: 'open', slims PathStore node/storage shapes, reduces cold startup writes, tunes visible-child chunk summaries, and removes redundant FileTreeView mount/render work.

Experiments: kept runs #1, #16, #18, #24, #25, #26, #28, #36, #41, #42, #43, #44, #51, #65, #67, #68, #71, #74, #80, #82, #137, #139, #140, #142, #143, #147, #149, #153, #155, #163, #165, #171, #180, #182, #186, #196
Metric: visibleRowsReadyMs 334.8ms -> 253.8ms best (-24.2%); final kept sample 267.8ms (-20.0%).
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.

1 participant