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

Support additional context for route generation #2113

Merged
merged 3 commits into from
Dec 18, 2023

Conversation

NiklasEi
Copy link
Contributor

Using Leptos as a static site generator currently has two main steps:

  1. generating routes
  2. building static routes

The second step allows passing additional context (e.g. global state) via build_static_routes_with_additional_context that can then be used in components, but the first step doesn't. This means all components that get evaluated during step 1 will fail to get the additional context, while others that are only evaluated during 2 will be able to use it.

This PR adds support for additional context during step 1

@benwis
Copy link
Contributor

benwis commented Dec 18, 2023

Interesting, this definitely seems like a nice fix. I wonder why the actix check failed

@gbj
Copy link
Collaborator

gbj commented Dec 18, 2023

The failing checks are all failing on clippy on leptos_reactive (or another leptos crate), I think because of some disagreement between Rust versions over whether the type_name_of_val feature is stabilized. Hopefully fixed in a4bd7c4

This looks good in any case. Thanks so much!

@gbj gbj merged commit fb0a62f into leptos-rs:main Dec 18, 2023
43 of 59 checks passed
@NiklasEi NiklasEi deleted the additional_context_for_route_generation branch December 18, 2023 08:37
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.

3 participants