@kudzujs/core 0.16.44 → 0.16.45

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.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.
17
+ **Current release: [0.16.45](https://github.com/kudzujs/kudzu/releases/tag/v0.16.45).** Unsupported non-null refs in named components now receive an authored-source diagnostic without hiding keyed-row or setter-child diagnostics. Accepted WebSocket output remains unchanged. 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)
@@ -911,7 +911,8 @@ function createKudzuTransformer({ semantic, handlerUrl, file, sourceFiles, sourc
911
911
  const owner = nearestFunction(node)
912
912
  if (owner && node.initializer.expression.text === "useRef") {
913
913
  const nullInitializer = node.initializer.arguments.length === 1 && node.initializer.arguments[0].kind === ts.SyntaxKind.NullKeyword
914
- if (!nullInitializer && owner.modifiers?.some(modifier => modifier.kind === ts.SyntaxKind.DefaultKeyword)) throw sourceNodeError(node.initializer, sourceFile, "Mutable useRef() values must be referenced exclusively inside one owned effect; DOM refs require useRef(null)")
914
+ const attachedToJsx = !nullInitializer && referenceIdentifiers(owner.body, node.name.text).some(reference => ts.isJsxExpression(reference.parent) && ts.isJsxAttribute(reference.parent.parent) && reference.parent.parent.name.text === "ref")
915
+ if (!nullInitializer && !attachedToJsx && (owner.parent === sourceFile || ts.isVariableDeclaration(owner.parent) && owner.parent.parent?.parent?.parent === sourceFile)) throw sourceNodeError(node.initializer, sourceFile, "Mutable useRef() values must be referenced exclusively inside one owned effect; DOM refs require useRef(null)")
915
916
  if (nullInitializer) {
916
917
  ensureOwner(owner)
917
918
  componentAnalysis.registerRef(owner, { name: node.name.text, site: analysisSite(node, "hook"), source: analysisSource(node) })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kudzujs/core",
3
- "version": "0.16.44",
3
+ "version": "0.16.45",
4
4
  "description": "HTML-first TSX framework with synchronous state semantics and no virtual DOM",
5
5
  "type": "module",
6
6
  "license": "MIT",