@symbiote-native/react 0.1.1 → 0.2.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.
package/README.md CHANGED
@@ -20,6 +20,19 @@ adapter, not the core.
20
20
 
21
21
  ---
22
22
 
23
+ ## Install
24
+
25
+ ```bash
26
+ npm install @symbiote-native/react react-native react
27
+ ```
28
+
29
+ `react-native` and `react` stay your app's own top-level dependencies — SymbioteNative doesn't hide
30
+ them, it only replaces the JS renderer that drives them. There's no `create-symbiote` scaffolder
31
+ yet, so the Metro config and the `index.js` entry seam below come from
32
+ [`examples/react`](../../examples/react) rather than a generator.
33
+
34
+ ---
35
+
23
36
  ## Use it
24
37
 
25
38
  The app is ordinary React — it imports primitives from `@symbiote-native/react`, not `react-native`:
@@ -0,0 +1,7 @@
1
+ import type { ComponentType } from 'react';
2
+ import { type IBootstrapHostOptions } from '@symbiote-native/components/bootstrap';
3
+ export type { IBootstrapHostOptions } from '@symbiote-native/components/bootstrap';
4
+ export type IRegisterAppOptions = IBootstrapHostOptions & {
5
+ appName: string;
6
+ };
7
+ export declare function registerApp(App: ComponentType<object>, options: IRegisterAppOptions): void;
@@ -0,0 +1,17 @@
1
+ // Zero-config app entry: wires the four RN-backed host seams (via @symbiote-native/components'
2
+ // bootstrapHost) plus this adapter's own AppRegistry host-registrar bridge, then registers the
3
+ // root component — collapsing the canary's manual sequence into one call. Lives OUTSIDE the
4
+ // package's main barrel (see package.json's "./bootstrap" export): it imports react-native
5
+ // directly, which Vitest's Flow-unaware transform can't parse (see
6
+ // @symbiote-native/components/bootstrap for the full reason).
7
+ import { AppRegistry as RNAppRegistry } from 'react-native';
8
+ import { bootstrapHost } from '@symbiote-native/components/bootstrap';
9
+ import { AppRegistry, setHostRegistrar } from './modules/app-registry';
10
+ // Mirrors bare RN's own `AppRegistry.registerComponent(appName, () => App)` idiom, minus the
11
+ // manual host wiring in front of it.
12
+ export function registerApp(App, options) {
13
+ const { appName, ...bootstrapOptions } = options;
14
+ bootstrapHost(bootstrapOptions);
15
+ setHostRegistrar(RNAppRegistry);
16
+ AppRegistry.registerComponent(appName, () => App);
17
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symbiote-native/react",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "SymbioteNative's React adapter — a react-reconciler host config (mutation mode) driving real native iOS/Android views through stock React Native Fabric.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -21,6 +21,10 @@
21
21
  "types": "./build/index.d.ts",
22
22
  "default": "./build/index.js"
23
23
  },
24
+ "./bootstrap": {
25
+ "types": "./build/bootstrap.d.ts",
26
+ "default": "./build/bootstrap.js"
27
+ },
24
28
  "./metro-css-parser": "./metro-css-parser.cjs"
25
29
  },
26
30
  "files": [
@@ -32,7 +36,7 @@
32
36
  },
33
37
  "dependencies": {
34
38
  "react-reconciler": "^0.33.0",
35
- "@symbiote-native/components": "0.1.1",
39
+ "@symbiote-native/components": "0.2.0",
36
40
  "@symbiote-native/css-parser": "0.1.1",
37
41
  "@symbiote-native/engine": "0.1.1"
38
42
  },
@@ -44,7 +48,7 @@
44
48
  "@types/react": "^19.2.0",
45
49
  "@types/react-reconciler": "^0.32.2",
46
50
  "react": "19.2.3",
47
- "@symbiote-native/test-utils": "0.0.0"
51
+ "@symbiote-native/test-utils": "0.1.1"
48
52
  },
49
53
  "scripts": {
50
54
  "typecheck": "tsc --build",