@solidjs/h 2.0.0-experimental.9 → 2.0.0-rc.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.
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@solidjs/h",
3
- "description": "A standard (less-optimal) JSX factory for Solid",
4
- "version": "2.0.0-experimental.9",
3
+ "description": "Hyperscript / h() factory for Solid — write components without compiled JSX.",
4
+ "version": "2.0.0-rc.0",
5
5
  "author": "Ryan Carniato",
6
6
  "license": "MIT",
7
7
  "homepage": "https://solidjs.com",
8
8
  "repository": {
9
9
  "type": "git",
10
- "url": "https://github.com/solidjs/solid-h"
10
+ "url": "git+https://github.com/solidjs/solid.git",
11
+ "directory": "packages/solid-h"
11
12
  },
12
13
  "publishConfig": {
13
14
  "access": "public"
@@ -20,46 +21,65 @@
20
21
  "files": [
21
22
  "dist",
22
23
  "types",
24
+ "types-cjs",
23
25
  "package.json",
24
26
  "jsx-runtime/dist",
25
27
  "jsx-runtime/types",
28
+ "jsx-runtime/types-cjs",
26
29
  "jsx-runtime/package.json",
27
30
  "jsx-dev-runtime/package.json"
28
31
  ],
29
32
  "exports": {
30
33
  ".": {
31
- "types": "./types/index.d.ts",
32
- "import": "./dist/h.js",
33
- "require": "./dist/h.cjs"
34
+ "import": {
35
+ "types": "./types/index.d.ts",
36
+ "default": "./dist/h.js"
37
+ },
38
+ "require": {
39
+ "types": "./types-cjs/index.d.cts",
40
+ "default": "./dist/h.cjs"
41
+ }
34
42
  },
35
43
  "./jsx-runtime": {
36
- "types": "./jsx-runtime/types/index.d.ts",
37
- "import": "./jsx-runtime/dist/jsx.js",
38
- "require": "./jsx-runtime/dist/jsx.cjs"
44
+ "import": {
45
+ "types": "./jsx-runtime/types/index.d.ts",
46
+ "default": "./jsx-runtime/dist/jsx.js"
47
+ },
48
+ "require": {
49
+ "types": "./jsx-runtime/types-cjs/index.d.cts",
50
+ "default": "./jsx-runtime/dist/jsx.cjs"
51
+ }
39
52
  },
40
53
  "./jsx-dev-runtime": {
41
- "types": "./jsx-runtime/types/index.d.ts",
42
- "import": "./jsx-runtime/dist/jsx.js",
43
- "require": "./jsx-runtime/dist/jsx.cjs"
54
+ "import": {
55
+ "types": "./jsx-runtime/types/index.d.ts",
56
+ "default": "./jsx-runtime/dist/jsx.js"
57
+ },
58
+ "require": {
59
+ "types": "./jsx-runtime/types-cjs/index.d.cts",
60
+ "default": "./jsx-runtime/dist/jsx.cjs"
61
+ }
44
62
  },
45
- "./dist/*": "./dist/*",
46
63
  "./types/*": "./types/*"
47
64
  },
48
65
  "peerDependencies": {
49
- "@solidjs/web": "^2.0.0-experimental.9"
66
+ "@solidjs/web": "^2.0.0-rc.0"
50
67
  },
51
68
  "devDependencies": {
52
- "@solidjs/web": "2.0.0-experimental.9"
69
+ "@solidjs/web": "2.0.0-rc.0",
70
+ "solid-js": "2.0.0-rc.0"
53
71
  },
54
72
  "scripts": {
55
- "build": "npm-run-all -nl build:*",
73
+ "build": "npm-run-all -nl build:clean types:copy build:js",
56
74
  "build:clean": "rimraf dist/ coverage/ /jsx-runtime/dist",
57
75
  "build:js": "rollup -c",
58
- "types": "npm-run-all -nl types:*",
59
- "types:clean": "rimraf types/",
60
- "types:copy": "ncp ../../node_modules/dom-expressions/src/jsx-h.d.ts ./jsx-runtime/src/jsx.d.ts",
61
- "types:h": "tsc --project ./tsconfig.json && ncp ../../node_modules/hyper-dom-expressions/types/index.d.ts ./types/hyperscript.d.ts",
62
- "types:jsx": "rimraf ./jsx-runtime/types && tsc --project ./jsx-runtime/tsconfig.json && ncp ../../node_modules/dom-expressions/src/jsx-h.d.ts ./jsx-runtime/types/jsx.d.ts",
63
- "link": "symlink-dir . node_modules/@solidjs/h"
76
+ "types": "npm-run-all -nl types:clean types:copy types:h types:jsx types:cjs",
77
+ "types:clean": "rimraf types/ types-cjs/ jsx-runtime/types-cjs/",
78
+ "types:copy": "ncp ../../node_modules/@dom-expressions/runtime/src/jsx-h.d.ts ./jsx-runtime/src/jsx.d.ts && ncp ../../node_modules/@dom-expressions/runtime/src/jsx-properties.d.ts ./jsx-runtime/src/jsx-properties.d.ts && dom-expressions-jsx-types --input ./jsx-runtime/src/jsx.d.ts --element \"SolidElement | Node | FunctionElement | ArrayElement\" --import 'import type { Element as SolidElement } from \"solid-js\";'",
79
+ "types:h": "tsc --project ./tsconfig.json && ncp ../../node_modules/@dom-expressions/hyperscript/types/index.d.ts ./types/hyperscript.d.ts",
80
+ "types:jsx": "rimraf ./jsx-runtime/types && tsc --project ./jsx-runtime/tsconfig.json && ncp ../../node_modules/@dom-expressions/runtime/src/jsx-h.d.ts ./jsx-runtime/types/jsx.d.ts && ncp ../../node_modules/@dom-expressions/runtime/src/jsx-properties.d.ts ./jsx-runtime/types/jsx-properties.d.ts && dom-expressions-jsx-types --input ./jsx-runtime/types/jsx.d.ts --element \"SolidElement | Node | FunctionElement | ArrayElement\" --import 'import type { Element as SolidElement } from \"solid-js\";'",
81
+ "types:cjs": "node ../../scripts/sync-dual-types.mjs ./types ./types-cjs ./jsx-runtime/types ./jsx-runtime/types-cjs",
82
+ "link": "symlink-dir . node_modules/@solidjs/h",
83
+ "test": "vitest run"
64
84
  }
65
85
  }
