Skip to content

Commit

Permalink
Merge branch 'main' into leptos_v0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
gbj authored Jan 19, 2024
2 parents e9f7af4 + dd5a0ae commit 0ba713b
Show file tree
Hide file tree
Showing 23 changed files with 93 additions and 847 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/get-example-changed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
uses: tj-actions/changed-files@v41
with:
files: |
examples
examples/**
!examples/cargo-make
!examples/gtk
!examples/Makefile.toml
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/get-leptos-changed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ jobs:
uses: tj-actions/changed-files@v41
with:
files: |
integrations
leptos
leptos_config
leptos_dom
leptos_hot_reload
leptos_macro
leptos_reactive
leptos_server
meta
router
server_fn
server_fn_macro
integrations/**
leptos/**
leptos_config/**
leptos_dom/**
leptos_hot_reload/**
leptos_macro/**
leptos_reactive/**
leptos_server/**
meta/**
router/**
server_fn/**
server_fn_macro/**
- name: List source files that changed
run: echo '${{ steps.changed-source.outputs.all_changed_files }}'
Expand Down
4 changes: 4 additions & 0 deletions examples/router/e2e/tests/router.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ test.describe("Test Router example", () => {
await page.goto("/");
});

test("Starts on correct home page", async({ page }) => {
await expect(page.getByText("Select a contact.")).toBeVisible();
});

const links = [
{ label: "Bill Smith", url: "/0" },
{ label: "Tim Jones", url: "/1" },
Expand Down
3 changes: 1 addition & 2 deletions examples/ssr_modes/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ use thiserror::Error;
pub fn App() -> impl IntoView {
// Provides context that manages stylesheets, titles, meta tags, etc.
provide_meta_context();
let fallback = || view! { "Page not found." }.into_view();

view! {
<Stylesheet id="leptos" href="/pkg/ssr_modes.css"/>
<Title text="Welcome to Leptos"/>

<Router fallback>
<Router>
<main>
<Routes>
// We’ll load the home page with out-of-order streaming and <Suspense/>
Expand Down
3 changes: 1 addition & 2 deletions examples/ssr_modes_axum/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ use thiserror::Error;
pub fn App() -> impl IntoView {
// Provides context that manages stylesheets, titles, meta tags, etc.
provide_meta_context();
let fallback = || view! { "Page not found." }.into_view();

view! {
<Stylesheet id="leptos" href="/pkg/ssr_modes.css"/>
<Title text="Welcome to Leptos"/>

<Router fallback>
<Router>
<main>
<Routes>
// We’ll load the home page with out-of-order streaming and <Suspense/>
Expand Down
5 changes: 2 additions & 3 deletions examples/todo_app_sqlite/src/todo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ pub mod ssr {
}
}

// This is an example of leptos's server functions using an alternative CBOR encoding. Both the function arguments being sent
// to the server and the server response will be encoded with CBOR. Good for binary data that doesn't encode well via the default methods
#[server(encoding = "Cbor")]
/// Server functions can be given doc comments.
#[server(GetTodos, "/api")]
pub async fn get_todos() -> Result<Vec<Todo>, ServerFnError> {
use self::ssr::*;

Expand Down
148 changes: 0 additions & 148 deletions integrations/actix/tests/extract_routes.rs

This file was deleted.

4 changes: 2 additions & 2 deletions leptos_dom/src/hydration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ mod hydrate_only {
}
});

pub static IS_HYDRATING: Cell<bool> = Cell::new(true);
pub static IS_HYDRATING: Cell<bool> = const { Cell::new(true) };
}

#[allow(unused)]
Expand Down Expand Up @@ -133,7 +133,7 @@ mod tests {
}
}

thread_local!(static ID: RefCell<HydrationKey> = RefCell::new(HydrationKey { outlet: 0, fragment: 0, error: 0, id: 0 }));
thread_local!(static ID: RefCell<HydrationKey> = const {RefCell::new(HydrationKey { outlet: 0, fragment: 0, error: 0, id: 0 })});

/// Control and utility methods for hydration.
pub struct HydrationCtx;
Expand Down
4 changes: 2 additions & 2 deletions leptos_dom/src/macro_helpers/tracing_property.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ fn match_primitive() {
assert_eq!(prop, r#"{"name": "test", "value": -1}"#);

// f64
let test = 3.14;
let test = 3.25;
let prop = (&&Match {
name: stringify! {test},
value: std::cell::Cell::new(Some(&test)),
})
.spez();
assert_eq!(prop, r#"{"name": "test", "value": 3.14}"#);
assert_eq!(prop, r#"{"name": "test", "value": 3.25}"#);

// bool
let test = true;
Expand Down
2 changes: 1 addition & 1 deletion leptos_reactive/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ cfg_if::cfg_if! {
use std::cell::Cell;

thread_local! {
static IS_SPECIAL_ZONE: Cell<bool> = Cell::new(false);
static IS_SPECIAL_ZONE: Cell<bool> = const { Cell::new(false) };
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion leptos_reactive/src/hydration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ impl Default for SharedContext {

#[cfg(feature = "experimental-islands")]
thread_local! {
pub static NO_HYDRATE: Cell<bool> = Cell::new(true);
pub static NO_HYDRATE: Cell<bool> = const { Cell::new(true) };
}

#[cfg(feature = "experimental-islands")]
Expand Down
2 changes: 1 addition & 1 deletion leptos_reactive/src/resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1518,7 +1518,7 @@ impl<S, T> UnserializableResource for ResourceState<S, T> {
}

thread_local! {
static SUPPRESS_RESOURCE_LOAD: Cell<bool> = Cell::new(false);
static SUPPRESS_RESOURCE_LOAD: Cell<bool> = const { Cell::new(false) };
}

#[doc(hidden)]
Expand Down
2 changes: 1 addition & 1 deletion leptos_reactive/src/stored_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ impl<T> StoredValue<T> {
with_runtime(|runtime| {
let n = {
let values = runtime.stored_values.borrow();
values.get(self.id).map(Rc::clone)
values.get(self.id).cloned()
};

if let Some(n) = n {
Expand Down
Loading

0 comments on commit 0ba713b

Please sign in to comment.