@solidnative-dev/react-native-compat 0.0.0-stage → 0.1.0-alpha.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Solid Native contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,26 @@
1
- # Temporary Holding Version
1
+ # @solidnative-dev/react-native-compat
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ This dependency-free package is the executable compatibility contract for the
4
+ React Native backend selected by Solid Native. It keeps four identities
5
+ explicit and independently reviewable:
6
+
7
+ - the exact React Native npm package release used by build tooling;
8
+ - the normalized React Native version exposed by `PlatformConstants` and the
9
+ JSI host;
10
+ - the matching Hermes compiler release;
11
+ - the matching Hermes bytecode format.
12
+
13
+ Those values happen to share the same `0.88.1` package/runtime string in the
14
+ current stable backend. They must not be treated as one identity: React Native
15
+ nightly packages retain a prerelease suffix while their native runtime exposes
16
+ only major, minor, and patch numbers.
17
+
18
+ `assertVerifiedReactNativePlatform` is shared by the runtime facade and direct
19
+ TurboModule adapters. It validates the normalized version and resolves Android
20
+ or iOS before an adapter touches a version-sensitive native API.
21
+
22
+ The CLI consumes the same release definition for dependency, Hermes, and HBC
23
+ checks. `@solidnative-dev/fabric-host` adds the host-contract and physical-proof
24
+ metadata for that release. Native Android and Apple bindings publish their
25
+ runtime identity from one C++ header, and the native integration suite verifies
26
+ that header against this package.
@@ -0,0 +1,52 @@
1
+ export type ReactNativePlatform = "android" | "ios";
2
+ export interface ReactNativeRuntimeVersion {
3
+ readonly major: number;
4
+ readonly minor: number;
5
+ readonly patch: number;
6
+ }
7
+ export interface VerifiedReactNativeRelease {
8
+ /** Exact npm release used by lockfiles, provenance, and build tooling. */
9
+ readonly packageVersion: string;
10
+ /** Normalized version exposed by PlatformConstants and the native JSI host. */
11
+ readonly runtimeVersion: string;
12
+ readonly runtimeVersionParts: ReactNativeRuntimeVersion;
13
+ readonly hermesCompilerVersion: string;
14
+ readonly hermesBytecodeVersion: number;
15
+ }
16
+ export interface VerifiedReactNativePlatform {
17
+ readonly platform: ReactNativePlatform;
18
+ readonly runtimeVersion: typeof REACT_NATIVE_0_88_RELEASE.runtimeVersion;
19
+ }
20
+ /**
21
+ * The only React Native release currently supported by Solid Native.
22
+ *
23
+ * Package and runtime versions are separate even when their values match: a
24
+ * nightly package has a prerelease suffix while PlatformConstants exposes only
25
+ * its normalized major/minor/patch tuple.
26
+ */
27
+ export declare const REACT_NATIVE_0_88_RELEASE: Readonly<{
28
+ packageVersion: "0.88.1";
29
+ runtimeVersion: "0.88.1";
30
+ runtimeVersionParts: Readonly<{
31
+ major: 0;
32
+ minor: 88;
33
+ patch: 1;
34
+ }>;
35
+ hermesCompilerVersion: "260318099.0.5";
36
+ hermesBytecodeVersion: 99;
37
+ }>;
38
+ /** Version-neutral alias for the active verified React Native release. */
39
+ export declare const VERIFIED_REACT_NATIVE_RELEASE: Readonly<{
40
+ packageVersion: "0.88.1";
41
+ runtimeVersion: "0.88.1";
42
+ runtimeVersionParts: Readonly<{
43
+ major: 0;
44
+ minor: 88;
45
+ patch: 1;
46
+ }>;
47
+ hermesCompilerVersion: "260318099.0.5";
48
+ hermesBytecodeVersion: 99;
49
+ }>;
50
+ /** Validates PlatformConstants against the supported normalized runtime. */
51
+ export declare function assertVerifiedReactNativePlatform(constantsValue: unknown, capability: string): VerifiedReactNativePlatform;
52
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,KAAK,CAAC;AAEpD,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,0BAA0B;IACzC,0EAA0E;IAC1E,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,+EAA+E;IAC/E,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,mBAAmB,EAAE,yBAAyB,CAAC;IACxD,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAC;IACvC,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAC;CACxC;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,CAAC;IACvC,QAAQ,CAAC,cAAc,EAAE,OAAO,yBAAyB,CAAC,cAAc,CAAC;CAC1E;AAED;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;EAMC,CAAC;AAExC,0EAA0E;AAC1E,eAAO,MAAM,6BAA6B;;;;;;;;;;EAA4B,CAAC;AAmBvE,4EAA4E;AAC5E,wBAAgB,iCAAiC,CAC/C,cAAc,EAAE,OAAO,EACvB,UAAU,EAAE,MAAM,GACjB,2BAA2B,CAiD7B"}
package/dist/index.js ADDED
@@ -0,0 +1,60 @@
1
+ /**
2
+ * The only React Native release currently supported by Solid Native.
3
+ *
4
+ * Package and runtime versions are separate even when their values match: a
5
+ * nightly package has a prerelease suffix while PlatformConstants exposes only
6
+ * its normalized major/minor/patch tuple.
7
+ */
8
+ export const REACT_NATIVE_0_88_RELEASE = Object.freeze({
9
+ packageVersion: "0.88.1",
10
+ runtimeVersion: "0.88.1",
11
+ runtimeVersionParts: Object.freeze({ major: 0, minor: 88, patch: 1 }),
12
+ hermesCompilerVersion: "260318099.0.5",
13
+ hermesBytecodeVersion: 99,
14
+ });
15
+ /** Version-neutral alias for the active verified React Native release. */
16
+ export const VERIFIED_REACT_NATIVE_RELEASE = REACT_NATIVE_0_88_RELEASE;
17
+ function record(value, path) {
18
+ if (value === null || typeof value !== "object" || Array.isArray(value)) {
19
+ throw new TypeError(`${path} must be an object.`);
20
+ }
21
+ return value;
22
+ }
23
+ function versionPart(value, path) {
24
+ if (!Number.isSafeInteger(value) || value < 0) {
25
+ throw new TypeError(`${path} must be a non-negative safe integer.`);
26
+ }
27
+ return value;
28
+ }
29
+ /** Validates PlatformConstants against the supported normalized runtime. */
30
+ export function assertVerifiedReactNativePlatform(constantsValue, capability) {
31
+ const constants = record(constantsValue, "PlatformConstants");
32
+ const version = record(constants.reactNativeVersion, "PlatformConstants.reactNativeVersion");
33
+ const observed = {
34
+ major: versionPart(version.major, "PlatformConstants.reactNativeVersion.major"),
35
+ minor: versionPart(version.minor, "PlatformConstants.reactNativeVersion.minor"),
36
+ patch: versionPart(version.patch, "PlatformConstants.reactNativeVersion.patch"),
37
+ };
38
+ const expected = REACT_NATIVE_0_88_RELEASE.runtimeVersionParts;
39
+ if (observed.major !== expected.major ||
40
+ observed.minor !== expected.minor ||
41
+ observed.patch !== expected.patch) {
42
+ throw new Error(`${capability} is verified only with React Native runtime ${REACT_NATIVE_0_88_RELEASE.runtimeVersion}; received ${String(observed.major)}.${String(observed.minor)}.${String(observed.patch)}.`);
43
+ }
44
+ let platform;
45
+ if (typeof constants.Version === "number") {
46
+ platform = "android";
47
+ }
48
+ else if (typeof constants.systemName === "string" &&
49
+ constants.systemName.length > 0) {
50
+ platform = "ios";
51
+ }
52
+ else {
53
+ throw new TypeError("PlatformConstants did not identify an Android or iOS runtime.");
54
+ }
55
+ return Object.freeze({
56
+ platform,
57
+ runtimeVersion: REACT_NATIVE_0_88_RELEASE.runtimeVersion,
58
+ });
59
+ }
60
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAuBA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,MAAM,CAAC;IACrD,cAAc,EAAE,QAAQ;IACxB,cAAc,EAAE,QAAQ;IACxB,mBAAmB,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IACrE,qBAAqB,EAAE,eAAe;IACtC,qBAAqB,EAAE,EAAE;CAC1B,CAAsC,CAAC;AAExC,0EAA0E;AAC1E,MAAM,CAAC,MAAM,6BAA6B,GAAG,yBAAyB,CAAC;AAEvE,SAAS,MAAM,CACb,KAAc,EACd,IAAY;IAEZ,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACxE,MAAM,IAAI,SAAS,CAAC,GAAG,IAAI,qBAAqB,CAAC,CAAC;IACpD,CAAC;IACD,OAAO,KAA0C,CAAC;AACpD,CAAC;AAED,SAAS,WAAW,CAAC,KAAc,EA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AS,CAAC;IACvB,CAAC;SAAM,IACL,OAAO,SAAS,CAAC,UAAU,KAAK,QAAQ;QACxC,SAAS,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAC/B,CAAC;QACD,QAAQ,GAAG,KAAK,CAAC;IACnB,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,SAAS,CACjB,+DAA+D,CAChE,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,QAAQ;QACR,cAAc,EAAE,yBAAyB,CAAC,cAAc;KACzD,CAAC,CAAC;AACL,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,33 @@
1
1
  {
2
2
  "name": "@solidnative-dev/react-native-compat",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0-alpha.0",
4
+ "type": "module",
5
+ "description": "The reviewed React Native package, runtime, and Hermes compatibility contract for Solid Native.",
6
+ "license": "MIT",
7
+ "homepage": "https://solidnative.dev",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/solid-native/solid-native.git",
11
+ "directory": "packages/react-native-compat"
12
+ },
13
+ "publishConfig": {
14
+ "access": "public"
15
+ },
16
+ "engines": {
17
+ "node": "^22.13.0 || ^24.3.0 || >=26.0.0"
18
+ },
19
+ "exports": {
20
+ ".": {
21
+ "types": "./dist/index.d.ts",
22
+ "default": "./dist/index.js"
23
+ }
24
+ },
25
+ "files": [
26
+ "dist"
27
+ ],
28
+ "scripts": {
29
+ "build": "tsc -p tsconfig.json",
30
+ "check": "tsc -p tsconfig.json --noEmit",
31
+ "test": "pnpm build && node --test test/*.test.mjs"
32
+ }
6
33
  }