@@ -0,0 +1,28 @@
1
+ type MountableElement = Element | Document | ShadowRoot | DocumentFragment | Node;
2
+ interface Runtime {
3
+ insert(parent: MountableElement, accessor: any, marker?: Node | null, init?: any): any;
4
+ spread(node: Element, accessor: any, skipChildren?: Boolean): void;
5
+ assign(node: Element, props: any, skipChildren?: Boolean): void;
6
+ createComponent(Comp: (props: any) => any, props: any): any;
7
+ dynamicProperty(props: any, key: string): any;
8
+ untrack<T>(fn: () => T): T;
9
+ SVGElements: Set<string>;
10
+ MathMLElements: Set<string>;
11
+ Namespaces: Record<string, string>;
12
+ }
13
+ type ExpandableNode = Node & {
14
+ [key: string]: any;
15
+ };
16
+ declare const $ELEMENT: unique symbol;
17
+ export type HyperElement = {
18
+ (): ExpandableNode | ExpandableNode[];
19
+ [$ELEMENT]: true;
20
+ };
21
+ export type HyperScript = {
22
+ (...args: any[]): HyperElement | ExpandableNode[];
23
+ Fragment: (props: {
24
+ children: any;
25
+ }) => any;
26
+ };
27
+ export declare function createHyperScript(r: Runtime): HyperScript;
28
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { HyperScript } from "./hyperscript.js";
2
+ declare const h: HyperScript;
3
+ export default h;
@@ -0,0 +1,28 @@
1
+ type MountableElement = Element | Document | ShadowRoot | DocumentFragment | Node;
2
+ interface Runtime {
3
+ insert(parent: MountableElement, accessor: any, marker?: Node | null, init?: any): any;
4
+ spread(node: Element, accessor: any, skipChildren?: Boolean): void;
5
+ assign(node: Element, props: any, skipChildren?: Boolean): void;
6
+ createComponent(Comp: (props: any) => any, props: any): any;
7
+ dynamicProperty(props: any, key: string): any;
8
+ untrack<T>(fn: () => T): T;
9
+ SVGElements: Set<string>;
10
+ MathMLElements: Set<string>;
11
+ Namespaces: Record<string, string>;
12
+ }
13
+ type ExpandableNode = Node & {
14
+ [key: string]: any;
15
+ };
16
+ declare const $ELEMENT: unique symbol;
17
+ export type HyperElement = {
18
+ (): ExpandableNode | ExpandableNode[];
19
+ [$ELEMENT]: true;
20
+ };
21
+ export type HyperScript = {
22
+ (...args: any[]): HyperElement | ExpandableNode[];
23
+ Fragment: (props: {
24
+ children: any;
25
+ }) => any;
26
+ };
27
+ export declare function createHyperScript(r: Runtime): HyperScript;
28
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { HyperScript } from "./hyperscript.cjs";
2
+ declare const h: HyperScript;
3
+ export default h;
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }