diff --git a/packages/sycamore-futures/src/suspense.rs b/packages/sycamore-futures/src/suspense.rs index e4cc10d1..af28d03a 100644 --- a/packages/sycamore-futures/src/suspense.rs +++ b/packages/sycamore-futures/src/suspense.rs @@ -133,18 +133,18 @@ pub fn create_suspense_task(f: impl Future + 'static) { }); } -/// Create a new suspense scope that is detatched from the rest of the suspense hierarchy. +/// Create a new suspense scope that is detached from the rest of the suspense hierarchy. /// -/// This is useful if you want the result of this suspense to be independent of the praent suspense +/// This is useful if you want the result of this suspense to be independent of the parent suspense /// scope. /// -/// It is rarely recommended to use this fucntion as it can lead to unexpected behavior when using +/// It is rarely recommended to use this function as it can lead to unexpected behavior when using /// server side rendering, and in particular, streaming. Instead, use [`create_suspense_scope`]. /// /// The reason for this is because we generally expect outer suspenses to be resolved first before /// an inner suspense is resolved, since otherwise we would have no place to show the inner suspense /// as the outer fallback is still being displayed. -pub fn create_detatched_suspense_scope(f: impl FnOnce() -> T) -> (T, SuspenseScope) { +pub fn create_detached_suspense_scope(f: impl FnOnce() -> T) -> (T, SuspenseScope) { let scope = SuspenseScope::new(None); provide_context_in_new_scope(scope, move || { let ret = f(); @@ -152,6 +152,12 @@ pub fn create_detatched_suspense_scope(f: impl FnOnce() -> T) -> (T, Suspense }) } +// TODO: remove this in the next major version +#[deprecated = "Please use `create_detached_suspense_scope` instead"] +pub fn create_detatched_suspense_scope(f: impl FnOnce() -> T) -> (T, SuspenseScope) { + create_detached_suspense_scope(f) +} + /// Calls the given function and registers all suspense tasks. /// /// Returns a tuple containing the return value of the function and the created suspense scope. diff --git a/packages/sycamore-macro/src/props.rs b/packages/sycamore-macro/src/props.rs index 81b6a63c..1c43f2c0 100644 --- a/packages/sycamore-macro/src/props.rs +++ b/packages/sycamore-macro/src/props.rs @@ -655,7 +655,7 @@ mod struct_info { ); }); - let descructuring = self.included_fields().map(|f| f.name); + let destructuring = self.included_fields().map(|f| f.name); let helper_trait_name = &self.conversion_helper_trait_name; // The default of a field can refer to earlier-defined fields, which we handle by @@ -684,7 +684,7 @@ mod struct_info { // I'd prefer “a” or “an” to “its”, but determining which is grammatically // correct is roughly impossible. let doc = - format!("Finalise the builder and create its [`{}`] instance", name); + format!("Finalize the builder and create its [`{}`] instance", name); quote!(#[doc = #doc]) } } @@ -703,7 +703,7 @@ mod struct_info { #doc #[allow(clippy::default_trait_access)] pub fn build(self) -> #name #ty_generics { - let ( #(#descructuring,)* ) = self.fields; + let ( #(#destructuring,)* ) = self.fields; #( #assignments )* #name { #( #field_names, )* diff --git a/packages/sycamore-reactive/src/effects.rs b/packages/sycamore-reactive/src/effects.rs index 6cdcab49..ab1119df 100644 --- a/packages/sycamore-reactive/src/effects.rs +++ b/packages/sycamore-reactive/src/effects.rs @@ -53,7 +53,7 @@ pub fn create_effect(f: impl FnMut() + 'static) { /// ``` /// /// Note that the initial function is also called within the effect scope. This means that signals -/// created within the initial function will no longer be alive in subsequet runs. If you want to +/// created within the initial function will no longer be alive in subsequent runs. If you want to /// create signals that are alive in subsequent runs, you should use /// [`use_current_scope`](crate::use_current_scope) and /// [`NodeHandle::run_in`](crate::NodeHandle::run_in). diff --git a/packages/sycamore-reactive/src/maybe_dyn.rs b/packages/sycamore-reactive/src/maybe_dyn.rs index 9b11515f..c6cb1d65 100644 --- a/packages/sycamore-reactive/src/maybe_dyn.rs +++ b/packages/sycamore-reactive/src/maybe_dyn.rs @@ -116,7 +116,7 @@ impl, U: Into> + Clone> From> for MaybeDyn> From for MaybeDyn where F: Fn() -> U + 'static, diff --git a/packages/sycamore-reactive/src/memos.rs b/packages/sycamore-reactive/src/memos.rs index f25ea6c9..7986060a 100644 --- a/packages/sycamore-reactive/src/memos.rs +++ b/packages/sycamore-reactive/src/memos.rs @@ -92,7 +92,7 @@ pub fn create_memo(f: impl FnMut() -> T + 'static) -> ReadSignal { /// Creates a memoized value from some signals. /// -/// Unlike [`create_memo`], this function will not notify dependents of a hange if the output is the +/// Unlike [`create_memo`], this function will not notify dependents of a change if the output is the /// same. That is why the output of the function must implement [`PartialEq`]. /// /// To specify a custom comparison function, use [`create_selector_with`]. diff --git a/packages/sycamore-reactive/src/node.rs b/packages/sycamore-reactive/src/node.rs index 15409aa3..4cf4564f 100644 --- a/packages/sycamore-reactive/src/node.rs +++ b/packages/sycamore-reactive/src/node.rs @@ -11,7 +11,7 @@ new_key_type! { pub(crate) struct NodeId; } -/// A reactive node inside the reactive grpah. +/// A reactive node inside the reactive graph. pub(crate) struct ReactiveNode { /// Value of the node, if any. If this node is a signal, should have a value. pub value: Option>, diff --git a/packages/sycamore-reactive/src/root.rs b/packages/sycamore-reactive/src/root.rs index 3132ab0b..df3ca73b 100644 --- a/packages/sycamore-reactive/src/root.rs +++ b/packages/sycamore-reactive/src/root.rs @@ -30,7 +30,7 @@ pub(crate) struct Root { pub nodes: RefCell>, /// A list of signals who need their values to be propagated after the batch is over. pub node_update_queue: RefCell>, - /// Whether we are currently batching signal updatse. If this is true, we do not run + /// Whether we are currently batching signal updates. If this is true, we do not run /// `effect_queue` and instead wait until the end of the batch. pub batching: Cell, } @@ -167,7 +167,7 @@ impl Root { nodes_mut[current].dependents = dependents; } - /// If there are no cyclic dependencies, then the reactive graph is a DAG (Directed Acylic + /// If there are no cyclic dependencies, then the reactive graph is a DAG (Directed Acyclic /// Graph). We can therefore use DFS to get a topological sorting of all the reactive nodes. /// /// We then go through every node in this topological sorting and update only those nodes which diff --git a/packages/sycamore-reactive/src/signals.rs b/packages/sycamore-reactive/src/signals.rs index 57475980..f44041c4 100644 --- a/packages/sycamore-reactive/src/signals.rs +++ b/packages/sycamore-reactive/src/signals.rs @@ -78,7 +78,7 @@ pub struct Signal(pub(crate) ReadSignal); /// There are many other ways of getting and setting signals, such as /// [`.with(...)`](ReadSignal::with) and [`.update(...)`](Signal::update) which can access the /// signal even if it does not implement [`Clone`] or if you simply don't want to pay the -/// performance overhead of cloning your value everytime you read it. +/// performance overhead of cloning your value every time you read it. /// /// # Reactivity /// What makes signals so powerful, as opposed to some other wrapper type like @@ -105,7 +105,7 @@ pub struct Signal(pub(crate) ReadSignal); /// # Ownership /// Signals are always associated with a reactive node. This is what performs the memory management /// for the actual value of the signal. What is returned from this function is just a -/// handle/reference to the signal allocted in the reactive node. This allows us to freely copy this +/// handle/reference to the signal allocated in the reactive node. This allows us to freely copy this /// handle around and use it in closures and event handlers without worrying about ownership of the /// signal. /// @@ -515,7 +515,7 @@ impl Signal { self.update(move |val| *val = f(val)); } - /// Split the signal into a reader/writter pair. + /// Split the signal into a reader/writer pair. /// /// # Example /// ``` diff --git a/packages/sycamore-router/src/lib.rs b/packages/sycamore-router/src/lib.rs index 19207b99..12432636 100644 --- a/packages/sycamore-router/src/lib.rs +++ b/packages/sycamore-router/src/lib.rs @@ -366,7 +366,7 @@ mod tests { } #[test] - fn ingnore_query_params_dyn() { + fn ignore_query_params_dyn() { check( "/a/b/c?foo=bar", RoutePath::new(vec![DynSegments]), @@ -384,7 +384,7 @@ mod tests { } #[test] - fn ingnore_hash_dyn() { + fn ignore_hash_dyn() { check( "/a/b/c#foo", RoutePath::new(vec![DynSegments]), diff --git a/packages/sycamore-router/src/router.rs b/packages/sycamore-router/src/router.rs index 732a8344..6c17b059 100644 --- a/packages/sycamore-router/src/router.rs +++ b/packages/sycamore-router/src/router.rs @@ -74,7 +74,7 @@ impl Integration for HistoryIntegration { // Check if a has `rel="external"`. if a.rel() == "external" { - // Use default browser behaviour. + // Use default browser behavior. return; } diff --git a/packages/sycamore-web/src/attributes.rs b/packages/sycamore-web/src/attributes.rs index f3c8e2d3..cfb32b52 100644 --- a/packages/sycamore-web/src/attributes.rs +++ b/packages/sycamore-web/src/attributes.rs @@ -15,7 +15,7 @@ impl AttributeValue for StringAttribute { } } -/// Type alias respresenting a possibly dynamic boolean value. +/// Type alias representing a possibly dynamic boolean value. pub type BoolAttribute = MaybeDyn; impl AttributeValue for BoolAttribute { fn set_self(self, el: &mut HtmlNode, name: Cow<'static, str>) { diff --git a/packages/sycamore-web/src/events.rs b/packages/sycamore-web/src/events.rs index 0632c666..8168e16f 100644 --- a/packages/sycamore-web/src/events.rs +++ b/packages/sycamore-web/src/events.rs @@ -195,7 +195,7 @@ where } } -/// Marker trait to workaround specialisation. +/// Marker trait to workaround specialization. #[doc(hidden)] #[cfg(feature = "suspense")] pub struct AsyncHandler; diff --git a/packages/sycamore-web/src/iter.rs b/packages/sycamore-web/src/iter.rs index 6483a48e..0f73f6f9 100644 --- a/packages/sycamore-web/src/iter.rs +++ b/packages/sycamore-web/src/iter.rs @@ -100,7 +100,7 @@ where // Run the initial function in the outer scope, not the effect scope. // This is because we might want to create signals and other things managed by the reactive - // tree that will be used in furture triggers of this effect. These things must therefore + // tree that will be used in future triggers of this effect. These things must therefore // live as long as the effect. let scope = use_current_scope(); create_effect_initial(move || { @@ -202,7 +202,7 @@ where // Run the initial function in the outer scope, not the effect scope. // This is because we might want to create signals and other things managed by the reactive - // tree that will be used in furture triggers of this effect. These things must therefore + // tree that will be used in future triggers of this effect. These things must therefore // live as long as the effect. let scope = use_current_scope(); create_effect_initial(move || { diff --git a/packages/sycamore-web/src/resource.rs b/packages/sycamore-web/src/resource.rs index 4cc7d7d1..5911702a 100644 --- a/packages/sycamore-web/src/resource.rs +++ b/packages/sycamore-web/src/resource.rs @@ -1,4 +1,4 @@ -//! Async resources integrted with suspense. +//! Async resources integrated with suspense. use std::future::Future; use std::ops::Deref; diff --git a/packages/sycamore-web/src/stable_counter.rs b/packages/sycamore-web/src/stable_counter.rs index da562fb9..1e5bb609 100644 --- a/packages/sycamore-web/src/stable_counter.rs +++ b/packages/sycamore-web/src/stable_counter.rs @@ -13,7 +13,7 @@ struct CounterValue { /// Get the next counter value. This is stable across client and server side. /// /// The counter is stored in the global scope so that it is shared across the entire app. It is -/// initialized to 0 and incremented everytime this function is called. +/// initialized to 0 and incremented every time this function is called. pub fn use_stable_counter() -> u32 { let global_scope = use_global_scope(); let counter = global_scope.run_in(|| use_context_or_else(CounterValue::default)); diff --git a/packages/sycamore-web/src/suspense.rs b/packages/sycamore-web/src/suspense.rs index be74addf..abcc234b 100644 --- a/packages/sycamore-web/src/suspense.rs +++ b/packages/sycamore-web/src/suspense.rs @@ -4,7 +4,7 @@ use std::future::Future; use std::num::NonZeroU32; use sycamore_futures::{ - create_detatched_suspense_scope, create_suspense_scope, create_suspense_task, + create_detached_suspense_scope, create_suspense_scope, create_suspense_task, }; use sycamore_macro::{component, Props}; @@ -196,9 +196,9 @@ pub fn Transition(props: SuspenseProps) -> View { // TODO: Workaround for https://github.com/sycamore-rs/sycamore/issues/718. let mut set_is_loading = set_is_loading; - // We create a detatched suspense scope here to not create a deadlock with the outer + // We create a detached suspense scope here to not create a deadlock with the outer // suspense. - let (children, scope) = create_detatched_suspense_scope(move || children.call()); + let (children, scope) = create_detached_suspense_scope(move || children.call()); // Trigger the outer suspense scope. Note that this is only triggered on the initial render // and future renders will be captured by the inner suspense scope. create_suspense_task(scope.until_finished()); diff --git a/packages/sycamore-web/src/utils.rs b/packages/sycamore-web/src/utils.rs index 8ec902b1..6765307f 100644 --- a/packages/sycamore-web/src/utils.rs +++ b/packages/sycamore-web/src/utils.rs @@ -36,7 +36,7 @@ pub fn get_nodes_between(start: &web_sys::Node, end: &web_sys::Node) -> Vec View { diff --git a/packages/sycamore/src/lib.rs b/packages/sycamore/src/lib.rs index 88104deb..1ecf8d7d 100644 --- a/packages/sycamore/src/lib.rs +++ b/packages/sycamore/src/lib.rs @@ -13,7 +13,7 @@ //! - `serde` - Enables serializing and deserializing `Signal`s and other wrapper types using //! `serde`. //! -//! - `suspense` - Enalbes suspense and resources. Also enables wrappers around +//! - `suspense` - Enables suspense and resources. Also enables wrappers around //! `wasm-bindgen-futures` to make it easier to extend a reactive scope into an `async` function. //! //! - `nightly` - Enables nightly-only features. This makes it slightly more ergonomic to use