feat: add actix support for yew-link#4113
Conversation
|
The workflow error is a network request error. I assume the workflow could be re-run as I don't see any reason why would that specific workflow fail. |
|
I restarted the workflow |
Madoshakalaka
left a comment
There was a problem hiding this comment.
I merged master into the yew-link branch. Can you merge from yew-link first and then address the reviews?
It's quite late in here, I will address it tomorrow when I have the chance. |
|
I didn't realize you meant the |
Madoshakalaka
left a comment
There was a problem hiding this comment.
Can you also come up with an SSR actix-web example in examples and extend tools/ssr-e2e to test it? Possibly will also involve tweaking the end of .github/workflows/main-checks.yml. Also don't forget to include it in the table in examples/README.md
It's quite important because
- I don't personally use actix-web so I have less confidence this works perfectly.
- It will be our first actix example (we had warp and axum examples only)
- this will lend us more confidence in future refactoring.
|
About tweaking |
|
Ok, so on my side I have resolved the merge conflict, now the |
…to-stifskere # Conflicts: # Cargo.lock # examples/actix_ssr_router/src/lib.rs # examples/axum_ssr_router/src/bin/ssr_router_server.rs # packages/yew-link/src/lib.rs
|
Thanks. I took the liberty of merging some un-resolved changes. Changes look good with a few more details like i18n to iron out. I'll ask my clanker to synchronize doc changes to the i18n pages. Can you leave it to me? |
For sure, ping me on discord or here if you need anything. |
|
good |
The linked_state_handler in yew-link extracts Data<Resolver>, but the server only registered Data<AppState>, returning 500. Install the inner Arc<Resolver> as Data<Resolver> via app_data alongside the AppState. Also set content_type=text/html on the SSR streaming response so browsers render it instead of downloading it.
There was a problem hiding this comment.
I think this PR is complete now.
An extra refactoring opportunity is to extract common code between axum_ssr_router and actix_ssr_router.
I'm against it because examples are meant to show users straightforwardly how our code works. We should not require them to navigate between multiple abstractions irrelevant to their final project structure.
So this will stay as some intentional duplication.
Note we already made the two examples rely on a central ssr_router client-side-only example. This is a prior decision and I'm not sure if we should go out of our way to undo it.
Description
Adds
actix_websupport for theyew_linkcrate introduced in #4027.Checklist