wip: start to refactor out hot reloading from packages

Also implement alternative simpler template system
This commit is contained in:
Jonathan Kelley committed 2022-10-20 09:56:09 -07:00
1 parent 3b7b503333
commit 90982e0ccb
44 files changed
+3865 -5133

No files matched your search

+9 -3
View File
@@ -1,6 +1,5 @@
use std::fmt::Display;
use dioxus_core::OwnedCodeLocation;
use serde::{Deserialize, Serialize};
/// An error produced when interperting the rsx
@@ -19,14 +18,21 @@ pub enum RecompileReason {
Attribute(String),
}
#[derive(Debug, Serialize, Deserialize)]
pub struct CodeLocation {
pub line: u32,
pub column: u32,
pub file_path: &'static str,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct ParseError {
pub message: String,
pub location: OwnedCodeLocation,
pub location: CodeLocation,
}
impl ParseError {
pub fn new(error: syn::Error, mut location: OwnedCodeLocation) -> Self {
pub fn new(error: syn::Error, mut location: CodeLocation) -> Self {
let message = error.to_string();
let syn_call_site = error.span().start();
location.line += syn_call_site.line as u32;