Skip to content

Commit 182cafa

Browse files
docs: remove all stale JSON protocol references
Update all documentation to reflect protobuf-only protocol format. State data (state.json) references are unchanged — only protocol format references updated. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 2e018b9 commit 182cafa

8 files changed

Lines changed: 12 additions & 14 deletions

File tree

DESIGN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ pub struct Predicate {
173173
```
174174
#### Serialization Requirements
175175
- Protobuf binary serialization/deserialization as the primary format, using `prost` for zero-copy decoding
176-
- JSON serialization/deserialization supported for backward compatibility
176+
- JSON output supported via `webui inspect` for debugging only
177177
- Support for custom error types and propagation
178178
- Validation of protocol structure during deserialization
179179
- Performance optimizations for large protocol structures

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ cargo build --release
5656
The `webui` CLI builds your app folder into the WebUI protocol format:
5757

5858
```bash
59-
# Build an app (outputs protocol.json and component CSS to the out folder)
59+
# Build an app (outputs protocol.bin and component CSS to the out folder)
6060
cargo run -p webui-cli -- build ./my-app --out ./dist
6161

6262
# Specify a custom entry file

docs/guide/advanced/protocol.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ The `If` fragment uses a `Condition` oneof to express its predicate:
4343
| `Compound` | Logical AND/OR of two nested conditions |
4444
| `Identifier` | Direct reference to a state identifier |
4545

46-
## JSON Compatibility
46+
## Debugging
4747

48-
JSON serialization is still supported for backward compatibility and debugging. Use the JSON representation when inspecting protocol output manually or integrating with tools that do not support protobuf.
48+
Use `webui inspect` to convert protocol.bin to JSON for debugging purposes.

docs/guide/concepts/directives/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ WebUI directives are processed by the WebUI parser and transformed into a platfo
1919
Template with directives → WebUI Protocol → Native HTML output
2020
```
2121

22-
The WebUI protocol is a simple JSON structure that can be processed by any language with JSON support, making it ideal for cross-platform applications.
22+
The WebUI protocol is a protobuf binary structure defined by a cross-language .proto schema, making it ideal for cross-platform applications.

docs/guide/concepts/handlers/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ WebUI provides official handlers for several popular programming languages (othe
1212

1313
All WebUI handlers follow the same pattern:
1414

15-
1. They accept a WebUI protocol object (usually parsed from JSON)
15+
1. They accept a WebUI protocol object (parsed from protobuf binary)
1616
2. They process the protocol with the provided state data
1717
3. They render the final HTML output by evaluating directives and inserting dynamic content
1818

docs/guide/concepts/handlers/rust.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ webui-state = "0.1.0"
1717
## Basic Usage
1818

1919
```rust
20-
use std::fs::File;
20+
use webui_protocol::WebUIProtocol;
2121
use serde_json::{json, Value};
2222
use webui_handler::{handle, ResponseWriter, Result};
2323
use webui_protocol::WebUIProtocol;
@@ -47,8 +47,7 @@ impl ResponseWriter for StringWriter {
4747

4848
fn main() -> Result<()> {
4949
// Load protocol from file
50-
let protocol_file = File::open("template.json")?;
51-
let protocol = WebUIProtocol::from_reader(protocol_file)?;
50+
let protocol = WebUIProtocol::from_protobuf_file("template.bin")?;
5251

5352
// Create state data
5453
let state = json!({

docs/tutorials/hello-world.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Let's create a Rust application to render this template:
8787
```rust
8888
use std::fs;
8989
use serde_json::Value;
90-
use webui_parser::{WebUIParser, Result};
90+
use webui_protocol::{WebUIProtocol, Result};
9191
use webui_handler::{handle, ResponseWriter};
9292

9393
struct FileWriter {
@@ -120,9 +120,8 @@ impl ResponseWriter for FileWriter {
120120
}
121121

122122
fn main() -> Result<()> {
123-
// Parse the template at build step, then protocol will be only needed.
124-
let parser = WebUIParser::new();
125-
let protocol = parser.parse("src/templates/index.html", &["src/templates"])?;
123+
// Load the protocol from protobuf binary
124+
let protocol = WebUIProtocol::from_protobuf_file("protocol.bin")?;
126125

127126
// Load the state
128127
let state_json = fs::read_to_string("state.json")?;

docs/tutorials/todo-app.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ fn main() {
204204
let current_state = get_state(&store);
205205

206206
// 2. Load the protocol
207-
let protocol = load_protocol("path/to/compiled/protocol.json");
207+
let protocol = load_protobuf("path/to/compiled/protocol.bin");
208208

209209
// 3. Handle the request and write to response
210210
handler(protocol, current_state, |chunk| {

0 commit comments

Comments
 (0)