@procedures/splay 0.42.0 → 0.44.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,38 @@
1
1
  # @procedures/splay
2
2
 
3
+ ## 0.44.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [4dada47]
8
+ - Updated dependencies [19b7a25]
9
+ - @procedures/client@0.44.0
10
+
11
+ ## 0.43.0
12
+
13
+ ### Minor Changes
14
+
15
+ - 79536cf: The component helpers of `@procedures/splay` register nothing in the global registry (O75, rule I2). This change breaks the API.
16
+
17
+ - `defineComponent()`, `simpleComponent()`, `namespacedComponent()` and `streamingComponent()` only give the definition. They do not register a procedure in `PROCEDURE_REGISTRY`.
18
+ - `registerBundle()` and its export are removed.
19
+ - `componentModule(name, components)` replaces the two. It gives the procedures of a bundle or of a list of definitions as a module. Give the module to `createRegistry()` or `registerModules()`.
20
+ - `./register` of `@procedures/splay` does not change. It registers the bridge procedures `splay.bridge.info` and `splay.bridge.health`.
21
+
22
+ Migration:
23
+
24
+ - An app that calls `defineComponent()` and then starts the procedure of a component by its path gives the definitions to `componentModule()`. Then it registers the module.
25
+ - For a registry of the app: `createRegistry(componentModule("my-app/ui", [userCard, badge]))`.
26
+ - For the global registry: `registerModules(PROCEDURE_REGISTRY, [componentModule("my-app/ui", [userCard, badge])])`. Put this call in the `src/register.ts` of the app.
27
+ - An app that uses `registerBundle(bundle)` uses `registerModules(PROCEDURE_REGISTRY, [componentModule("my-app/ui", bundle)])`. The components of the bundle keep their paths.
28
+ - The site: the site does not use these functions. No step is necessary.
29
+ - MiniMongo, Graph and jarvis: find each call of `defineComponent`, `simpleComponent`, `namespacedComponent`, `streamingComponent` and `registerBundle`. Do the steps above for each one. An app without these calls has no step.
30
+ - `componentModule()` and `createBundle()` accept a definition with a typed `input` schema. `AnyComponentDefinition` erases the data type with `any`, as `AnyProcedure` does.
31
+
32
+ ### Patch Changes
33
+
34
+ - @procedures/client@0.43.0
35
+
3
36
  ## 0.42.0
4
37
 
5
38
  ### Patch Changes
package/README.md CHANGED
@@ -378,7 +378,20 @@ import {
378
378
  } from "@procedures/splay";
379
379
  ```
380
380
 
381
- `componentModule(name, components)` gives the component procedures as a module for `createRegistry()`. It registers nothing. `defineComponent`, `simpleComponent`, `namespacedComponent`, `streamingComponent` and `registerBundle` register in the global registry. That registration is deprecated, and the next MINOR removes it.
381
+ `defineComponent`, `simpleComponent`, `namespacedComponent` and `streamingComponent` give the definition of a component. They register nothing. `componentModule(name, components)` gives the procedures of the components as a module. The path of each procedure is `["components", namespace?, type]`. Give the module to `createRegistry()`, or to `registerModules()` for the global registry:
382
+
383
+ ```typescript
384
+ import { createRegistry, registerModules, PROCEDURE_REGISTRY } from "@procedures/client";
385
+ import { componentModule, createBundle, simpleComponent } from "@procedures/splay";
386
+
387
+ const badge = simpleComponent("badge", (ctx) => ({ type: "badge", props: { label: ctx.data } }));
388
+ const uiModule = componentModule("my-app/ui", createBundle("ui", [badge]));
389
+
390
+ const registry = createRegistry(uiModule); // components.ui.badge in a new registry
391
+ registerModules(PROCEDURE_REGISTRY, [uiModule]); // components.ui.badge in the global registry
392
+ ```
393
+
394
+ Before 0.42.0, the four functions registered each component in the global registry, and `registerBundle()` registered a bundle. At this time, `componentModule()` replaces the two.
382
395
 
383
396
  ### Package Hierarchy
384
397