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

+3
View File
@@ -138,6 +138,8 @@ impl ReactiveContext {
/// Clear all subscribers to this context
pub fn clear_subscribers(&self) {
// The key type is mutable, but the hash is stable through mutations because we hash by pointer
#[allow(clippy::mutable_key_type)]
let old_subscribers = std::mem::take(&mut self.inner.write().subscribers);
for subscriber in old_subscribers {
subscriber.0.lock().unwrap().remove(self);
@@ -146,6 +148,7 @@ impl ReactiveContext {
/// Update the subscribers
pub(crate) fn update_subscribers(&self) {
#[allow(clippy::mutable_key_type)]
let subscribers = &self.inner.read().subscribers;
for subscriber in subscribers.iter() {
subscriber.0.lock().unwrap().insert(*self);