@barefootjs/jsx 0.9.3 → 0.9.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/package.json +2 -2
- package/src/jsx-runtime/index.d.ts +26 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@barefootjs/jsx",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.4",
|
|
4
4
|
"description": "JSX compiler for BarefootJS - transforms JSX to server HTML + client JS",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"directory": "packages/jsx"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@barefootjs/shared": "0.9.
|
|
56
|
+
"@barefootjs/shared": "0.9.4"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"@barefootjs/client": ">=0.2.0",
|
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
// @ts-nocheck — suppress TS2411 in THIS shim only; types stay strong for consumers.
|
|
2
|
+
//
|
|
3
|
+
// `IntrinsicElements` pairs explicitly-typed elements (input, button, svg, …)
|
|
4
|
+
// with a `[tagName: string]: HTMLBaseAttributes` catch-all for unknown tags.
|
|
5
|
+
// TS2411 ("Property 'input' … is not assignable to 'string' index type
|
|
6
|
+
// 'HTMLBaseAttributes'") fires because the per-element types intentionally
|
|
7
|
+
// narrow `ref` to a concrete subtype (`HTMLInputElement`, …) and re-declare
|
|
8
|
+
// event handlers — neither assignable to the `HTMLElement`-typed base under
|
|
9
|
+
// `strictFunctionTypes`. The diagnostic is spurious *for JSX*: a tag name
|
|
10
|
+
// always resolves to its explicit entry, never to the index signature, so the
|
|
11
|
+
// "incompatible index access" TS2411 guards against cannot happen here.
|
|
12
|
+
//
|
|
13
|
+
// `tsc` never surfaced it (the repo builds with `skipLibCheck`), but
|
|
14
|
+
// `deno publish` (JSR) always type-checks `.d.ts` and broke the
|
|
15
|
+
// `@barefootjs/hono` release with 31 of these. We suppress the self-check of
|
|
16
|
+
// this one declarative shim rather than widen the catch-all to
|
|
17
|
+
// `Record<string, any>` — widening would silently drop attribute checking for
|
|
18
|
+
// custom/web-component tags (`<my-widget foo>` would stop erroring). Consumers
|
|
19
|
+
// are unaffected: `@ts-nocheck` only disables errors *within* this file; its
|
|
20
|
+
// declarations (and their full strictness) still apply at every use site.
|
|
21
|
+
//
|
|
1
22
|
/**
|
|
2
23
|
* BarefootJS JSX Runtime - Type Definitions Only
|
|
3
24
|
*
|
|
@@ -324,7 +345,11 @@ export declare namespace JSX {
|
|
|
324
345
|
ref?: (element: SVGForeignObjectElement) => void
|
|
325
346
|
}
|
|
326
347
|
|
|
327
|
-
//
|
|
348
|
+
// Catch-all for any other (custom / unknown) element. Typed as
|
|
349
|
+
// `HTMLBaseAttributes` so unknown tags (e.g. web components) still get
|
|
350
|
+
// base-attribute checking instead of `any`. See the file-level
|
|
351
|
+
// `@ts-nocheck` note for why this trips TS2411 under `deno publish` and
|
|
352
|
+
// why suppressing it (rather than widening to `any`) is correct.
|
|
328
353
|
[tagName: string]: HTMLBaseAttributes
|
|
329
354
|
}
|
|
330
355
|
}
|