Skip to content

feat(rsc): add ability to access client entry URL from ssr environment and deprecate loadBootstrapScriptContent - #1360

Merged
hi-ogawa merged 5 commits into
mainfrom
fix/issue-1359
Jul 30, 2026
Merged

feat(rsc): add ability to access client entry URL from ssr environment and deprecate loadBootstrapScriptContent#1360
hi-ogawa merged 5 commits into
mainfrom
fix/issue-1359

Conversation

@hi-ogawa

@hi-ogawa hi-ogawa commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

This PR adds getClientEntryUrl as @vitejs/plugin-rsc/ssr runtime API and deprecate old import.meta.viteRsc.loadBootstrapScriptContent API.

Co-authored-by: OpenCode <noreply@opencode.ai>
@hi-ogawa hi-ogawa changed the title feat(rsc): expose client entry URL feat(rsc): expose client entry URL from /ssr Jul 30, 2026
hi-ogawa and others added 4 commits July 30, 2026 17:10
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
@hi-ogawa
hi-ogawa marked this pull request as ready for review July 30, 2026 08:25
@hi-ogawa hi-ogawa changed the title feat(rsc): expose client entry URL from /ssr feat(rsc): add API to access client entry URL from /ssr runtime Jul 30, 2026
@hi-ogawa hi-ogawa changed the title feat(rsc): add API to access client entry URL from /ssr runtime feat(rsc): ability to access client entry URL from ssr environment and deprecate loadBootstrapScriptContent Jul 30, 2026
@hi-ogawa hi-ogawa changed the title feat(rsc): ability to access client entry URL from ssr environment and deprecate loadBootstrapScriptContent feat(rsc): add ability to access client entry URL from ssr environment and deprecate loadBootstrapScriptContent Jul 30, 2026
@hi-ogawa
hi-ogawa merged commit c2e0273 into main Jul 30, 2026
26 checks passed
@hi-ogawa
hi-ogawa deleted the fix/issue-1359 branch July 30, 2026 08:29
dai-shi added a commit to wakujs/waku that referenced this pull request Aug 6, 2026
Fixes #2238.

The vite:preloadError listener lived inside entry.browser.tsx, so it
could not cover a load failure of the entry chunk itself, and the
plugin-rsc bootstrap import() dispatches no event on rejection.

- Register the listener from the bootstrap preamble, before the entry
import runs
- Update @vitejs/plugin-rsc to 0.5.33 and build the bootstrap import
from getClientEntryUrl() (vitejs/vite-plugin-react#1360), dispatching
vite:preloadError from its catch like Vite's __vitePreload does
- Allow one recovery reload per build id, tracked in sessionStorage.
Without the cap a broken build reloads forever. If storage is blocked,
recovery is skipped instead of looping
- Wait for DOMContentLoaded before reloading, since the entry chunk
fails while the HTML is still streaming

Behavior notes: recovery is production only (dev no longer reloads on
vite:preloadError), and the one retry per build id can be spent by a
transient chunk failure.
lqhuang pushed a commit to lqhuang/waku that referenced this pull request Aug 7, 2026
…#2240)

Fixes wakujs#2238.

The vite:preloadError listener lived inside entry.browser.tsx, so it
could not cover a load failure of the entry chunk itself, and the
plugin-rsc bootstrap import() dispatches no event on rejection.

- Register the listener from the bootstrap preamble, before the entry
import runs
- Update @vitejs/plugin-rsc to 0.5.33 and build the bootstrap import
from getClientEntryUrl() (vitejs/vite-plugin-react#1360), dispatching
vite:preloadError from its catch like Vite's __vitePreload does
- Allow one recovery reload per build id, tracked in sessionStorage.
Without the cap a broken build reloads forever. If storage is blocked,
recovery is skipped instead of looping
- Wait for DOMContentLoaded before reloading, since the entry chunk
fails while the HTML is still streaming

Behavior notes: recovery is production only (dev no longer reloads on
vite:preloadError), and the one retry per build id can be spent by a
transient chunk failure.
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.

Expose the Client Entry URL from the SSR Runtime

1 participant