wcstack 4.0.0-rc.2 → 4.0.0-rc.4

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 CHANGED
@@ -51,7 +51,7 @@ Loading the bundle alongside an individual package's `/auto` is safe: whichever
51
51
 
52
52
  If you want npm packages for local development, install the individual ones (`@wcstack/state`, `@wcstack/router`, …); this package publishes only the bundle and this guide.
53
53
 
54
- `@wcstack/state` also ships **split entries** for a page that deliberately leaves features out. The full-package `/auto` above includes every feature, needs none of this, and stays the default. The features are `temporal` (`$watch` / `$stream`), `list-keys` (`$listKeys`), `scopes` (`bind-component`, `mount=`, DCC), `recursion` (`$recursion`), `ssr` (`enable-ssr`), `formats` (the locale formatting filters), `diagnostics` (full message sentences and development warnings) and `devtools`. A declaration whose feature is missing throws `[wcs/feature-not-installed]`. Two ways to load them:
54
+ `@wcstack/state` also ships **split entries** for a page that deliberately leaves features out. The full-package `/auto` above includes every feature, needs none of this, and stays the default. The features are `temporal` (`$watch` / `$stream`), `list-keys` (`$listKeys`), `scopes` (`bind-component`, `mount=`, DCC), `recursion` (`$recursion`), `ssr` (`enable-ssr`), `formats` (every filter but the 10 conditions: arithmetic, conversion, defaults and the formatting filters), `diagnostics` (full message sentences and development warnings) and `devtools`. A declaration whose feature is missing throws `[wcs/feature-not-installed]`. Two ways to load them:
55
55
 
56
56
  - **The split auto entry**, one tag and no import map. `features="…"` on the document's root `<wcs-state>` names what must be there before any `<wcs-state>` starts (`scopes`) and the development aids (`diagnostics`, `devtools`); each state's `$features` names what it needs (`$features: ["temporal", "formats"]`), loaded before that state is built. An unknown name fails with `[wcs/feature-unknown]`.
57
57
 
@@ -295,7 +295,7 @@ Where a handler needs the element-level behaviour, write `on*#direct:`. The list
295
295
  - A `$connectedCallback` that throws or rejects is reported as `… $connectedCallback failed.`; `connectedCallbackPromise` rejects, but `getBindingsReady()` resolves — the page is bound.
296
296
  - A binding that fails inside a `for:` / `if:` row, or that fails to apply later, goes to `$errorCallback(error, { path, bindingType, node })` when the state declares one, else to the console; the rest of the page keeps working.
297
297
  - One root `<wcs-state>` per document or shadow root: a second one fails to initialize. Graft more state with `mount=`.
298
- - On `/core` without the `diagnostics` feature, messages carry a code, a number and the values (`[@wcstack/state] [wcs/filter-unknown] #501 "uc"`) instead of the sentence: look the number up in [`docs/state-errors.md`](https://github.com/wcstack/wcstack/blob/main/docs/state-errors.md).
298
+ - On `/core` without the `diagnostics` feature, messages carry a number and the values (`[@wcstack/state] #501 "uc"`) instead of the code and the sentence: look the number up in [`docs/state-errors.md`](https://github.com/wcstack/wcstack/blob/main/docs/state-errors.md).
299
299
 
300
300
  ---
301
301
 
@@ -411,16 +411,15 @@ Older names appear all over the training data. 4.0 rejects them: write the name
411
411
  | `$watch` (fold a path's changes) · `$on` (fold event tokens) into an ordinary key | `$scan` |
412
412
  | `this.$dependOn(path)` · `this.$untracked(fn)` | `$trackDependency` · `$untrackDependency` |
413
413
 
414
- An old filter name or `substr` fails initialization with `[wcs/filter-unknown]` (the full entries name the replacement); `$streams`, `$updatedCallback` and `$scan` throw when the state loads; `$trackDependency` / `$untrackDependency` throw when read. The lint reports the declarations and API names as errors, and the filters as `wcs/filter-unknown` warnings (a page may register filters of its own) — which still throw at run time. `$renderedCallback` reports the **bindings that were applied**, not every state change — use `$watch` for those.
414
+ An old filter name or `substr` fails initialization with `[wcs/filter-unknown]` (the full entries name the replacement); `$streams`, `$updatedCallback` and `$scan` throw when the state loads; `$trackDependency` / `$untrackDependency` throw when read (the `diagnostics` feature, which `/auto` includes, detects these five; on `/core` without it they do nothing). The lint reports the declarations and API names as errors, and the filters as `wcs/filter-unknown` warnings (a page may register filters of its own) — which still throw at run time. `$renderedCallback` reports the **bindings that were applied**, not every state change — use `$watch` for those.
415
415
 
416
416
  ---
417
417
 
418
418
  ## Known limitations
419
419
 
420
- - **One object reachable from two rows** — the same object at two positions of a list, or in two lists (a getter returning a filtered copy of `todos`, rendered with `for:`, while a row writes into it): a write below one row does not reach the other row's bindings and row getters. Do not write below such a row; replace the object in the top-level list instead, as the app above does (`toggle()` reassigns `todos` with a new object for the changed item, and the checkbox is `checked#ro:`).
421
- - **Numeric keys under a plain object** (`sales.2024.total`, `usersById.42.name`): markup renders them, but a script read gives `undefined` and a write throws. Read `this.sales[2024].total`, write by assigning a new object to the top-level key, or use keys that are not numbers.
420
+ - **One object at two positions of one list, or in two arrays no getter relates** (`backup = items; items = items.filter(…)`, both rendered): a write below one row does not reach the other row's bindings and row getters. Do not write below such a row; replace the object in the top-level list instead, as the app above does (`toggle()` reassigns `todos` with a new object for the changed item, and the checkbox is `checked#ro:`). Arrays a getter relates are fine: with `get shown()` returning a filtered copy of `todos`, a write below a row of either list reaches the other's row, `todos.*` readers and the filter.
422
421
 
423
- Details, and the other known limitations (enumerating the state after a re-set, an endless `$watch` → `$stream` loop, elements removed and put back, comments between chained `if:` templates under SSR): the migration guide, [§5](https://github.com/wcstack/wcstack/blob/main/docs/migration-v4.md#5-known-limitations).
422
+ Details: the migration guide, [§5](https://github.com/wcstack/wcstack/blob/main/docs/migration-v4.md#5-known-limitations).
424
423
 
425
424
  ---
426
425