tutuca 0.9.66 → 0.9.67

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tutuca",
3
- "version": "0.9.66",
3
+ "version": "0.9.67",
4
4
  "type": "module",
5
5
  "description": "Zero-dependency SPA framework with immutable state and virtual DOM",
6
6
  "main": "./dist/tutuca.js",
@@ -332,11 +332,19 @@ Explicit field types via `classFromData`:
332
332
 
333
333
  ```js
334
334
  fields: {
335
- count: { type: "int", defaultValue: 10 }, // text/int/float/bool/list/map/omap/set/any
336
- child: { component: "Item", args: { ... } }, // nested component instance
335
+ count: { type: "int", defaultValue: 10 }, // text/int/float/bool/list/map/omap/set/any
336
+ child: { component: "Item", args: { ... } }, // deferred reference by name
337
+ child2: Item.make({ name: "" }), // direct default if Item is in scope
337
338
  }
338
339
  ```
339
340
 
341
+ The `{ component, args }` form is for when the referenced component is **not
342
+ available** at field-definition time (forward reference, circular import).
343
+ `component` must be the component **name as a string** — passing the class
344
+ itself is a common mistake and is flagged by lint code
345
+ `COMP_FIELD_BAD_SHAPE`. When the component class **is** in scope, prefer
346
+ `ComponentName.make({...})` as the default value — no string indirection.
347
+
340
348
  ## Methods as Predicates & Computed Values
341
349
 
342
350
  A no-arg method called via `$name` is invoked and its return value is
@@ -98,10 +98,11 @@ Comp.input.handlerName.call(comp, arg1, arg2, /* … */);
98
98
  You can call each one directly with `.call(comp, ...)`, but in practice
99
99
  you want to test them as a pipeline: filter + loop-data + enrichment
100
100
  together produce a list of bindings the view sees. Use
101
- `collectIterBindings` from `tutuca/dev` for that:
101
+ `collectIterBindings` for that a functional implementation only ships
102
+ in the `tutuca-dev` build; the core `tutuca` build exports a no-op stub:
102
103
 
103
104
  ```js
104
- import { collectIterBindings } from "tutuca/dev";
105
+ import { collectIterBindings } from "tutuca";
105
106
 
106
107
  const c = MyComp.make({ items: [...] });
107
108
  const r = collectIterBindings(MyComp, c, c.items, {
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: tutuca-source
3
+ description: The bundled framework source (`dist/tutuca.ext.js`) wrapped as a skill so the agent can grep it. Use only when debugging — to confirm what the framework actually does, trace an error from the framework, or find the implementation of a method you saw in a stack trace. Always reach for `grep_skill_files` first, then `load_skill_file` with `startLine`/`endLine` to read a window around a hit. Not for component-authoring guidance — use the `tutuca` skill for that.
4
+ ---
5
+
6
+ <!-- This file is generated by scripts/build-skill.js. Do not edit. -->
7
+
8
+ # Tutuca source
9
+
10
+ The bundled framework that ships to users — the ESM at `dist/tutuca.ext.js`.
11
+ This skill exposes it as one file (`tutuca.ext.js`) so the agent can read
12
+ the implementation when needed.
13
+
14
+ ## How to read it
15
+
16
+ - It is **one large file** (~3.8K lines). Loading it whole will flood your
17
+ context — always `grep_skill_files("tutuca-source", "<pattern>")` first,
18
+ then `load_skill_file("tutuca-source", "tutuca.ext.js", { startLine, endLine })`
19
+ to pull a small window around a match.
20
+ - It is the **bundled** output: ESM, not minified, no source map. Class and
21
+ function names match the original sources; comments do not survive.
22
+
23
+ ## When to use
24
+
25
+ - A `lint_component` / `render_component` result mentions a framework
26
+ function or error string you don't recognise — grep for it.
27
+ - A component crashes inside the framework — grep the error message or the
28
+ framework function in the stack trace.
29
+ - A behavior is surprising and you want to confirm exactly what the framework
30
+ does, not what the docs say it does.
31
+
32
+ **Don't** use this skill for *how to write* tutuca components — that's the
33
+ `tutuca` skill. Reach here only when you need to read the implementation.