Remove all moxie-app references — make guides standalone
All documents now reference only Tauri 2.0 official patterns and APIs with no dependency on any specific reference application.
This commit is contained in:
parent
04c128f509
commit
5e7cbbae47
@ -1,13 +1,13 @@
|
|||||||
# WebSocket Server, Client & Script Injection Guide
|
# WebSocket Server, Client & Script Injection Guide
|
||||||
|
|
||||||
> Based on the working `moxie-app` reference implementation in this repository.
|
> A comprehensive guide for building native WebSocket servers, frontend clients, and script injection patterns in Tauri 2.0 applications.
|
||||||
> This guide documents the complete pattern for running a native WebSocket server inside Tauri 2.0, connecting frontend clients, and injecting scripts into external webview windows.
|
> This guide documents the complete pattern for running a native WebSocket server inside Tauri 2.0, connecting frontend clients, and injecting scripts into external webview windows.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
This guide covers three interrelated patterns used in the reference `moxie-app`:
|
This guide covers three interrelated patterns for Tauri 2.0 applications:
|
||||||
|
|
||||||
1. **Native WebSocket Server** — A Tokio-backed WebSocket server running inside the Tauri process
|
1. **Native WebSocket Server** — A Tokio-backed WebSocket server running inside the Tauri process
|
||||||
2. **Frontend WebSocket Client** — JavaScript clients connecting to the local server for bidirectional communication
|
2. **Frontend WebSocket Client** — JavaScript clients connecting to the local server for bidirectional communication
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
> **Version**: 2.0 | **Last Updated**: 2026-05-31
|
> **Version**: 2.0 | **Last Updated**: 2026-05-31
|
||||||
> **Official Docs**: https://v2.tauri.app
|
> **Official Docs**: https://v2.tauri.app
|
||||||
> **Reference App**: `moxie-app/` (included in this repository)
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -735,7 +734,7 @@ const { invoke } = window.__TAURI__.core;
|
|||||||
const { listen, emit } = window.__TAURI__.event;
|
const { listen, emit } = window.__TAURI__.event;
|
||||||
```
|
```
|
||||||
|
|
||||||
This is the pattern used in the reference `moxie-app` and is ideal for vanilla JS projects without a bundler.
|
This pattern is ideal for vanilla JS projects that don't use a bundler, avoiding the need for any npm packages beyond `@tauri-apps/cli`.
|
||||||
|
|
||||||
### Import Path Changes from v1
|
### Import Path Changes from v1
|
||||||
|
|
||||||
@ -1222,7 +1221,7 @@ const yes = await confirm('Are you sure you want to delete this file?');
|
|||||||
|
|
||||||
## 10. Native WebSocket Server (Rust-side)
|
## 10. Native WebSocket Server (Rust-side)
|
||||||
|
|
||||||
This section documents the WebSocket server pattern used in the reference `moxie-app`. This pattern is useful when your Tauri app needs to **act as a server** — accepting connections from local webviews, external applications, or other processes.
|
This section documents the WebSocket server pattern for Tauri 2.0 applications. This pattern is useful when your app needs to **act as a server** — accepting connections from local webviews, external applications, or other processes.
|
||||||
|
|
||||||
### Architecture Overview
|
### Architecture Overview
|
||||||
|
|
||||||
@ -1348,7 +1347,7 @@ ws.onerror = (err) => {
|
|||||||
|
|
||||||
## 11. Script Injection into Webview Windows
|
## 11. Script Injection into Webview Windows
|
||||||
|
|
||||||
This section documents the script injection pattern used in the reference `moxie-app` for injecting JavaScript into dynamically created webview windows (including those loading external URLs).
|
This section documents the script injection pattern for injecting JavaScript into dynamically created webview windows (including those loading external URLs).
|
||||||
|
|
||||||
### The Pattern
|
### The Pattern
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user