CodeRunner 原用 use_hook(|| format!("code-runner-{}", now_pseudo_unique()))
生成容器 id,后缀依赖 now_millis() 时间戳。Dioxus hydration 不传递
use_hook 状态——SSR 渲染与客户端 hydration 各执行一次 use_hook,时间戳
(以及顺带验证过的 ScopeId)两端不同,导致 CodeMirror create() 在 hydration
时用新 id 去 getElementById,找不到 SSR 渲染的容器(id 是旧值),返回 null
不挂载。路由跳转是纯客户端渲染,use_hook 只跑一次 id 一致,故正常。
改为由父组件传入确定性的 instance_id(PostContent 的片段索引 i,来自纯函数
split_content_fragments 对同一 content_html 的解析,SSR 与 hydration 一致),
container_id 直接派生自该 prop,不进 use_hook。admin 试运行页单实例固定 0。
Playwright(release 构建)验证:SSR 直接访问与路由跳转 .cm-editor 均为 1。
37 lines
478 B
Plaintext
37 lines
478 B
Plaintext
/target
|
|
/dist
|
|
/.dioxus
|
|
/.omc
|
|
/node_modules
|
|
**/**/node_modules
|
|
/package-lock.json
|
|
others/
|
|
public/style.css
|
|
public/highlight.css
|
|
public/tiptap
|
|
public/codemirror
|
|
public/lightbox
|
|
public/yggdrasil-core
|
|
public/doc
|
|
/static
|
|
.env
|
|
docs/superpowers/
|
|
|
|
# Uploaded images
|
|
uploads/*
|
|
!uploads/.gitkeep
|
|
uploads/.cache/
|
|
|
|
# Database backups
|
|
backups/
|
|
|
|
profile.json.gz
|
|
|
|
# Git worktrees
|
|
.worktrees/
|
|
|
|
# FreeBSD cross-compile sysroot (extracted from base.txz, machine-local)
|
|
.freebsd-sysroot/
|
|
|
|
.zcode/
|