From 0e3f51328b468a068c677f515e045302e82901d2 Mon Sep 17 00:00:00 2001 From: Timothy Date: Wed, 22 Feb 2023 23:39:24 -0500 Subject: [PATCH 1/6] Updated paths for frontend / backend communication section of contribute page to reflect current project structure --- 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 06cdd22a79..f3118e0d46 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. From be920b814c2d18c813b64f466fc712e9d21c2b11 Mon Sep 17 00:00:00 2001 From: Timothy Date: Wed, 22 Feb 2023 23:45:42 -0500 Subject: [PATCH 2/6] Added starting / for consistency with other paths on the page --- 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 f3118e0d46..4edd0f7c69 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/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. +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/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 */ });`. +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. From 0eb883ed7992a9b4258324bdffdb4a8be200fbcf Mon Sep 17 00:00:00 2001 From: Timothy Date: Wed, 22 Feb 2023 23:58:48 -0500 Subject: [PATCH 3/6] Mapping actually happens in subscription router --- website/content/contribute/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/content/contribute/_index.md b/website/content/contribute/_index.md index 4edd0f7c69..7f335c96cc 100644 --- a/website/content/contribute/_index.md +++ b/website/content/contribute/_index.md @@ -70,7 +70,7 @@ The Editor's frontend web code lives in `/frontend/src` and the backend Rust cod 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/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 */ });`. +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/subscription-router.ts`. Various JS code subscribes to these messages by calling `subscribeJsMessage(MessageName, (messageData) => { /* callback code */ });`. ### The Editor backend and Legacy Document modules. From e18b17f3ff2e30a31d7182a1de3dff4ad107d549 Mon Sep 17 00:00:00 2001 From: Timothy Date: Thu, 23 Feb 2023 00:08:14 -0500 Subject: [PATCH 4/6] Changed path to show code that dispatches FrontendMessage rather than the type def --- website/content/contribute/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/content/contribute/_index.md b/website/content/contribute/_index.md index 7f335c96cc..d734021f58 100644 --- a/website/content/contribute/_index.md +++ b/website/content/contribute/_index.md @@ -70,7 +70,7 @@ The Editor's frontend web code lives in `/frontend/src` and the backend Rust cod 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/messages/frontend/frontend_message.rs`) which get mapped from Rust to JS-friendly data types in `frontend/src/wasm-communication/subscription-router.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/dispatcher.rs`) which get mapped from Rust to JS-friendly data types in `frontend/src/wasm-communication/subscription-router.ts`. Various JS code subscribes to these messages by calling `subscribeJsMessage(MessageName, (messageData) => { /* callback code */ });`. ### The Editor backend and Legacy Document modules. From 6b6129504350f27fbccd4eab1f0675c05e3a7b04 Mon Sep 17 00:00:00 2001 From: Timothy Date: Thu, 23 Feb 2023 00:15:08 -0500 Subject: [PATCH 5/6] Missing / at start of path --- website/content/contribute/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/content/contribute/_index.md b/website/content/contribute/_index.md index d734021f58..363856e12a 100644 --- a/website/content/contribute/_index.md +++ b/website/content/contribute/_index.md @@ -70,7 +70,7 @@ The Editor's frontend web code lives in `/frontend/src` and the backend Rust cod 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/dispatcher.rs`) which get mapped from Rust to JS-friendly data types in `frontend/src/wasm-communication/subscription-router.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/dispatcher.rs`) which get mapped from Rust to JS-friendly data types in `/frontend/src/wasm-communication/subscription-router.ts`. Various JS code subscribes to these messages by calling `subscribeJsMessage(MessageName, (messageData) => { /* callback code */ });`. ### The Editor backend and Legacy Document modules. From 37a06745eca3821fc5c221984e41d260c5b50d07 Mon Sep 17 00:00:00 2001 From: Keavon Chambers Date: Wed, 22 Feb 2023 23:35:07 -0800 Subject: [PATCH 6/6] Fix files --- website/content/contribute/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/content/contribute/_index.md b/website/content/contribute/_index.md index 363856e12a..4edd0f7c69 100644 --- a/website/content/contribute/_index.md +++ b/website/content/contribute/_index.md @@ -70,7 +70,7 @@ The Editor's frontend web code lives in `/frontend/src` and the backend Rust cod 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/dispatcher.rs`) which get mapped from Rust to JS-friendly data types in `/frontend/src/wasm-communication/subscription-router.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.