missing hydration in SSR builds

Open
#767 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
clojure, react
Domain
frontend

Research direction

Start with the linked clerk-ssr-interactive-test repository and inspect the generated HTML from a notebook built with :ssr true; no source file or test is named in the issue. Done means the light/dark mode switch, TOC, code-folding controls, elided buttons, and custom render event handlers respond in the browser.

Written by the indexing model from the issue text.

Description

When I build a notebook with :ssr true and spin up a local server to load it in the browser, I cannot interact with the interface at all, specifically:

  • light-/darkmode switch
  • TOC button
  • fold/unfold buttons in code viewer
  • “elided” buttons in code viewer
  • etc.

Nothing happens at all if I click any of these. Event handlers from custom render functions also won’t get triggered.

This is probably due to missing hydration, since there seems to be no code in the generated html file to attach event listeners, etc. I don’t know anything about how SSR works in React, so I hope this is an easy thing to fix.

I created a test repo where I included all the cases listed above and build the notebook so you can see the generated html file: https://github.com/formsandlines/clerk-ssr-interactive-test It uses the latest commit from Clerks main branch.

Dominant language
Clojure
Stars
2.1k
Forks
87
Avg merge
3m
Merged PRs (30d)
2

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nextjournal/clerk

All issues in nextjournal/clerk

Similar issues

More Clojure issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.