@symbiote-native/solid 3.0.2 → 3.0.3
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 +45 -10
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -18,14 +18,27 @@ Metro, no custom Babel transformer path.
|
|
|
18
18
|
|
|
19
19
|
## Install
|
|
20
20
|
|
|
21
|
+
```bash
|
|
22
|
+
npx @symbiote-native/cli new my-app --framework solid
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
One command, nothing to wire by hand: scaffolds the Babel preset, Metro config, and
|
|
26
|
+
`jsxImportSource` below, plus `@symbiote-native/solid`/`react-native`/`solid-js` as your app's own
|
|
27
|
+
dependencies.
|
|
28
|
+
|
|
29
|
+
<details>
|
|
30
|
+
<summary>Manual install (no generator — an existing app, or you want to wire it yourself)</summary>
|
|
31
|
+
|
|
21
32
|
```bash
|
|
22
33
|
npm install @symbiote-native/solid react-native solid-js
|
|
23
34
|
```
|
|
24
35
|
|
|
25
36
|
`react-native` and `solid-js` stay your app's own top-level dependencies — this package only
|
|
26
|
-
replaces the JS renderer that drives them. `
|
|
27
|
-
|
|
28
|
-
|
|
37
|
+
replaces the JS renderer that drives them. Follow [`examples/solid`](../../examples/solid) for the
|
|
38
|
+
Babel preset, Metro config, and `jsxImportSource` below; there is no wiring script for an existing
|
|
39
|
+
app.
|
|
40
|
+
|
|
41
|
+
</details>
|
|
29
42
|
|
|
30
43
|
Targets **Solid 1.9**, deliberately not 2.0 (RC as of 2026-08) — 2.0 moves the package to
|
|
31
44
|
`@solidjs/universal`, changes `RendererOptions`, and changes the compiled-output shape. Moving to
|
|
@@ -36,29 +49,49 @@ it is a rewrite of `src/renderer.ts`, not a range bump.
|
|
|
36
49
|
## Use it
|
|
37
50
|
|
|
38
51
|
The app is ordinary Solid — the native primitives are plain lowercase intrinsic tags, no import
|
|
39
|
-
needed
|
|
52
|
+
needed. Styling is a CSS class against a plain `.css` file — the convention every example app
|
|
53
|
+
here follows:
|
|
40
54
|
|
|
41
55
|
```jsx
|
|
42
56
|
import { createSignal } from 'solid-js';
|
|
57
|
+
import './App.css';
|
|
43
58
|
|
|
44
59
|
export default function App() {
|
|
45
60
|
const [count, setCount] = createSignal(0);
|
|
46
61
|
return (
|
|
47
|
-
<view
|
|
62
|
+
<safe-area-view class="screen">
|
|
48
63
|
<text>Taps: {count()}</text>
|
|
49
64
|
<pressable onPress={() => setCount(c => c + 1)}>
|
|
50
65
|
<text>Tap me</text>
|
|
51
66
|
</pressable>
|
|
52
|
-
</view>
|
|
67
|
+
</safe-area-view>
|
|
53
68
|
);
|
|
54
69
|
}
|
|
55
70
|
```
|
|
56
71
|
|
|
72
|
+
```css
|
|
73
|
+
/* App.css */
|
|
74
|
+
.screen {
|
|
75
|
+
flex: 1;
|
|
76
|
+
align-items: center;
|
|
77
|
+
justify-content: center;
|
|
78
|
+
padding: 24px;
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
<details>
|
|
83
|
+
<summary>Native entry point (index.js) — already scaffolded by <code>npx @symbiote-native/cli new --framework solid</code></summary>
|
|
84
|
+
|
|
57
85
|
The zero-config entry wires the RN-backed host seams and registers the app in one call — this is
|
|
58
86
|
what [`examples/solid`](../../examples/solid) actually uses:
|
|
59
87
|
|
|
60
88
|
```js
|
|
61
89
|
// index.js
|
|
90
|
+
|
|
91
|
+
// Registers host behaviors (Image, Pressable, Switch, ...) that /bootstrap alone doesn't
|
|
92
|
+
// reach; deleting this breaks them silently (Metro's production inlineRequires makes a
|
|
93
|
+
// side-effect-only barrel import go lazy, see register.ts).
|
|
94
|
+
import '@symbiote-native/solid';
|
|
62
95
|
import { createApp } from '@symbiote-native/solid/bootstrap';
|
|
63
96
|
import App from './App';
|
|
64
97
|
import { name as appName } from './app.json';
|
|
@@ -81,6 +114,8 @@ AppRegistry.registerRunnable(appName, ({ rootTag }) => {
|
|
|
81
114
|
});
|
|
82
115
|
```
|
|
83
116
|
|
|
117
|
+
</details>
|
|
118
|
+
|
|
84
119
|
`babel.config.js` needs the adapter's preset LAST — Babel applies presets in reverse order, so
|
|
85
120
|
listing it last runs it first, claiming the JSX before RN's own React-JSX transform can:
|
|
86
121
|
|
|
@@ -100,11 +135,11 @@ Nothing rewrites the source on the way there, so this adapter carries no Babel p
|
|
|
100
135
|
## `./renderer` is a compiler target, not a convenience export
|
|
101
136
|
|
|
102
137
|
`babel-preset-solid` with `generate: 'universal'` rewrites JSX into direct calls imported from the
|
|
103
|
-
`moduleName` it was given. So `src/renderer.ts` exports
|
|
138
|
+
`moduleName` it was given. So `src/renderer.ts` exports twelve specific names because generated code
|
|
104
139
|
imports them; dropping one breaks bundling with a module-not-found on an import nobody wrote. The
|
|
105
|
-
list (`createElement`, `createTextNode`, `insertNode`, `insert`, `setProp`, `use`, `effect`,
|
|
106
|
-
`createComponent`, `spread`, `mergeProps`) was verified by compiling representative JSX, not
|
|
107
|
-
the docs.
|
|
140
|
+
list (`render`, `createElement`, `createTextNode`, `insertNode`, `insert`, `setProp`, `use`, `effect`,
|
|
141
|
+
`memo`, `createComponent`, `spread`, `mergeProps`) was verified by compiling representative JSX, not
|
|
142
|
+
read off the docs.
|
|
108
143
|
|
|
109
144
|
## Three things the universal runtime does that the seam has to answer correctly
|
|
110
145
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbiote-native/solid",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"description": "SymbioteNative's Solid adapter — a solid-js/universal createRenderer driving real native iOS/Android views through the same engine as every other adapter.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"babel-preset-solid": "^1.9.12",
|
|
64
64
|
"typescript": "~6.0.0",
|
|
65
|
-
"@symbiote-native/components": "3.1.
|
|
66
|
-
"@symbiote-native/css-parser": "0.5.
|
|
65
|
+
"@symbiote-native/components": "3.1.1",
|
|
66
|
+
"@symbiote-native/css-parser": "0.5.1"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"solid-js": ">=1.9.0",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"@babel/core": "^7.25.2",
|
|
75
75
|
"solid-js": "^1.9.14",
|
|
76
76
|
"@symbiote-native/engine": "1.3.0",
|
|
77
|
-
"@symbiote-native/test-utils": "0.4.
|
|
77
|
+
"@symbiote-native/test-utils": "0.4.3"
|
|
78
78
|
},
|
|
79
79
|
"scripts": {
|
|
80
80
|
"typecheck": "tsc --build",
|