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

+1 -2
View File
@@ -30,7 +30,6 @@ pub fn launch(
use axum::routing::get;
use axum::Router;
use axum::ServiceExt;
use dioxus_hot_reload::HotReloadRouterExt;
use http::StatusCode;
use tower_http::services::ServeDir;
use tower_http::services::ServeFile;
@@ -52,7 +51,7 @@ pub fn launch(
let mut serve_dir =
ServeDir::new(path.clone()).call_fallback_on_method_not_allowed(true);
let mut router = axum::Router::new().forward_cli_hot_reloading();
let mut router = axum::Router::new();
// If we are acting like github pages, we need to serve the 404 page if the user requests a directory that doesn't exist
router = if github_pages {
+1 -1
View File
@@ -67,7 +67,7 @@ pub async fn generate_static_site(
// Copy over the web output dir into the static output dir
let assets_path = dioxus_cli_config::CURRENT_CONFIG
.as_ref()
.map(|c| c.dioxus_config.application.out_dir.clone())
.map(|c| c.application.out_dir.clone())
.unwrap_or("./dist".into());
copy_static_files(&assets_path, &config.output_dir)?;