-
Notifications
You must be signed in to change notification settings - Fork 87
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
Upgrade to Sycamore v0.8.0 #142
Conversation
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.
@@ -613,7 +613,8 @@ impl<G: Html, M: MutableStore, T: TranslationsManager> PerseusAppBase<G, M, T> { | |||
/// The component that represents the entrypoint at which Perseus will inject itself. You can use this with the `.index_view()` method of `PerseusApp` to avoid having to create the entrypoint | |||
/// `<div>` manually. | |||
#[component] | |||
pub fn perseus_root<G: Html>(cx: Scope) -> View<G> { | |||
#[allow(non_snake_case)] |
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.
The #[component]
attribute already adds this so it's not necessary
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.
That didn't seem to work for me before...I'll try again.
@arctic-hen7 Sorry forgot to ping you but I released a new version of sycamore ( |
This should fix the issues with the `body` element.
As I alluded to in #145, I'll leave the docs mostly not updated for this version for now, because I want to rewrite most of them in a new way (still working on what exactly that will be), and I want to get a rolling-release beta out as soon as possible. With some minor docs updates, this should be good to merge! |
Also locked the old v0.3.4-5 docs to a specific commit hash, which keeps the examples there safe to use.
This upgrades Perseus to use the latest Sycamore reactive primitives, which will be the foundation of the new v0.4.0 beta. I plan to release that once some other small breaking changes have been made that have been in the works for a while, and then a rolling-release cycle, as with v0.3.0, will be used to add further new features.
Also, thank you very much @lukechu10 for your invaluable assistance with this update!