Feat: Clean up repo a bit

This commit is contained in:
Jonathan Kelley committed 2021-05-16 02:55:16 -04:00
1 parent c28697e1fe
commit a99147c85b
55 files changed
+76 -6609

No files matched your search

+48
View File
@@ -0,0 +1,48 @@
use std::{cell::UnsafeCell, collections::HashMap};
use generational_arena::Arena;
use crate::innerlude::*;
pub struct ScopeArena {
pub(crate) arena: UnsafeCell<Arena<Scope>>,
locks: HashMap<ScopeIdx, MutStatus>,
}
enum MutStatus {
Immut,
Mut,
}
impl ScopeArena {
pub fn new(arena: Arena<Scope>) -> Self {
Self {
arena: UnsafeCell::new(arena),
locks: Default::default(),
}
}
pub fn get(&self, idx: ScopeIdx) -> Result<&Scope> {
todo!()
}
pub fn get_mut(&self, idx: ScopeIdx) -> Result<&Scope> {
todo!()
}
fn inner(&self) -> &Arena<Scope> {
todo!()
}
fn inner_mut(&mut self) -> &mut Arena<Scope> {
todo!()
}
pub fn with<T>(&mut self, f: impl FnOnce(&mut Arena<Scope>) -> T) -> T {
todo!()
}
unsafe fn inner_unchecked<'s>() -> &'s mut Arena<Scope> {
todo!()
}
}
+1 -1
View File
@@ -120,4 +120,4 @@ impl<'a> crate::virtual_dom::Context<'a> {
///
/// - Dioxus reducer is built on the safe API and provides a useful but slightly limited API.
/// - Dioxus Dataflow is built on the unsafe API and provides an even snazzier API than Dioxus Reducer.
fn blah() {}
fn _blah() {}
+4
View File
@@ -1,3 +1,7 @@
//! Internal error handling for Dioxus
//!
//!
use thiserror::Error as ThisError;
pub type Result<T, E = Error> = std::result::Result<T, E>;
+1
View File
@@ -65,6 +65,7 @@
//! - dioxus-liveview (SSR + StringRenderer)
//!
pub mod arena;
pub mod component; // Logic for extending FC
pub mod context; // Logic for providing hook + context functionality to user components
pub mod debug_renderer;
+1 -6
View File
@@ -19,16 +19,11 @@
//!
//! # Known Issues
//! ----
//! - stack machine approach does not work when 3rd party extensions inject elements (breaking our view of the dom)
use std::cell::Ref;
//! - stack machine approach does not work when 3rd party extensions inject elements (breaking our view of the dom) - solvable by the renderer
use crate::innerlude::ScopeIdx;
pub type EditList<'src> = Vec<Edit<'src>>;
// pub struct EditList<'src> {
// edits: Vec<Edit<'src>>,
// }
/// The `Edit` represents a single modifcation of the renderer tree.
/// todo @jon, go through and make certain fields static. tag names should be known at compile time