@hydranium/data-server 1.0.0-next.17 → 1.0.0-next.174
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/README.md +15 -2
- package/lib/data-server.d.ts +375 -191
- package/lib/data-server.d.ts.map +1 -1
- package/lib/data-server.js +580 -336
- package/lib/data-server.js.map +1 -1
- package/lib/messages/index.d.ts +18 -0
- package/lib/messages/index.d.ts.map +1 -0
- package/lib/messages/index.js +18 -0
- package/lib/messages/index.js.map +1 -0
- package/lib/testing/data-server-harness.d.ts +7 -1
- package/lib/testing/data-server-harness.d.ts.map +1 -1
- package/lib/testing/data-server-harness.js +5 -2
- package/lib/testing/data-server-harness.js.map +1 -1
- package/package.json +17 -8
- package/src/data-server.ts +716 -360
- package/src/messages/index.ts +26 -0
- package/src/testing/data-server-harness.ts +16 -1
package/README.md
CHANGED
|
@@ -19,11 +19,22 @@ Installed by the server process that already composes
|
|
|
19
19
|
`getModelDocument`, `updateModelDocument`, `saveModelDocument`,
|
|
20
20
|
`closeModelDocument`, `watchModelDocument` / `unwatchModelDocument`, and
|
|
21
21
|
`waitForReady` for clients that must not race workspace initialisation.
|
|
22
|
+
- **Client sessions per connection:** `createSession` registers a participant,
|
|
23
|
+
whose requests then write only what it has open; `createModelDocument` and
|
|
24
|
+
the all-or-none `updateModelDocuments` serve sessions only; `closeSession`, or
|
|
25
|
+
the connection closing, ends a session and closes everything it has open. See
|
|
26
|
+
[Client sessions](../../docs/concepts/client-sessions.md).
|
|
22
27
|
- **Push notifications instead of polling:** `onDocumentUpdated` when a
|
|
23
28
|
subscribed document reaches the configured build phase
|
|
24
29
|
(`DataServerOptions.subscriptionPhase`, `DocumentState.Validated` by default),
|
|
25
|
-
`onDocumentSaved` on a separate channel,
|
|
26
|
-
|
|
30
|
+
`onDocumentSaved` on a separate channel, `onDocumentDirtyChanged` when a
|
|
31
|
+
subscribed document starts or stops differing from its file (every document
|
|
32
|
+
the head sends that it holds also carries its current `dirty`, and a
|
|
33
|
+
`textHash` of its text), `onDocumentDeleted` (a deleted document has no built
|
|
34
|
+
state to carry, and the build-phase path never runs for one),
|
|
35
|
+
`onDocumentsBuilt` once per build for the documents nobody watches — chiefly
|
|
36
|
+
those rebuilt as a cascade, which no filesystem watcher can see because their
|
|
37
|
+
own files did not change — and `onProjectsChanged` from the project registry.
|
|
27
38
|
- **Projects as first-class:** `getProjects` and `getProjectForUri`, answered from
|
|
28
39
|
the framework's `ProjectManager`.
|
|
29
40
|
- **An opt-in reference/naming slice** — `findReferenceCandidates`,
|
|
@@ -38,6 +49,8 @@ The projection itself is not this package's: it delegates to `TransferEncoder`
|
|
|
38
49
|
and `ModelService` from `@hydranium/core`, so there is no second in-memory model
|
|
39
50
|
to keep in sync.
|
|
40
51
|
|
|
52
|
+
For the adopter extension path, see [Add a data-server method](../../docs/guides/data-server-method.md). It covers the typed subclass, `additionalMethods`, shared namespace, and client proxy as one wire contract.
|
|
53
|
+
|
|
41
54
|
## Install
|
|
42
55
|
|
|
43
56
|
```bash
|