-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add WASI support for server-side rendering. #3534
Conversation
It would be modified later after the corresponding library branches are merged.
Benchmark - coreYew Master
Pull Request
|
Visit the preview URL for this PR (updated for commit 4a3b79f): https://yew-rs--pr3534-wasi-support-test-8w8rolp5.web.app (expires Mon, 02 Sep 2024 02:55:49 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
Benchmark - SSRYew Master
Pull Request
|
Size Comparison
✅ None of the examples has changed their size significantly. |
Co-authored-by: WorldSEnder <WorldSEnder@users.noreply.github.com>
…browser environment.
5cc0207
to
4a3b79f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for your patience. My apologies for how long it took to review
@WorldSEnder this is pending your review. If you're unable to review, I'll dismiss the previous (now-resolved) review and get this merged |
@langyo can you please undo the formatting changes your editor did in the meantime? I'll merge this PR on Monday if @WorldSEnder doesn't respond by then |
8d07370
to
6155846
Compare
6155846
to
cc486a4
Compare
Review already addressed, need to dismiss to merge PR
Merging this (finally!). Any changes needed can come in further PRs |
Description
I've been trying to use
yew
to render the page into the static HTML string on WASI. However,yew
cannot distinguish the browser WASM target (wasm32-unknown-unknown
withwasm-bindgen
) and WASI target (wasm32-wasi
), and it would choose wrong modules forwasm32-*
.In addition, since the current SSR implementation will create new tasks directly in the asynchronous context directly (based on
prokio
). It only allowed in a multi-threaded environment that it is not compatible with WASI. So I added a dedicated one for a single-threaded environment that rendering function to support single-threaded scenes.To support this new feature, I have also made changes along with some other upstream dependencies. I've created some PRs for these upstream dependencies, and added a temporary patch entry to the root Cargo.toml for this PR. If the upstream branch can be processed, these temporary patch entries could be replaced.
I also wrote a short example for this new feature.
CC @futursolo 😉
Checklist