When to use this skill
ALWAYS use this skill when the user mentions:
- WebSocket connections without WebView limits / WebSocket connections that bypass WebView limits
- Connection, message, and disconnect events
- Realtime updates in a Tauri app
Trigger phrases include:
- "websocket", "realtime", "connect", "disconnect"
- "WebSocket", "realtime", "connect", "disconnect"
How to use this skill
- Define WebSocket endpoints and reconnect strategy
- Configure plugin capabilities and allowed hosts
- Handle connect, message, and disconnect lifecycle events
- Validate error handling and network recovery
Outputs
- Realtime communication plan
- Host allowlist and recovery checklist
Scope
- Boundary: WebSocket plugin usage only
- Key points: Lifecycle management and host allowlisting
References
- https://v2.tauri.app/llms.txt
- https://v2.tauri.app/plugin/websocket/
- https://v2.tauri.app/zh-cn/plugin/websocket/
Keywords
tauri websocket, realtime, connect, disconnect
Common Gotchas
- Version Compatibility: Pay attention to compatibility between framework versions and dependency libraries; APIs may differ across versions
- Configuration File Format: Configuration file format errors are the most common issue; it is recommended to use your editor's syntax checking
- Environment Variables: Ensure all necessary environment variables are set correctly; do not hardcode sensitive information
- Dependency Conflicts: Watch out for dependency conflicts when multiple versions coexist; use a lock file to pin versions
- Performance Pitfalls: Pay attention to performance optimization in large-data scenarios, and avoid common issues such as N+1 queries
Usage Flow
Step 1: Environment Preparation
Ensure the development environment has the necessary dependencies and tools installed.
Step 2: Configuration Initialization
Perform basic configuration according to project requirements.
Step 3: Using Core Features
Implement the core functionality according to the example code.
Step 4: Testing and Verification
Run tests to ensure the functionality works properly.
Step 5: Deployment and Release
After development is complete, proceed with deployment and monitoring.