Skip to content

feat: axum v0.8 support - #168

Merged
jplatte merged 1 commit into
tamasfe:masterfrom
devmaxde:axum_compatible
Jan 9, 2025
Merged

feat: axum v0.8 support#168
jplatte merged 1 commit into
tamasfe:masterfrom
devmaxde:axum_compatible

Conversation

@devmaxde

@devmaxde devmaxde commented Jan 3, 2025

Copy link
Copy Markdown
Contributor

fixes #167

Based on this announcement

@JakkuSakura JakkuSakura left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you for the quick update to axum v0.8. I see there are a few changes regarding Sync. Any reason for these? I'm afraid that they may break old code. The rest looks fine

fn test_nesting_with_nondefault_state() {
let _app: ApiRouter = ApiRouter::new()
.nest_api_service("/", ApiRouter::new().with_state(1_isize))
.nest_api_service("/home", ApiRouter::new().with_state(1_isize))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why is the change here needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Bildschirmfoto 2025-01-03 um 03 54 46

pub fn nest_service<T>(mut self, path: &str, svc: T) -> Self
where
T: Service<Request<Body>, Error = Infallible> + Clone + Send + 'static,
T: Service<Request<Body>, Error = Infallible> + Clone + Send + 'static + std::marker::Sync,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why add new Sync trait bound?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Tbh. It's what the compiler complained about

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@devmaxde

devmaxde commented Jan 3, 2025

Copy link
Copy Markdown
Contributor Author

It will break the old code. That's for sure. The reason for this is, that Axum dropped the support for the async—trait.

@JakkuSakura

Copy link
Copy Markdown
Collaborator

I dug into the axum code. It's not because they dropped async-trait, but they added Sync when they dropped

@devmaxde
devmaxde marked this pull request as draft January 3, 2025 02:59
@devmaxde

devmaxde commented Jan 3, 2025

Copy link
Copy Markdown
Contributor Author

I made it into a Draft to test it on my own Project. I just saw, that there are not that many tests

@JakkuSakura

JakkuSakura commented Jan 3, 2025

Copy link
Copy Markdown
Collaborator

Could you bump aide to 0.14.0 as it's a breaking change unavoidably?

Other crates under crates/* and examples/* also need to bump version and use latest aide + axum combo

@devmaxde
devmaxde force-pushed the axum_compatible branch 2 times, most recently from 3abeb84 to aefb133 Compare January 3, 2025 03:21
@devmaxde

devmaxde commented Jan 3, 2025

Copy link
Copy Markdown
Contributor Author

To make sure there isn't a misunderstanding. I cant fix the aide-axum-typed-multipart crate, because it hast implemented the change itself. In my Project everything worked fine. But im not a fan of the nest_api_service changes :/

@devmaxde
devmaxde marked this pull request as ready for review January 3, 2025 03:24
@JakkuSakura

Copy link
Copy Markdown
Collaborator

I see. This PR is needed
murar8/axum_typed_multipart#95

@devmaxde

devmaxde commented Jan 3, 2025

Copy link
Copy Markdown
Contributor Author

I don't think, we should wait for it. I tried implementing it right now, but this package need to update the axum-test-helper package to get the tests to run.

@devmaxde

devmaxde commented Jan 3, 2025

Copy link
Copy Markdown
Contributor Author

Welp:

murar8/axum_typed_multipart#97

@devmaxde devmaxde changed the title feat: axum v0.8 compatible feat: axum v0.8 support Jan 3, 2025
@devmaxde

devmaxde commented Jan 4, 2025

Copy link
Copy Markdown
Contributor Author

Question:
Do we want to wait until Axum_typed_mulipart is supported or just merge without it?

@devmaxde

devmaxde commented Jan 6, 2025

Copy link
Copy Markdown
Contributor Author

The Axum-typed-multipart works now. The Action Fails, due to the missing crates.io entry.
How should I proceed? Proceeding with the lower version and you bump it later or just merge with the correct bumped version

feat: axum-typed-multipart
@JakkuSakura

Copy link
Copy Markdown
Collaborator

I suggest just wait for a while.

@devmaxde

devmaxde commented Jan 6, 2025

Copy link
Copy Markdown
Contributor Author

It was a bug. I missed something. I forgot to update the aide version in one of the crates. Thats why it failed to build them from the path. Now with the last "force-push" it should work

@devmaxde
devmaxde requested a review from JakkuSakura January 7, 2025 17:51
@jplatte

jplatte commented Jan 8, 2025

Copy link
Copy Markdown
Collaborator

Dang, I missed this PR! Just posted my own (#170). Let me see where the differences are..

@devmaxde

devmaxde commented Jan 9, 2025

Copy link
Copy Markdown
Contributor Author

Your GithubAction is failing. Thats one of the differences xD

@jplatte

jplatte commented Jan 9, 2025

Copy link
Copy Markdown
Collaborator

Yeah, I failed to update a few things in packages we likely want to drop anyways. Have opened a separate PR for that.

Still, we can probably merge this first and get all of the other improvements from my PR in separately. I'll review your changes + the existing comments.

@jplatte
jplatte merged commit e2cac60 into tamasfe:master Jan 9, 2025
@jplatte

jplatte commented Jan 9, 2025

Copy link
Copy Markdown
Collaborator

@JakkuSakura hope you don't mind that I merged this. There's some things I still want to improve about the upgrade, but it seemed like a good first step to get it in.

@jplatte

jplatte commented Jan 9, 2025

Copy link
Copy Markdown
Collaborator

#170 has now been rebased on top of this.

@JakkuSakura

JakkuSakura commented Jan 9, 2025

Copy link
Copy Markdown
Collaborator

@jplatte it's ok. I'm just a bit conservative on this kind of PR. It has larger impact to users. With your approval it would be sufficient

@devmaxde
devmaxde deleted the axum_compatible branch January 9, 2025 09:55
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.

Breaking changes in Axum 0.8.0

4 participants