PulseTrade.Comm.Spa.Dynamic.Interactive.Client
0.1.0-alpha23
See the version list below for details.
dotnet add package PulseTrade.Comm.Spa.Dynamic.Interactive.Client --version 0.1.0-alpha23
NuGet\Install-Package PulseTrade.Comm.Spa.Dynamic.Interactive.Client -Version 0.1.0-alpha23
<PackageReference Include="PulseTrade.Comm.Spa.Dynamic.Interactive.Client" Version="0.1.0-alpha23" />
<PackageVersion Include="PulseTrade.Comm.Spa.Dynamic.Interactive.Client" Version="0.1.0-alpha23" />
<PackageReference Include="PulseTrade.Comm.Spa.Dynamic.Interactive.Client" />
paket add PulseTrade.Comm.Spa.Dynamic.Interactive.Client --version 0.1.0-alpha23
#r "nuget: PulseTrade.Comm.Spa.Dynamic.Interactive.Client, 0.1.0-alpha23"
#:package PulseTrade.Comm.Spa.Dynamic.Interactive.Client@0.1.0-alpha23
#addin nuget:?package=PulseTrade.Comm.Spa.Dynamic.Interactive.Client&version=0.1.0-alpha23&prerelease
#tool nuget:?package=PulseTrade.Comm.Spa.Dynamic.Interactive.Client&version=0.1.0-alpha23&prerelease
PulseTrade.Comm.Spa.Dynamic.Interactive.Client
Interactive notebook iframe 的 WebSharper browser client。它只處理三件事:接收 authoritative RuntimeFrame、以 shared reducer 更新 SDUI、透過 correlated action channel 將使用者 mutation 送回 host。
NuGet package自0.1.0-alpha3起在contentFiles/any/any/ptcs-dynamic-interactive/攜帶可直接serve的client.js、client.min.js、WebSharper.Core.JavaScript/Runtime.js與bundle.manifest.json。Application module已包含Contracts/Renderer/UI/FSharp邏輯,唯一external import是同目錄樹內的Runtime;host不需建立assembly resource/module graph server。
Action wire
Browser 送出:
{ Protocol = "ptcs-dynamic-action.v1"
Kind = "action-request"
Request =
{ RequestId = "<canvas>:ui:<sequence>"
ExpectedDocumentRevision = Some revision
Action = action } }
Host 必須回傳同一個 RequestId 的 DynamicActionServerFrame,其 result 為 Accepted、Rejected 或 RevisionConflict。Accepted 只解除 pending 狀態;真正的 document/data mutation 仍必須由 host 發布後續 RuntimeFrame,client 不做 optimistic state mutation。
Client 同時間只保留一個 pending request。socket 未開啟、30 秒 timeout、disconnect、send failure 或 correlation mismatch 都會回傳 DynamicHostError 並 fail closed。既有 RuntimeClientFrame 的 mounted/unmounted/resync path 保持相容。
Application lifecycle
SPA entry point會呼叫Client.Application.start()。Host需要自行管理生命週期時可使用相同single-instance API:
let handle =
Client.Application.startWithOptions
{ Client.defaultOptions with
RootElementId = "app"
StatusElementId = "sdui-runtime-status" }
// idempotent;不會建立第二條WebSocket
handle.Start()
// terminal;送Unmounted、取消timer、關閉transport且不再重連
handle.Dispose()
client只從目前page的/view/推導same-origin/frames/ WebSocket,不接受remote URL、header或credential。transport close會保留原RuntimeState與renderer,以1秒起、30秒封頂的bounded backoff重連。replacement transport有既有runtime identity時只送一次Mounted與RequestFullSnapshot;valid Snapshot前畫面維持last-good。snapshot逾時會淘汰該socket generation並重連;舊generation callback不得排第二個timer或覆蓋新state。
Host integration
Host WebSocket receive loop 應先嘗試:
match BrowserRuntimeCodec.decodeActionRequest text with
| Ok request ->
let! result = executeAgainstAuthoritativeState request
socket.Send(BrowserRuntimeCodec.encodeActionResult result)
| Error _ ->
match BrowserRuntimeCodec.decodeClient text with
| Ok legacyFrame -> handleLegacyFrame legacyFrame
| Error message -> rejectMalformedFrame message
Host 不得只收到 request 就回 Accepted。它必須先檢查 ExpectedDocumentRevision、完成 provider/resource prepare 與 authoritative swap,再回結果並發布新 revision。
authoritative document必須同時帶Rows與EditorSchemas。可修改row帶ptcs.dynamic.editor.binding.v1;client由document catalog生成Add/Edit表單,不接受host另外維護一份renderer-local schema registry。Edit request保留stable RowId,Host完成原位resource transition後以同一份new document revision發布row與binding。
Current exact package:PulseTrade.Comm.Spa.Dynamic.Interactive.Client 0.1.0-alpha23,exact依賴Contracts [0.1.0-alpha21]、Renderer [0.1.0-alpha49]與FSharp.Core [10.1.400];bundle manifest版本須與nuspec一致。Host需處理SharedCursorChanged與VisibleRangeChanged,accepted只解除pending,authoritative range/data仍由後續RuntimeFrame提交。Reconnect只有在authoritative Snapshot被接受後才重設backoff,單純WebSocket open不視為恢復成功。shared temporal axis使3,820 bars x 28 scalar series只傳一份時間metadata,client retention hard cap為4,000。
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- FSharp.Core (= 10.1.400)
- PulseTrade.Comm.Spa.Dynamic.Contracts (= 0.1.0-alpha21)
- PulseTrade.Comm.Spa.Dynamic.Renderer (= 0.1.0-alpha49)
- WebSharper.FSharp (>= 10.1.6.676)
- WebSharper.UI (>= 10.1.5.676)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on PulseTrade.Comm.Spa.Dynamic.Interactive.Client:
| Package | Downloads |
|---|---|
|
PulseTrade.Comm.Spa.Dynamic.Interactive.Extension
ColdFar Notebook kernel extension for provider-backed FSSTL sessions and PulseTrade SDUI TA views. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-alpha9 | 44 | 9/6/2026 |
| 0.1.0-alpha23 | 0 | 9/8/2026 |
| 0.1.0-alpha22 | 0 | 9/8/2026 |
| 0.1.0-alpha20 | 0 | 9/8/2026 |
| 0.1.0-alpha19 | 0 | 9/8/2026 |
| 0.1.0-alpha16 | 0 | 9/8/2026 |
| 0.1.0-alpha10 | 0 | 9/8/2026 |