Client setup seam: run app code before the generated entry's hydrate (start.clientSetup)
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
- 25/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ệ
- typescript, vite
- Lĩnh vực
- build-system, frontend
Hướng nghiên cứu
This is a design decision, not a ready-to-code task: the issue asks for a start.clientSetup option or a <ClientEntry /> component, and the maintainers have not chosen between them. Start with the code that generates the client entry and the existing start.instrument server hook, which the issue uses as the model. Done means a maintainer agrees on the API and the generated entry runs the setup module before hydrate.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
@solidjs/vite-plugin 3.0.0-next.50, solid-js 2.0.0-rc.15.
The generated client entry calls hydrate straight away, and there is no place for app code that has to run in the browser before hydration. Our real cases:
- Installing a server-function transport wrapper that detects a response from another build (version skew) and reloads. It must be in place before the first render fires the page's reads.
- A request-header hook on that transport, for example a tenant selector header the server functions need.
- Registering the
vite:preloadErrorlistener before any lazy route chunk loads. - Reading a third-party global that a classic
<script>in<body>defines (Telegram'stelegram-web-app.js). Today the generated entry is anasyncmodule in<head>, so its order relative to that script is not guaranteed. #411 / solidjs/solid#4002 fixed hydration itself here, but not setup code that reads globals.
Because of this we keep authored entry-client.tsx / entry-server.tsx pairs only to run three lines before hydrate. That means we also carry the Document + hydrate(…, document) boilerplate that the generated entries would give us.
Suggestion (either works for us):
start.clientSetup: './src/client-setup.ts'. The generated client entry doesawait import(setup)(or a static import placed first) beforehydrate. This mirrorsstart.instrumenton the server.- A
<ClientEntry />component that the document places where it wants (for example at the end of<body>), with the setup module option above.
Option 1 alone would let us delete both authored entries.
- Ngôn ngữ chính
- TypeScript
- Star
- 522
- Fork
- 73
- Merge trung bình
- 1 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 35
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không 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-vite-plugin
-
Test environment detection doesn't consider Vitest workspacesCó thể đã có người làm @carloitaben đã nhận 56 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 78/100
solidjs/solid-vite-plugin#205 · 1 bình luận · 2 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
solidjs/solid-vite-plugin#428 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
solidjs/solid-vite-plugin#427 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Dev: a stylesheet shared by the entry and a lazy component moves after the lazy component's stylesĐang mở
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 62/100
solidjs/solid-vite-plugin#425 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[3.0.0-next.50 / next] SSR build: the $$moduleUrl export added to a Worker main module stops workerd from startingCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 55/100
solidjs/solid-vite-plugin#420 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của solidjs/solid-vite-plugin
Issue tương tự
-
area:security documentation effort:S priority:P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
app:web meta:ops
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 78/100
osu-tournament-rating/otr#1113 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
typegoose/mongodb-memory-server#1040 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 92/100