Skip to content

perf(homepage): prerender the highlighted code examples [Codex] - #1364

Open
jderochervlk wants to merge 4 commits into
perf/lazy-docsearchfrom
perf/prerender-homepage-highlighting
Open

jderochervlk wants to merge 4 commits into
perf/lazy-docsearchfrom
perf/prerender-homepage-highlighting

Conversation

@jderochervlk

@jderochervlk jderochervlk commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

The homepage renders two fixed examples but previously ran syntax highlighting and playground URL compression in the browser. This layer of #1354 prepares that content in the homepage route loader and passes three serializable strings to the existing hero.

The loader uses an isolated highlighter with only ReScript and JavaScript registered. The displayed source, highlighted tokens, dark styling, and playground link remain unchanged. The browser route no longer imports the preparation code or compression library; global language registration is intentionally left for the next layer.

Initial JavaScript falls from 997,890 to 988,509 raw bytes and from 164,222 to 161,623 gzip bytes. Serialized loader data increases initial HTML from 47,176 to 52,137 raw bytes and from 12,274 to 13,147 gzip bytes, for a net initial gzip reduction of 1,726 bytes. Client navigation gains a 3,398-byte data response (958 bytes gzip). CSS, request counts, and the 409-element homepage DOM are unchanged.

Stacked on #1363.

@jderochervlk
jderochervlk added this pull request to stack #1359 September 19, 2026 17:56
@jderochervlk jderochervlk changed the title perf(homepage): prepare code examples in the route loader perf(homepage): prerender the highlighted code examples [Codex] Sep 19, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 19, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
guide 149251f Commit Preview URL

Branch Preview URL
Sep 20 2026, 02:45 PM

@github-actions

github-actions Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Lighthouse baseline

Compared with target branch perf/lazy-docsearch at commit 9d04afc. Scores are the median of 3 runs against the deployed Cloudflare preview.

Category Target Current Change
Performance 86 87 +1
Accessibility 74 74 0
Best practices 100 100 0
SEO 50 50 0

Download the full Lighthouse reports and baseline

Commit 6019f95 · Cloudflare preview

@jderochervlk
jderochervlk marked this pull request as ready for review September 19, 2026 18:08
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 19, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-20T16:08:46.247169Z 149251f Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f3a1b38964

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/docs/src/data/LandingPagePlaygroundLoader.res Outdated
Comment thread apps/docs/app/routes/LandingPageRoute.res
@jderochervlk
jderochervlk force-pushed the perf/prerender-homepage-highlighting branch from f3a1b38 to a2c8376 Compare September 19, 2026 21:52
@jderochervlk
jderochervlk force-pushed the perf/prerender-homepage-highlighting branch from a2c8376 to b59d3b1 Compare September 19, 2026 22:52
@jderochervlk
jderochervlk marked this pull request as draft September 19, 2026 23:02
@jderochervlk
jderochervlk force-pushed the perf/prerender-homepage-highlighting branch from b59d3b1 to 1751385 Compare September 19, 2026 23:50
@jderochervlk
jderochervlk force-pushed the perf/prerender-homepage-highlighting branch from 1751385 to 7a26dc4 Compare September 20, 2026 01:02
@jderochervlk

Copy link
Copy Markdown
Collaborator Author

@codex

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: c28fae87f6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Generate highlighted markup and the compressed playground URL during prerendering with an isolated highlighter. Keep the hero presentational, preserve existing screenshots, verify hydration and navigation, and ratchet the initial JavaScript byte budget down.
Retain initial-script exclusions and exact prerender/hydration/navigation markup checks for PR #1355 comment 4054821928.
Move the Highlight.js core and homepage language interop into a dedicated bindings module while leaving loader behavior unchanged.
Keep prerendered highlighting and navigation coverage in the typed Cypress test suite.
@github-actions

Copy link
Copy Markdown
Contributor

Docs preview

@jderochervlk
jderochervlk marked this pull request as ready for review September 20, 2026 16:04
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