@webqit/webflo 0.20.4-next.0 → 0.20.4-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "vanila-javascript"
13
13
  ],
14
14
  "homepage": "https://webqit.io/tooling/webflo",
15
- "version": "0.20.4-next.0",
15
+ "version": "0.20.4-next.2",
16
16
  "license": "MIT",
17
17
  "repository": {
18
18
  "type": "git",
@@ -46,7 +46,7 @@ const config = {
46
46
  { text: 'Rendering', link: '/docs/concepts/rendering' },
47
47
  { text: 'Templates', link: '/docs/concepts/templates' },
48
48
  { text: 'State Management', link: '/docs/concepts/state' },
49
- { text: 'Request/Response Lifecycle', link: '/docs/concepts/request-response' },
49
+ { text: 'Requests & Responses', link: '/docs/concepts/requests-responses' },
50
50
  { text: 'Webflo Realtime', link: '/docs/concepts/realtime' },
51
51
  ]
52
52
  },
@@ -339,7 +339,9 @@ Webflo knows to switch the connection to background mode in all the above cases.
339
339
  - **Webflo simply fulfills the intent of however a handler works**.
340
340
  :::
341
341
 
342
- ## Real-world Examples
342
+ ## Real-World Examples
343
+
344
+ Below are some examples of how Webflo's realtime features work in action.
343
345
 
344
346
  ### Live Responses
345
347
 
@@ -371,7 +373,7 @@ This handler returns a skeleton object immediately for fast page load and then b
371
373
  **_Result_:** The UI renders a skeleton first, then progressively fills in as the object tree is built from the server.
372
374
 
373
375
  ```js
374
- import { Observer } from '@webqit/observer';
376
+ import Observer from '@webqit/observer';
375
377
  ```
376
378
 
377
379
  ```js
@@ -597,24 +599,25 @@ export default async function (event, next) {
597
599
  :::
598
600
 
599
601
  ::: warning
600
-
601
602
  - Channel IDs must be unique and unguessable across the app.
602
603
  - Channels are not persistent and are only active for the duration of the request. A database is required to store channel data.
603
- :::
604
+ :::
604
605
 
605
606
  ## Appendix A – The Realtime Lifecycle
606
607
 
608
+ The realtime lifecycle — from handshake to termination — can be summarized as follows. Note that this is the model between any two ports — Port A and Port B, not just between the client and the server, as that's only typical.
609
+
607
610
  ```mermaid
608
611
  sequenceDiagram
609
- participant Browser
610
- participant Handler
611
- Browser->>Handler: HTTP request
612
- Handler-->>Browser: Initial Response (or a Temporary 202 Accepted) <br>+ X-Background-Messaging-Port
613
- Browser-->>Handler: Connect (WebSocket / Broadcast / MessageChannel)
614
- Note over Browser,Handler: Background mode established
615
- Handler-->>Browser: Messages, updates, dialogs, etc.
616
- Browser-->>Handler: Replies, requests, etc.
617
- Browser<<-->>Handler: Termination
612
+ participant Port A
613
+ participant Port B
614
+ Port A->>Port B: HTTP request
615
+ Port B-->>Port A: Initial Response (or a Temporary 202 Accepted) <br>+ X-Background-Messaging-Port
616
+ Port A-->>Port B: Connect (WebSocket / Broadcast / MessageChannel)
617
+ Note over Port A,Port B: Background mode established
618
+ Port B-->>Port A: Messages, updates, dialogs, etc.
619
+ Port A-->>Port B: Replies, requests, etc.
620
+ Port A<<-->>Port B: Termination
618
621
  ```
619
622
 
620
623
  ### The Handshake
@@ -622,7 +625,7 @@ sequenceDiagram
622
625
  On entering background mode, Webflo initiates a handshake sequence as follows:
623
626
 
624
627
  1. Webflo gives the initial response a unique `X-Background-Messaging-Port` header that tells the client to connect in the background after rendering the initial response.
625
- > If the scenario is case `1.` above happening _before_ yielding a response, Webflo sends a temporary `202 Accepted` response to the client carrying this header.
628
+ > If the scenario is that the handler tiggers `event.client` messaging _before_ yielding a response, Webflo sends a temporary `202 Accepted` response to the client carrying this header.
626
629
  2. The client reads that header and opens the background channel.
627
630
  > If the client fails to connect within the handshake window, Webflo abandons the wait and concludes the request normally.
628
631
  3. On connecting, both sides resume the same request context — now in live mode.
@@ -1,4 +1,4 @@
1
- # Request/Response Lifecycle
1
+ # Requests & Responses
2
2
 
3
3
  This page explains how Webflo orchestrates each interaction from request to response, and how you can hook into various stages, including realtime.
4
4
 
@@ -1,4 +1,4 @@
1
- # State Management
1
+ # State, Mutation, & Reactivity
2
2
 
3
3
  Webflo’s approach to state is refreshingly simple: your UI state is just a plain JavaScript object. When your server handler returns data, it becomes available as `document.bindings.data` for your templates and UI. No special syntax, no framework-specific magic—just JavaScript you already know.
4
4
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Welcome! This guide will help you build your first Webflo app from scratch and get it running in minutes, even if you’ve never used the framework before. You’ll learn not just the “how,” but the “why”—and see your results live in the browser.
4
4
 
5
- If you're totally new here, you may want to [meet Webflo](/docs/overview).
5
+ If you're totally new here, you may want to [meet Webflo](/overview).
6
6
 
7
7
  ---
8
8