feat: add SSR e2e hydration tests for simple_ssr and ssr_router#4046
Merged
Madoshakalaka merged 5 commits intomasterfrom Mar 6, 2026
Merged
feat: add SSR e2e hydration tests for simple_ssr and ssr_router#4046Madoshakalaka merged 5 commits intomasterfrom
Madoshakalaka merged 5 commits intomasterfrom
Conversation
Member
Author
Size ComparisonDetails
✅ None of the examples has changed their size significantly. |
WorldSEnder
reviewed
Mar 5, 2026
WorldSEnder
reviewed
Mar 5, 2026
WorldSEnder
reviewed
Mar 5, 2026
Benchmark - coreYew MasterPull Request |
|
Visit the preview URL for this PR (updated for commit 3088482): https://yew-rs-api--pr4046-e2e-ay5tps8a.web.app (expires Fri, 13 Mar 2026 16:23:05 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
Benchmark - SSRYew MasterDetails
Pull RequestDetails
|
Member
Author
|
I think the CI failure is caused by the stablization of the include config key with rust 1.94 today. Addressing in a different PR |
Introduces ssr-e2e orchestrator (trunk build, server start, wasm-bindgen-test runner) and ssr-e2e-harness (shared wasm32 test utilities). Adds e2e tests that fetch SSR-rendered HTML, inject it into the wasm-bindgen-test output element, and hydrate against it to verify no hydration panics. Also adds CORS support to both SSR servers for cross-origin test fetches and a CI workflow job.
WorldSEnder
previously approved these changes
Mar 6, 2026
tools/ssr-e2e/src/main.rs
Outdated
Comment on lines
+95
to
+97
| unsafe { | ||
| libc::kill(-(id as i32), libc::SIGTERM); | ||
| } |
Member
There was a problem hiding this comment.
Two small comments here:
- Ignores the return value without being explicit about as below
- Technically this races for the pid. The server could exit (crash?) and get replaced by a different process with the same process id which would get the axe. Avoidable only with nightly API though and unlikely to happen since the server is supposed to keep running.
Member
Author
There was a problem hiding this comment.
good point. made the first return explicit.
2 tasks
747487d
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds end-to-end hydration tests for SSR examples (
simple_ssr,ssr_router) usingwasm-bindgen-testas the browser test runner. This is a pure-Rust E2E testing approach that requires no non-Rust dependencies like Playwright, Cypress, or Selenium.(There were a lot of past discussion on e2e frameworks. My impression was that maintainers generally didn't want to introduce them. e.g. @its-the-shrimp was against introducing more javascript deps, @futursolo slightly favored playwright but was also slightly reluctant on introducing it)
closes #196 (open since 2018).
New crates
tools/ssr-e2e-- test orchestrator that runstrunk build, starts the SSR server, waits for it to become healthy, runscargo test(wasm-bindgen-test) against the server, and tears everything down.tools/ssr-e2e-harness-- shared wasm32 library providing test utilities: fetching SSR HTML, injecting it into the wasm-bindgen-test output element, polling helpers, History API push.Other changes
simple_ssr(warp) andssr_router(axum) servers so cross-origin fetches from the wasm-bindgen-test browser context succeed.wasm-bindgen-testadded to workspace dependencies.ssr_e2e_testsadded tomain-checks.ymlwith a matrix over both examples.(Not) The only gap
One gap compared to a full E2E framework is screenshot/visual regression testing, which is being addressed upstream in wasm-bindgen#5014.