Massively reorganize and clean up the whole Rust codebase (#478)

* Massively reorganize and clean up the whole Rust codebase

* Additional changes during code review
This commit is contained in:
Keavon Chambers
2022-01-14 14:58:08 -08:00
parent f63424b676
commit 40d5960571
85 changed files with 2515 additions and 2189 deletions
+5 -5
View File
@@ -1,9 +1,10 @@
pub mod api;
mod helpers;
pub mod helpers;
pub mod logging;
pub mod type_translators;
use editor::message_prelude::FrontendMessage;
use editor::message_prelude::*;
use logging::WasmLog;
use std::cell::RefCell;
use std::collections::HashMap;
@@ -12,13 +13,12 @@ use std::sync::atomic::AtomicBool;
use wasm_bindgen::prelude::*;
// Set up the persistent editor backend state
static LOGGER: WasmLog = WasmLog;
pub static EDITOR_HAS_CRASHED: AtomicBool = AtomicBool::new(false);
pub static LOGGER: WasmLog = WasmLog;
thread_local! {
pub static EDITOR_INSTANCES: RefCell<HashMap<u64, (editor::Editor, api::JsEditorHandle)>> = RefCell::new(HashMap::new());
}
pub static EDITOR_HAS_CRASHED: AtomicBool = AtomicBool::new(false);
// Initialize the backend
#[wasm_bindgen(start)]
pub fn init() {