@backtickjs/jsx-react 0.3.1 → 0.4.0

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.
@@ -1,8 +1,8 @@
1
- import { type Client, type JsxElementOf, type JsxElementTypeOf, type Spliceable } from "@backtickjs/core";
1
+ import { type Client, type JsxElementOf, type ServerComponent, type Spliceable } from "@backtickjs/core";
2
2
  import type { JSX as React, ReactElement, ReactNode } from "react";
3
3
  export declare namespace JSX {
4
4
  type Element = JsxElementOf<React.Element>;
5
- type ElementType = JsxElementTypeOf<ReactNode> | React.ElementType;
5
+ type ElementType = string | ((props: never) => ReactNode) | ServerComponent<ReactNode> | React.ElementType;
6
6
  type ElementClass = React.ElementClass;
7
7
  type ElementAttributesProperty = React.ElementAttributesProperty;
8
8
  type ElementChildrenAttribute = React.ElementChildrenAttribute;
@@ -2,17 +2,17 @@ import { createJsxElement, cs, } from "@backtickjs/core";
2
2
  const createElement = { "@backtickjs": "ClientImport", name: "createElement", from: "react", version: "19.2.3" };
3
3
  const ReactFragment = { "@backtickjs": "ClientImport", name: "Fragment", from: "react", version: "19.2.3" };
4
4
  const $module0 = {
5
- id: "2qc9pgkww5cp4:45:9",
5
+ id: "3gizgjqptgn6p:49:9",
6
6
  code: "(module, exports, require) => {\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = (($splice0, $splice1, $splice2) => $splice0()($splice1(), null, ...$splice2()));\n}",
7
- map: "{\"version\":3,\"file\":\"module.jsx\",\"mappings\":\";;;mBA4CY,4CAAc,CACtB,UAAc,EACd,IAAI,EACJ,GAAI,UAAyB,CAC9B\",\"names\":[],\"ignoreList\":[],\"sources\":[\"@backtickjs/jsx-react/src/jsx-runtime.ts\"]}",
7
+ map: "{\"version\":3,\"file\":\"module.jsx\",\"mappings\":\";;;mBAgDY,4CAAc,CACtB,UAAc,EACd,IAAI,EACJ,GAAI,UAAyB,CAC9B\",\"names\":[],\"ignoreList\":[],\"sources\":[\"@backtickjs/jsx-react/src/jsx-runtime.ts\"]}",
8
8
  dependencies: [],
9
9
  params: [{ kind: "splice", bindings: [] }, { kind: "splice", bindings: [] }, { kind: "splice", bindings: [] }],
10
10
  kind: "expression"
11
11
  };
12
12
  const $module1 = {
13
- id: "2qc9pgkww5cp4:70:9",
13
+ id: "3gizgjqptgn6p:74:9",
14
14
  code: "(module, exports, require) => {\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = (($splice0, $splice1, $splice2, $splice3) => $splice0()($splice1(), { key: $splice2() }, $splice3()));\n}",
15
- map: "{\"version\":3,\"file\":\"module.jsx\",\"mappings\":\";;;mBAqEY,sDAAc,CACtB,UAAc,EACd,EAAE,GAAG,EAAE,UAAI,EAAE,EACb,UAAQ,CACT\",\"names\":[],\"ignoreList\":[],\"sources\":[\"@backtickjs/jsx-react/src/jsx-runtime.ts\"]}",
15
+ map: "{\"version\":3,\"file\":\"module.jsx\",\"mappings\":\";;;mBAyEY,sDAAc,CACtB,UAAc,EACd,EAAE,GAAG,EAAE,UAAI,EAAE,EACb,UAAQ,CACT\",\"names\":[],\"ignoreList\":[],\"sources\":[\"@backtickjs/jsx-react/src/jsx-runtime.ts\"]}",
16
16
  dependencies: [],
17
17
  params: [{ kind: "splice", bindings: [] }, { kind: "splice", bindings: [] }, { kind: "splice", bindings: [] }, { kind: "splice", bindings: [] }],
18
18
  kind: "expression"
@@ -1 +1 @@
1
- {"version":3,"file":"jsx-runtime.js","sourceRoot":"","sources":["../src/jsx-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,EAAE,GAKH,MAAM,kBAAkB,CAAC;;;;;;;;;;;;;;;;;;;AAwB1B;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,KAExB;IACC,MAAM,QAAQ,GACZ,KAAK,CAAC,QAAQ,KAAK,SAAS;QAC1B,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KA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M,OAAO,GAAG,gBAAgB,CAC9B,IAAiC,EACjC,KAAK,CACoB,CAAC;IAC5B,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;QACtB,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,OAAO,iEAIU,CAAC;AACpB,CAAC;AAED,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,CAAC;AACxB,oEAAoE;AACpE,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backtickjs/jsx-react",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "React's JSX for Backtick: a JSX runtime for server components, and the compile plugin for scripts",
5
5
  "keywords": [
6
6
  "backtick",
@@ -49,7 +49,7 @@
49
49
  "access": "public"
50
50
  },
51
51
  "dependencies": {
52
- "@backtickjs/core": "0.3.1"
52
+ "@backtickjs/core": "0.4.0"
53
53
  },
54
54
  "peerDependencies": {
55
55
  "react": "^19.2.3",
@@ -57,11 +57,11 @@
57
57
  "typescript": "^6.0.3"
58
58
  },
59
59
  "devDependencies": {
60
- "@backtickjs/bundler": "0.3.1",
61
- "@backtickjs/compiler": "0.3.1",
62
- "@backtickjs/prettier-plugin": "0.3.1",
63
- "@backtickjs/tsc": "0.3.1",
64
- "@backtickjs/tspatch-plugin": "0.3.1",
60
+ "@backtickjs/bundler": "0.4.0",
61
+ "@backtickjs/compiler": "0.4.0",
62
+ "@backtickjs/prettier-plugin": "0.4.0",
63
+ "@backtickjs/tsc": "0.4.0",
64
+ "@backtickjs/tspatch-plugin": "0.4.0",
65
65
  "@types/react": "19.2.18",
66
66
  "@types/react-dom": "19.2.7",
67
67
  "global-jsdom": "^30.0.0",
@@ -3,7 +3,7 @@ import {
3
3
  cs,
4
4
  type Client,
5
5
  type JsxElementOf,
6
- type JsxElementTypeOf,
6
+ type ServerComponent,
7
7
  type Spliceable,
8
8
  } from "@backtickjs/core";
9
9
  import type { JSX as React, ReactElement, ReactNode } from "react";
@@ -16,7 +16,11 @@ import { createElement, Fragment as ReactFragment } from "react" with {
16
16
  // server component, which answers a script.
17
17
  export declare namespace JSX {
18
18
  export type Element = JsxElementOf<React.Element>;
19
- export type ElementType = JsxElementTypeOf<ReactNode> | React.ElementType;
19
+ export type ElementType =
20
+ | string
21
+ | ((props: never) => ReactNode)
22
+ | ServerComponent<ReactNode>
23
+ | React.ElementType;
20
24
  export type ElementClass = React.ElementClass;
21
25
  export type ElementAttributesProperty = React.ElementAttributesProperty;
22
26
  export type ElementChildrenAttribute = React.ElementChildrenAttribute;