From 48dcc2774b6afe3635e9f032e344941541f9b1ac Mon Sep 17 00:00:00 2001 From: timblah Date: Thu, 23 Feb 2023 02:40:28 -0500 Subject: [PATCH] Fix file paths mentioned in website's Contribute page (#1052) * Updated paths for frontend / backend communication section of contribute page to reflect current project structure * Added starting / for consistency with other paths on the page * Mapping actually happens in subscription router * Changed path to show code that dispatches FrontendMessage rather than the type def * Missing / at start of path * Fix files --------- Co-authored-by: Keavon Chambers --- website/content/contribute/_index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/content/contribute/_index.md b/website/content/contribute/_index.md index 06cdd22a..4edd0f7c 100644 --- a/website/content/contribute/_index.md +++ b/website/content/contribute/_index.md @@ -68,9 +68,9 @@ The Editor's frontend web code lives in `/frontend/src` and the backend Rust cod ### Frontend/backend communication. -Frontend (JS) -> backend (Rust/wasm) communication is achieved through a thin Rust translation layer in `/frontend/wasm/editor_api.rs` which wraps the Editor backend's complex Rust data type API and provides the JS with a simpler API of callable functions. These wrapper functions are compiled by wasm-bindgen into autogenerated JS functions that serve as an entry point into the wasm. +Frontend (JS) -> backend (Rust/wasm) communication is achieved through a thin Rust translation layer in `/frontend/wasm/src/editor_api.rs` which wraps the Editor backend's complex Rust data type API and provides the JS with a simpler API of callable functions. These wrapper functions are compiled by wasm-bindgen into autogenerated JS functions that serve as an entry point into the wasm. -Backend (Rust) -> frontend (JS) communication happens by sending a queue of messages to the frontend message dispatcher. After the JS calls any wrapper API function to get into backend (Rust) code execution, the Editor's business logic runs and queues up `FrontendMessage`s (defined in `editor/src/frontend/frontend_message_handler.rs`) which get mapped from Rust to JS-friendly data types in `frontend/src/dispatcher/js-messages.ts`. Various JS code subscribes to these messages by calling `subscribeJsMessage(MessageName, (messageData) => { /* callback code */ });`. +Backend (Rust) -> frontend (JS) communication happens by sending a queue of messages to the frontend message dispatcher. After the JS calls any wrapper API function to get into backend (Rust) code execution, the Editor's business logic runs and queues up `FrontendMessage`s (defined in `/editor/src/messages/frontend/frontend_message.rs`) which get mapped from Rust to JS-friendly data types in `/frontend/src/wasm-communication/messages.ts`. Various JS code subscribes to these messages by calling `subscribeJsMessage(MessageName, (messageData) => { /* callback code */ });`. ### The Editor backend and Legacy Document modules.