Move the document trait into a separate crate (#3035)

* add a default head method through eval
* remove the old document trait
* implement document for each platform
* pull out document into a dedicated crate to cut down on shared dependencies
---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
This commit is contained in:
Evan AlmloffandJonathan Kelley authored and GitHub committed 2024-10-14 10:33:37 -07:00
1 parent 2b219c826c
commit 519ec9d294
91 files changed
+1113 -1044

No files matched your search

+4 -5
View File
@@ -1,7 +1,7 @@
use super::HistoryProvider;
use crate::routable::Routable;
use dioxus_lib::document::Eval;
use dioxus_lib::prelude::*;
use document::UseEval;
use serde::{Deserialize, Serialize};
use std::sync::{Mutex, RwLock};
use std::{collections::BTreeMap, rc::Rc, str::FromStr, sync::Arc};
@@ -168,11 +168,10 @@ where
let updater_callback: Arc<RwLock<Arc<dyn Fn() + Send + Sync>>> =
Arc::new(RwLock::new(Arc::new(|| {})));
let eval_provider = document();
let eval_provider = dioxus_lib::document::document();
let create_eval = Rc::new(move |script: &str| {
UseEval::new(eval_provider.new_evaluator(script.to_string()))
}) as Rc<dyn Fn(&str) -> UseEval>;
let create_eval = Rc::new(move |script: &str| eval_provider.eval(script.to_string()))
as Rc<dyn Fn(&str) -> Eval>;
// Listen to server actions
spawn({