solid-js 1.4.6 → 1.5.0-beta.1
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/dist/dev.cjs +112 -113
- package/dist/dev.js +112 -113
- package/dist/server.cjs +65 -31
- package/dist/server.js +65 -31
- package/dist/solid.cjs +112 -111
- package/dist/solid.js +112 -111
- package/h/jsx-runtime/types/jsx.d.ts +6 -1401
- package/h/types/hyperscript.d.ts +17 -0
- package/html/dist/html.cjs +34 -59
- package/html/dist/html.js +34 -59
- package/html/types/lit.d.ts +37 -0
- package/package.json +23 -21
- package/store/dist/dev.cjs +40 -22
- package/store/dist/dev.js +41 -23
- package/store/dist/store.cjs +40 -22
- package/store/dist/store.js +40 -22
- package/store/types/store.d.ts +1 -1
- package/types/jsx.d.ts +194 -1580
- package/types/reactive/observable.d.ts +7 -2
- package/types/reactive/signal.d.ts +42 -13
- package/types/render/component.d.ts +21 -6
- package/types/server/reactive.d.ts +6 -1
- package/types/server/rendering.d.ts +3 -2
- package/universal/types/universal.d.ts +3 -3
- package/web/dist/dev.cjs +3 -3
- package/web/dist/dev.js +3 -3
- package/web/dist/server.cjs +35 -69
- package/web/dist/server.js +35 -69
- package/web/dist/web.cjs +3 -3
- package/web/dist/web.js +3 -3
- package/web/types/core.d.ts +2 -2
- package/web/types/index.d.ts +5 -6
- package/web/types/server-mock.d.ts +4 -2
- package/web/types/server.d.ts +70 -0
- package/h/README.md +0 -99
- package/h/jsx-runtime/package.json +0 -8
- package/h/package.json +0 -8
- package/html/README.md +0 -84
- package/html/package.json +0 -8
- package/store/README.md +0 -23
- package/store/package.json +0 -35
- package/universal/README.md +0 -102
- package/universal/package.json +0 -18
- package/web/README.md +0 -7
- package/web/package.json +0 -35
package/universal/README.md
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
# Solid Universal
|
|
2
|
-
|
|
3
|
-
This contains the means to create the runtime for a custom renderer for Solid. This can enable using Solid to render to different platforms like native mobile and desktop, canvas or WebGL, or even the terminal. It relies on custom compilation from `babel-preset-solid` and exporting the result of `createRenderer` at a referenceable location.
|
|
4
|
-
|
|
5
|
-
## Example
|
|
6
|
-
|
|
7
|
-
To use a custom renderer available in the (fictional) `solid-custom-dom` package you'd configure your babelrc as:
|
|
8
|
-
```json
|
|
9
|
-
{
|
|
10
|
-
"presets": [
|
|
11
|
-
[
|
|
12
|
-
"babel-preset-solid",
|
|
13
|
-
{
|
|
14
|
-
"moduleName": "solid-custom-dom",
|
|
15
|
-
"generate": "universal"
|
|
16
|
-
}
|
|
17
|
-
]
|
|
18
|
-
]
|
|
19
|
-
}
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
To create a custom renderer you must implement certain methods and export (as named exports) the results. You may also want to forward `solid-js` control flow to allow them to be auto imported as well.
|
|
23
|
-
|
|
24
|
-
```js
|
|
25
|
-
// example custom dom renderer
|
|
26
|
-
import { createRenderer } from "solid-js/universal";
|
|
27
|
-
|
|
28
|
-
const PROPERTIES = new Set(["className", "textContent"]);
|
|
29
|
-
|
|
30
|
-
export const {
|
|
31
|
-
render,
|
|
32
|
-
effect,
|
|
33
|
-
memo,
|
|
34
|
-
createComponent,
|
|
35
|
-
createElement,
|
|
36
|
-
createTextNode,
|
|
37
|
-
insertNode,
|
|
38
|
-
insert,
|
|
39
|
-
spread,
|
|
40
|
-
setProp,
|
|
41
|
-
mergeProps
|
|
42
|
-
} = createRenderer({
|
|
43
|
-
createElement(string) {
|
|
44
|
-
return document.createElement(string);
|
|
45
|
-
},
|
|
46
|
-
createTextNode(value) {
|
|
47
|
-
return document.createTextNode(value);
|
|
48
|
-
},
|
|
49
|
-
replaceText(textNode, value) {
|
|
50
|
-
textNode.data = value;
|
|
51
|
-
},
|
|
52
|
-
setProperty(node, name, value) {
|
|
53
|
-
if (name === "style") Object.assign(node.style, value);
|
|
54
|
-
else if (name.startsWith("on")) node[name.toLowerCase()] = value;
|
|
55
|
-
else if (PROPERTIES.has(name)) node[name] = value;
|
|
56
|
-
else node.setAttribute(name, value);
|
|
57
|
-
},
|
|
58
|
-
insertNode(parent, node, anchor) {
|
|
59
|
-
parent.insertBefore(node, anchor);
|
|
60
|
-
},
|
|
61
|
-
isTextNode(node) {
|
|
62
|
-
return node.type === 3;
|
|
63
|
-
},
|
|
64
|
-
removeNode(parent, node) {
|
|
65
|
-
parent.removeChild(node);
|
|
66
|
-
},
|
|
67
|
-
getParentNode(node) {
|
|
68
|
-
return node.parentNode;
|
|
69
|
-
},
|
|
70
|
-
getFirstChild(node) {
|
|
71
|
-
return node.firstChild;
|
|
72
|
-
},
|
|
73
|
-
getNextSibling(node) {
|
|
74
|
-
return node.nextSibling;
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
// Forward Solid control flow
|
|
79
|
-
export {
|
|
80
|
-
For,
|
|
81
|
-
Show,
|
|
82
|
-
Suspense,
|
|
83
|
-
SuspenseList,
|
|
84
|
-
Switch,
|
|
85
|
-
Match,
|
|
86
|
-
Index,
|
|
87
|
-
ErrorBoundary
|
|
88
|
-
} from "solid-js";
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
Then to consume:
|
|
92
|
-
```js
|
|
93
|
-
import { render } from "solid-custom-dom";
|
|
94
|
-
|
|
95
|
-
function App() {
|
|
96
|
-
// the skies the limits
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
render(() => <App />, mountNode)
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
> Note: For TypeScript support of non-standard JSX you will need to provide your own types at a jsx-runtime entry on your package so that it can be set as the `jsxImportSource`. If mixing and matching different JSX implementations you will need use the per file pragmas.
|
package/universal/package.json
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "solid-js/universal",
|
|
3
|
-
"main": "./dist/universal.cjs",
|
|
4
|
-
"module": "./dist/universal.js",
|
|
5
|
-
"types": "./types/index.d.ts",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"sideEffects": false,
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"development": {
|
|
11
|
-
"import": "./dist/dev.js",
|
|
12
|
-
"require": "./dist/dev.cjs"
|
|
13
|
-
},
|
|
14
|
-
"import": "./dist/universal.js",
|
|
15
|
-
"require": "./dist/universal.cjs"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
package/web/README.md
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
# Solid Web
|
|
2
|
-
|
|
3
|
-
This submodule contains the web specific APIs for Solid that are mostly internal methods imported during compilation. It has all the code to render for the web on the server and the browser.
|
|
4
|
-
|
|
5
|
-
In addition this modules provides the primary entry point methods `render`, `hydrate`, `renderToString`, `renderToStringAsync`, `pipeToNodeWritable`, and `pipeToWritable`. As well as a few web specific control flow components `<Portal>` and `<Dynamic>`.
|
|
6
|
-
|
|
7
|
-
Refer to the [website](https://www.solidjs.com/docs/latest/api) for documentation.
|
package/web/package.json
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "solid-js/web",
|
|
3
|
-
"main": "./dist/server.cjs",
|
|
4
|
-
"module": "./dist/server.js",
|
|
5
|
-
"browser": {
|
|
6
|
-
"./dist/server.cjs": "./dist/web.cjs",
|
|
7
|
-
"./dist/server.js": "./dist/web.js"
|
|
8
|
-
},
|
|
9
|
-
"unpkg": "./dist/web.cjs",
|
|
10
|
-
"types": "./types/index.d.ts",
|
|
11
|
-
"type": "module",
|
|
12
|
-
"sideEffects": false,
|
|
13
|
-
"exports": {
|
|
14
|
-
".": {
|
|
15
|
-
"browser": {
|
|
16
|
-
"development": {
|
|
17
|
-
"import": "./dist/dev.js",
|
|
18
|
-
"require": "./dist/dev.cjs"
|
|
19
|
-
},
|
|
20
|
-
"import": "./dist/web.js",
|
|
21
|
-
"require": "./dist/web.cjs"
|
|
22
|
-
},
|
|
23
|
-
"node": {
|
|
24
|
-
"import": "./dist/server.js",
|
|
25
|
-
"require": "./dist/server.cjs"
|
|
26
|
-
},
|
|
27
|
-
"development": {
|
|
28
|
-
"import": "./dist/dev.js",
|
|
29
|
-
"require": "./dist/dev.cjs"
|
|
30
|
-
},
|
|
31
|
-
"import": "./dist/web.js",
|
|
32
|
-
"require": "./dist/web.cjs"
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|