@symbiote-native/network 0.3.0 → 1.0.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 +36 -4
- package/package.json +27 -15
package/README.md
CHANGED
|
@@ -143,6 +143,37 @@ watch(
|
|
|
143
143
|
</template>
|
|
144
144
|
```
|
|
145
145
|
|
|
146
|
+
```svelte
|
|
147
|
+
<!-- Svelte -->
|
|
148
|
+
<script lang="ts">
|
|
149
|
+
import {
|
|
150
|
+
getIpAddressAsync,
|
|
151
|
+
isAirplaneModeEnabledAsync,
|
|
152
|
+
} from '@symbiote-native/network';
|
|
153
|
+
import { useNetworkState } from '@symbiote-native/network/svelte';
|
|
154
|
+
|
|
155
|
+
const networkState = useNetworkState(); // { readonly current: NetworkState }
|
|
156
|
+
let ipAddress = $state<string | null>(null);
|
|
157
|
+
let isAirplaneMode = $state<boolean | null>(null);
|
|
158
|
+
|
|
159
|
+
$effect(() => {
|
|
160
|
+
networkState.current; // establishes the dependency, so this re-runs on network change
|
|
161
|
+
void Promise.all([getIpAddressAsync(), isAirplaneModeEnabledAsync()]).then(
|
|
162
|
+
([ip, airplaneMode]) => {
|
|
163
|
+
ipAddress = ip;
|
|
164
|
+
isAirplaneMode = airplaneMode;
|
|
165
|
+
},
|
|
166
|
+
);
|
|
167
|
+
});
|
|
168
|
+
</script>
|
|
169
|
+
<Text>
|
|
170
|
+
{networkState.current.isConnected
|
|
171
|
+
? `Connected via ${networkState.current.type}`
|
|
172
|
+
: 'Offline'}
|
|
173
|
+
</Text>
|
|
174
|
+
<Text>{ipAddress ?? 'checking…'}</Text>
|
|
175
|
+
```
|
|
176
|
+
|
|
146
177
|
```ts
|
|
147
178
|
// Angular — examples/expo-angular/src/screens/NetworkScreen.ts
|
|
148
179
|
import { Component, effect, inject, signal } from '@angular/core';
|
|
@@ -263,11 +294,12 @@ between the seed and the subscription.
|
|
|
263
294
|
No Fabric/Descriptor angle at all — network is a pure async-function + `EventEmitter` listener
|
|
264
295
|
surface, never a view. Tests inject a fake native-module object in place of the real
|
|
265
296
|
`requireNativeModule` resolution (`src/core/network.test.ts`,
|
|
266
|
-
`src/{react,vue,angular}/**/*.test.{ts,tsx}`, `vitest`), the same pattern
|
|
297
|
+
`src/{react,vue,svelte,solid,angular}/**/*.test.{ts,tsx}`, `vitest`), the same pattern
|
|
267
298
|
`@symbiote-native/battery`/`@symbiote-native/sensors`/`@symbiote-native/local-auth` use — no
|
|
268
299
|
`installFabric()`, no ViewConfig. Native rendering itself is verified on-device — see the parent
|
|
269
300
|
[README](../../README.md).
|
|
270
301
|
|
|
271
|
-
The Android/iOS native wiring is done across all
|
|
272
|
-
(`examples/expo-react`, `examples/expo-vue-sfc`, `examples/expo-vue-tsx`, `examples/expo-
|
|
273
|
-
this package isn't yet in the public, non-Expo
|
|
302
|
+
The Android/iOS native wiring is done across all six `examples/expo-*` canary apps
|
|
303
|
+
(`examples/expo-react`, `examples/expo-vue-sfc`, `examples/expo-vue-tsx`, `examples/expo-svelte`,
|
|
304
|
+
`examples/expo-solid`, `examples/expo-angular`); this package isn't yet in the public, non-Expo
|
|
305
|
+
`examples/react` canary.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbiote-native/network",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "expo-network wrapped for SymbioteNative — one framework-agnostic core, built once and reachable from the React, Vue, Svelte, Solid, and Angular adapters. Network state (type/connected/internet-reachable) with a change listener, device IP address, and airplane-mode detection.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -13,6 +13,18 @@
|
|
|
13
13
|
"url": "https://github.com/OneEyed1366/symbiote-native/issues"
|
|
14
14
|
},
|
|
15
15
|
"author": "Andrey Prokopenko <psevdoproger@gmail.com>",
|
|
16
|
+
"keywords": [
|
|
17
|
+
"react-native",
|
|
18
|
+
"symbiote-native",
|
|
19
|
+
"expo-network",
|
|
20
|
+
"react",
|
|
21
|
+
"vue",
|
|
22
|
+
"svelte",
|
|
23
|
+
"solid",
|
|
24
|
+
"angular",
|
|
25
|
+
"connectivity",
|
|
26
|
+
"network-state"
|
|
27
|
+
],
|
|
16
28
|
"type": "module",
|
|
17
29
|
"main": "./build/core/index.js",
|
|
18
30
|
"module": "./build/core/index.js",
|
|
@@ -61,19 +73,19 @@
|
|
|
61
73
|
"expo-modules-core": "57.0.5"
|
|
62
74
|
},
|
|
63
75
|
"peerDependencies": {
|
|
64
|
-
"@symbiote-native/angular": ">=0.6.2",
|
|
65
|
-
"@symbiote-native/engine": ">=0.1.7",
|
|
66
|
-
"@symbiote-native/react": ">=0.2.8",
|
|
67
|
-
"@symbiote-native/solid": ">=0.0.1",
|
|
68
|
-
"@symbiote-native/svelte": ">=0.1.0",
|
|
69
|
-
"@symbiote-native/vue": ">=0.3.8",
|
|
70
76
|
"@angular/core": ">=20",
|
|
71
77
|
"@vue/runtime-core": "^3.5.13",
|
|
72
78
|
"react": ">=19.0.0",
|
|
73
79
|
"react-native": ">=0.86",
|
|
74
80
|
"solid-js": ">=1.9.0",
|
|
75
81
|
"svelte": ">=5.56.0",
|
|
76
|
-
"vue": ">=3.5.0"
|
|
82
|
+
"vue": ">=3.5.0",
|
|
83
|
+
"@symbiote-native/angular": "^1.0.0",
|
|
84
|
+
"@symbiote-native/engine": "^0.4.0",
|
|
85
|
+
"@symbiote-native/react": "^1.0.0",
|
|
86
|
+
"@symbiote-native/solid": "^1.0.0",
|
|
87
|
+
"@symbiote-native/svelte": "^1.0.0",
|
|
88
|
+
"@symbiote-native/vue": "^1.0.0"
|
|
77
89
|
},
|
|
78
90
|
"peerDependenciesMeta": {
|
|
79
91
|
"@symbiote-native/angular": {
|
|
@@ -121,13 +133,13 @@
|
|
|
121
133
|
"solid-js": "^1.9.14",
|
|
122
134
|
"svelte": "^5.56.0",
|
|
123
135
|
"typescript": "~6.0.0",
|
|
124
|
-
"@symbiote-native/angular": "0.
|
|
125
|
-
"@symbiote-native/engine": "0.
|
|
126
|
-
"@symbiote-native/react": "0.
|
|
127
|
-
"@symbiote-native/solid": "
|
|
128
|
-
"@symbiote-native/svelte": "0.
|
|
129
|
-
"@symbiote-native/test-utils": "0.
|
|
130
|
-
"@symbiote-native/vue": "0.
|
|
136
|
+
"@symbiote-native/angular": "1.0.0",
|
|
137
|
+
"@symbiote-native/engine": "0.4.0",
|
|
138
|
+
"@symbiote-native/react": "1.0.0",
|
|
139
|
+
"@symbiote-native/solid": "1.0.0",
|
|
140
|
+
"@symbiote-native/svelte": "1.0.0",
|
|
141
|
+
"@symbiote-native/test-utils": "0.3.0",
|
|
142
|
+
"@symbiote-native/vue": "1.0.0"
|
|
131
143
|
},
|
|
132
144
|
"scripts": {
|
|
133
145
|
"typecheck": "tsc --build",
|