Skip to content
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 Axum integration #146

Merged
merged 47 commits into from
Jun 2, 2022
Merged

Add Axum integration #146

merged 47 commits into from
Jun 2, 2022

Conversation

arctic-hen7
Copy link
Member

This adds support for a third integration to Perseus, introducing a new package, perseus-axum. This integration has the exact same capabilities as the other two, but it will allow easier integration with existing Axum systems for those working with the lower levels of Perseus, as well as greater support for integrating Axum systems into Perseus when custom API routes are supported.

Closes #133.

arctic-hen7 and others added 30 commits April 20, 2022 20:00
Sycamore v0.8 only runs on Rust 2021.
Still have to do:
- `router/`
- `template/`
- `shell.rs`
- One tricky error in `error_pages.rs`
I removed the troublesome function in `error_pages.rs`, so that may bite
me soon.
Still have problems with `bind:value` (as we will in all the state
platform examples for now).
The remaining errors will be fixed after `make_rx` can work with
non-`Rc` `Signal`s.
Nothing works without hydration disabled though...
This *should* make the state platform work with lifetimes.
I have been shown a much better way of achieving the same outcome.
It will be easier to manually undo changes to make sure we preserve some
good things.

This reverts commit 15187b5.
This avoids a huge number of lifetime issues, and actually ends up being
more performant, without compromising on ergonomics.
This should make Perseus several orders of magnitude more ergonomic, in
line with Sycamore's new no-clones system!
This requires an irritating change to import practices unfortunately,
but the convenience and ergonomics are worth it.
This also involved some minor changes to the macros to fix some nested
state issues.
This improves ergonomics and makes the auth example compile.
* refactor: simplify provide_context_signal_replace

Also slightly improves performance in only making a single call to use_context

* fix: do not insert hydration keys in the head string

* chore: remove perseus/hydrate feature from Cargo.toml

* chore: merge imports for consistent code style

* fix: update sycamore to v0.8.0-beta.5 and remove workaround

Co-authored-by: arctic_hen7 <arctic_hen7@pm.me>
These were just for the demos that weren't ready at the time of the PR.
Hydration still doesn't work in the `auth` example.
@arctic-hen7
Copy link
Member Author

This branch was created halfway through the update to the latest Sycamore version, hence the obscene number of commits. There are actually very few changes in here!

Just some simple errors made this fail. Hopefully, all tests should now pass...
@arctic-hen7 arctic-hen7 merged commit dbe8207 into main Jun 2, 2022
@arctic-hen7 arctic-hen7 deleted the feat-axum-integration branch June 2, 2022 10:14
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.

Add Axum integration
2 participants