Skip to content

feat: add actix support for yew-link#4113

Merged
Madoshakalaka merged 19 commits intoyewstack:yew-linkfrom
stifskere:yew-link
Apr 7, 2026
Merged

feat: add actix support for yew-link#4113
Madoshakalaka merged 19 commits intoyewstack:yew-linkfrom
stifskere:yew-link

Conversation

@stifskere
Copy link
Copy Markdown

Description

Adds actix_web support for the yew_link crate introduced in #4027.

Checklist

  • I have reviewed my own code
  • I have added tests

@stifskere
Copy link
Copy Markdown
Author

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.

@Madoshakalaka
Copy link
Copy Markdown
Member

I restarted the workflow

Copy link
Copy Markdown
Member

@Madoshakalaka Madoshakalaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I merged master into the yew-link branch. Can you merge from yew-link first and then address the reviews?

@stifskere
Copy link
Copy Markdown
Author

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.

@stifskere stifskere requested a review from Madoshakalaka April 4, 2026 22:19
@stifskere
Copy link
Copy Markdown
Author

I didn't realize you meant the ,, I thought you meant the use statements xD.

Copy link
Copy Markdown
Member

@Madoshakalaka Madoshakalaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  1. I don't personally use actix-web so I have less confidence this works perfectly.
  2. It will be our first actix example (we had warp and axum examples only)
  3. this will lend us more confidence in future refactoring.

@Madoshakalaka Madoshakalaka added the A-yew-link Area: The yew-link crate label Apr 4, 2026
@stifskere
Copy link
Copy Markdown
Author

About tweaking ssr-e2e, I don't think it's needed because the whole point of actix_web is making things simpler, there is no external needs or dependencies, if it worked with Axum, it can work with actix_web meanwhile it has the same configuration.

@stifskere
Copy link
Copy Markdown
Author

Ok, so on my side I have resolved the merge conflict, now the yewstack/yew:yew-link branch must be updated.

…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
@Madoshakalaka
Copy link
Copy Markdown
Member

Madoshakalaka commented Apr 7, 2026

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?

@stifskere
Copy link
Copy Markdown
Author

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.

@Madoshakalaka
Copy link
Copy Markdown
Member

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.
Copy link
Copy Markdown
Member

@Madoshakalaka Madoshakalaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Madoshakalaka Madoshakalaka merged commit d4f595e into yewstack:yew-link Apr 7, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-yew-link Area: The yew-link crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants