kopular 0.11.1 → 0.11.3
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/LLM.md +34 -2
- package/package.json +1 -1
package/LLM.md
CHANGED
|
@@ -425,6 +425,34 @@ class CounterService {
|
|
|
425
425
|
}
|
|
426
426
|
```
|
|
427
427
|
|
|
428
|
+
## Common mistakes (seeded from real generation failures)
|
|
429
|
+
|
|
430
|
+
- **`Router.Param` is a plain `string`, not `state<T>` — don't `Subscribe()` to it.** A
|
|
431
|
+
`state<T>`-based design for it was tried and genuinely crashes: `Navigate()` sets `Param`
|
|
432
|
+
*before* the newly-matched page finishes mounting, so a page `Subscribe`-ing to it fires
|
|
433
|
+
while its own `Update()` still has no `ParentElement` to `replaceChild` into. `Render()`
|
|
434
|
+
already re-reads the fresh `Param` on every navigation with no extra step — just read
|
|
435
|
+
`this.Nav.Param` directly inside `Render()`.
|
|
436
|
+
- **Deploying a `Router`-based app needs SPA/history-fallback configured on the actual host**
|
|
437
|
+
— this bit the real `KopularDemo` production site (worked when navigated to via a link,
|
|
438
|
+
404'd on a direct refresh) before its Cloudflare Workers config had
|
|
439
|
+
`not_found_handling: "single-page-application"` set. Don't assume `ks build`/`npm run
|
|
440
|
+
build` alone is enough for a routed app to work on refresh at a non-root path — see
|
|
441
|
+
"Router" above for the exact config.
|
|
442
|
+
- **Cross-package consumption always goes through `extern`, never `using`.** `using
|
|
443
|
+
"kopular/component"` doesn't compile — `using` only resolves relative same-project paths.
|
|
444
|
+
Redeclare the members you need as `extern ... from "kopular/component"` instead (see
|
|
445
|
+
"Consuming Kopular from your own KopScript project" above) even though it looks like it
|
|
446
|
+
should "just work" the way an npm `import` would.
|
|
447
|
+
- **A template's `*if`/`*for` and the hand-written `If()`/`.ForEach()` helpers are two
|
|
448
|
+
independent mechanisms, not the same thing wired two ways** — a template never needs
|
|
449
|
+
`directives.ks`'s `If()` imported or called; `*if`/`*for` compile to real `if`/`for`
|
|
450
|
+
directly. Don't mix a template with a hand-written-`Render()` helper call.
|
|
451
|
+
- **No two-way binding, anywhere.** Wiring a template's `[value]` or a hand-written
|
|
452
|
+
`.Value` to a real `<input>` back and forth always needs an explicit
|
|
453
|
+
`addEventListener("input", ...)` — there's no `[(ngModel)]`-equivalent to reach for in
|
|
454
|
+
either authoring style.
|
|
455
|
+
|
|
428
456
|
## Does not exist
|
|
429
457
|
|
|
430
458
|
DI container/injector · decorators (`@Injectable`, `@Component`, ...) · a runtime
|
|
@@ -432,5 +460,9 @@ template engine or interpreted expression language — templates compile to the
|
|
|
432
460
|
imperative `Render()` code as the hand-written form, checked at compile time, not
|
|
433
461
|
interpreted at runtime (see "Templates" above) · two-way binding (`[(ngModel)]`) ·
|
|
434
462
|
vdom diffing / reconciliation beyond a single component's own re-render · pipes ·
|
|
435
|
-
animations ·
|
|
436
|
-
|
|
463
|
+
animations · typed/generic HTTP responses (`Http` returns raw text — see above) · SSR.
|
|
464
|
+
|
|
465
|
+
(`FormField<T>`/`Validators` and `kp new` — see "FormField<T> / Validators" and "Starting
|
|
466
|
+
a new project" above — are real, shipped features; they used to be listed here as gaps
|
|
467
|
+
before those landed and this list wasn't updated at the time. Leaving this parenthetical
|
|
468
|
+
rather than quietly deleting it, as a reminder to keep this list in sync going forward.)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kopular",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.3",
|
|
4
4
|
"description": "Kopular: a small component framework for KopScript — components, reactive state, constructor-injected services, routing, real compiled templates, and HTTP, with no DI container",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|