@kudzujs/core 0.16.41 → 0.16.44

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
@@ -14,7 +14,7 @@ Kudzu compiles ordinary React-shaped TypeScript and TSX into complete static HTM
14
14
 
15
15
  > Experimental `0.16.x`: the compiler API and supported TSX surface may change.
16
16
 
17
- **Current release: [0.16.41](https://github.com/kudzujs/kudzu/releases/tag/v0.16.41).** Realtime ref diagnostics now point to existing effect-local ownership and cleanup without changing compiled browser output. The AI-authoring cost experiments have not established a reliable saving; the AI-cost/1.0 gates remain blocked.
17
+ **Current release: [0.16.44](https://github.com/kudzujs/kudzu/releases/tag/v0.16.44).** Effect-owned callback refs used by event handlers now fail at authored source instead of silently producing a broken page. Repository browser checks surface caught Error objects and wait for complete Chrome connection details. No reliable AI-token saving is established; the AI-cost/1.0 gates remain blocked.
18
18
 
19
19
  - [Documentation](https://kudzujs.cloud/docs)
20
20
  - [Installation guide](https://kudzujs.cloud/docs#install)
@@ -80,6 +80,11 @@ export function normalizeEffectPrivateRefs(sourceFile, factory, context) {
80
80
  const callback = effect.arguments[0]
81
81
  return callback && accesses.every(access => isNodeWithin(access, callback))
82
82
  })
83
+ const effectCallbacks = effectCalls.map(effect => effect.arguments[0]).filter(Boolean)
84
+ const outsideEffect = accesses.find(access => !effectCallbacks.some(callback => isNodeWithin(access, callback)))
85
+ if (!attachedToJsx && outsideEffect && mutations.some(access => effectCallbacks.some(callback => isNodeWithin(access, callback)))) {
86
+ throw sourceNodeError(outsideEffect, sourceFile, "Effect-owned mutable refs cannot be used outside their owning effect; use a state-driven effect and keep resource callbacks effect-local")
87
+ }
83
88
  if (!frameAssignments.length && refInitializer?.kind === ts.SyntaxKind.NullKeyword && !invalidReference && !effects.length) {
84
89
  const owners = effectCalls.filter(effect => {
85
90
  const callback = effect.arguments[0]
@@ -18,12 +18,12 @@ export function createSourceGraph(root) {
18
18
 
19
19
  const ordinaryRuntimeDependencies = (file, sourceFile, sourceFiles, isStaticImport) => {
20
20
  const dependencies = []
21
- const bindingIndex = createBindingIndex(sourceFile)
21
+ let bindingIndex
22
22
  const rejectDynamicImports = node => {
23
23
  if (ts.isCallExpression(node) && node.expression.kind === ts.SyntaxKind.ImportKeyword) {
24
24
  const argument = node.arguments[0]
25
25
  const specifier = node.arguments.length === 1 && ts.isStringLiteralLike(argument) ? JSON.stringify(argument.text) : argument?.getText(sourceFile) ?? "<missing>"
26
- if (ownedLazyPackageImport(node, bindingIndex)) return
26
+ if (ownedLazyPackageImport(node, bindingIndex ??= createBindingIndex(sourceFile))) return
27
27
  throw sourceNodeError(node, sourceFile, `Dynamic import ${specifier} is not supported in ordinary source modules`, {
28
28
  code: "source.dynamic-import.unsupported",
29
29
  stage: "graph",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kudzujs/core",
3
- "version": "0.16.41",
3
+ "version": "0.16.44",
4
4
  "description": "HTML-first TSX framework with synchronous state semantics and no virtual DOM",
5
5
  "type": "module",
6
6
  "license": "MIT",