Hotreloading of for/if/body, formatted strings, literals, component props, nested rsx, light CLI rewrite, cli TUI (#2258)

Hotreload the contents of for loops, if chains, component bodies, props, attributes, and any literals discovered in rsx!
Add a TUI renderer to the CLI.
Improve the CLI build system to be async and parallel.
Refactor RSX to allow partial expansion of expressions.
Merge autofmt implementations for consistency.
Merge the representation of elements and components under the hood.
Add a diagnostics system for rsx for improved error messages.
Drop interprocess and move to websockets for communication between the CLI and the server.
Assign IDs to nodes and attributes in a stable way to be used in non compiler contexts.
Add hotreloading to any body of component/for loop/if chain/etc.

---------

Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
Co-authored-by: Liam Mitchell <liamkarlmitchell@gmail.com>
This commit is contained in:
authored and GitHub committed 2024-07-17 19:11:18 -07:00
1 parent 176e67e5b7
commit 88af3e7eff
181 files changed
+12755 -10806

No files matched your search

+18 -2
View File
@@ -385,7 +385,7 @@ pub struct Template {
}
#[cfg(feature = "serialize")]
fn deserialize_string_leaky<'a, 'de, D>(deserializer: D) -> Result<&'a str, D::Error>
pub(crate) fn deserialize_string_leaky<'a, 'de, D>(deserializer: D) -> Result<&'a str, D::Error>
where
D: serde::Deserializer<'de>,
{
@@ -1076,18 +1076,34 @@ impl IntoAttributeValue for String {
}
}
impl IntoAttributeValue for f32 {
fn into_value(self) -> AttributeValue {
AttributeValue::Float(self as _)
}
}
impl IntoAttributeValue for f64 {
fn into_value(self) -> AttributeValue {
AttributeValue::Float(self)
}
}
impl IntoAttributeValue for i32 {
fn into_value(self) -> AttributeValue {
AttributeValue::Int(self as _)
}
}
impl IntoAttributeValue for i64 {
fn into_value(self) -> AttributeValue {
AttributeValue::Int(self)
}
}
impl IntoAttributeValue for i128 {
fn into_value(self) -> AttributeValue {
AttributeValue::Int(self as _)
}
}
impl IntoAttributeValue for bool {
fn into_value(self) -> AttributeValue {
AttributeValue::Bool(self)
@@ -1130,7 +1146,7 @@ pub trait HasAttributes {
#[cfg(debug_assertions)]
pub(crate) fn sort_bfo(paths: &[&'static [u8]]) -> Vec<(usize, &'static [u8])> {
let mut with_indecies = paths.iter().copied().enumerate().collect::<Vec<_>>();
with_indecies.sort_unstable_by(|(_, a), (_, b)| {
with_indecies.sort_by(|(_, a), (_, b)| {
let mut a = a.iter();
let mut b = b.iter();
loop {