Inert hydration data mode for hash-based CSP on cached SSR pages
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, typescript
Hướng nghiên cứu
Start by reading the hydration paths in packages/web/src/server.ts, packages/solid/src/client/hydration.ts, packages/web/src/client.ts, and the bootstrap runtime. Then trace the existing serialization and streaming flow and inspect createJSONSerializer and createJSONDataTable. Done means an opt-in inert data mode with a fixed pump handles streamed values and hydration tasks, is covered by byte-exact fixtures, and adds no bytes when disabled.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Split out of #4028 (proposal 1). Deferred until after 2.0.
Problem
Hydration data is currently executable JS: each flush writes an inline script that assigns seroval output into _$HY.r. Fragment swaps ($df), head ops, the shell-end marker and redirects are inline scripts too.
Under a strict CSP an inline script runs only with a per-request nonce or a listed hash. A cached or CDN-served SSR page can't carry a fresh nonce. Hashes don't help either, because the data scripts' bodies differ per page, so the CSP header can't be written ahead of time.
#4161 made async-mode output deterministic, so the same data now gives the same bytes and the same hashes. That doesn't help when the data itself differs.
Idea
- Inert data: emit values as
type="application/json"script blocks. The browser never executes them, so CSP doesn't apply. - Fixed pump: one runtime script whose bytes are identical on every render, so its hash is a build-time constant for a static CSP header. It decodes the JSON blocks into
_$HY.rand settles streamed promises. Streaming chunks are each followed by the same constant trigger script. - Today's executable tasks (fragment swaps, head ops, shell-end marker) become data records the pump applies. The redirect becomes a meta refresh.
Cost and constraints
- JSON can't express seroval's JS output (shared and cyclic refs, promises, Maps, Dates), so the data uses the JSON data-table format (
createJSONSerializer/createJSONDataTable) plus a client decoder. - This is a second hydration wire format to keep in sync on both server (
packages/web/src/server.ts) and client (packages/solid/src/client/hydration.ts,packages/web/src/client.ts, the bootstrap runtime). - It must be opt-in and pay-for-use: apps that don't enable it should ship zero extra bytes, with the decoder tree-shaken away.
- Rough estimate: 600–1,000 lines plus byte-exact fixtures.
Who needs it: apps serving cached or static SSR HTML under a hash-based CSP. Nonce-based CSP works today.
- Ngôn ngữ chính
- TypeScript
- Star
- 36.2k
- Fork
- 1.1k
- Merge trung bình
- 11 giờ 17 phút
- Pull request đã merge (30 ngày)
- 371
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của solidjs/solid
-
`lazy()`: remounting an already-loaded component renders empty (or the Suspense fallback) since 1.9.14Có thể đã có người làm @itisrmk đã nhận 5 ngày trước. Đang mở1.x
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
solidjs/solid#4182 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`createRoot`'s dispose function keeps `fn` alive, so `<For>`/`<Index>` rows retain removed list itemsCó thể đã có người làm @boombang đã nhận 7 ngày trước. Đang mở1.x
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 45/100
Maintainer thường phản hồi trong vòng 1 ngày
-
signals: a landing reveals a held write its stale reader re-derives onto a new flight (U-5, D-9)Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 12/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của solidjs/solid
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
maniator/verticopolis#1303 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
components-web-app/docs#297 ·
-
listFeatures/getFeatureExamples never return Kotlin examples for Android or server Kotlin SDKsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
appwrite/mcp-for-docs#23 · 1 bình luận ·
-
`@vanilla-extract/turbopack-plugin`: "getImageSize is not a function" with Next.js 16.4.x when a `.css.ts` file imports an imageCó thể đã có người làm @aevarOrigo đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
vanilla-extract-css/vanilla-extract#1799 · 1 bình luận ·
-
native
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
prime-radiant-inc/evener#4839 ·
Maintainer thường phản hồi trong vòng 1 ngày