@symbiote-native/web-browser 0.1.0 → 0.3.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 +27 -27
- package/build-ngc/core/native-module.js.map +1 -1
- package/build-ngc/core/web-browser.js.map +1 -1
- package/package.json +46 -18
- package/src/core/native-module.ts +4 -1
- package/src/core/types.ts +2 -1
- package/src/core/web-browser.ts +36 -13
- package/build/react/index.d.ts +0 -1
- package/build/react/index.js +0 -7
- package/build/vue/index.d.ts +0 -1
- package/build/vue/index.js +0 -4
- package/src/react/index.ts +0 -7
- package/src/vue/index.ts +0 -4
package/README.md
CHANGED
|
@@ -25,12 +25,12 @@ Unlike a plain RN native module, `expo-web-browser`'s native code is discovered
|
|
|
25
25
|
`expo-modules-autolinking` — this needs wiring into the native host app **once**, covering this
|
|
26
26
|
package and every other `expo-modules-core` package with zero further changes:
|
|
27
27
|
|
|
28
|
-
| Platform | Touches
|
|
29
|
-
|
|
30
|
-
| iOS
|
|
31
|
-
| iOS
|
|
32
|
-
| Android
|
|
33
|
-
| Android
|
|
28
|
+
| Platform | Touches |
|
|
29
|
+
| -------- | ------------------------------------------------------------------------------------- |
|
|
30
|
+
| iOS | `ios/Podfile` — add `use_expo_modules!` |
|
|
31
|
+
| iOS | `AppDelegate.swift` — Expo's runtime-bootstrap hook |
|
|
32
|
+
| Android | `settings.gradle` / `app/build.gradle` — resolve and include the Expo Gradle projects |
|
|
33
|
+
| Android | `MainApplication.kt` — Expo's bootstrap hook, plus a native-module name map |
|
|
34
34
|
|
|
35
35
|
Full mechanics live in the `symbiote-expo-native-module` skill. The per-package half of that table
|
|
36
36
|
— the Gradle dependency and the module map entry — is generated by
|
|
@@ -45,18 +45,18 @@ your app automatically.
|
|
|
45
45
|
src/core/ the whole API: open/dismiss, the auth session, and the Custom Tabs
|
|
46
46
|
service functions. native-module.ts resolves ExpoWebBrowser through
|
|
47
47
|
expo-modules-core's requireNativeModule.
|
|
48
|
-
src/react/ @symbiote-native/web-browser/react
|
|
49
|
-
src/vue/ @symbiote-native/web-browser/vue
|
|
50
48
|
src/angular/ @symbiote-native/web-browser/angular
|
|
51
49
|
```
|
|
52
50
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
51
|
+
`./react`, `./vue`, and `./svelte` are `exports`-map aliases straight onto `src/core/` — no
|
|
52
|
+
physical per-framework file. Every export is a stateless free function; the one piece of live
|
|
53
|
+
state — the Android auth-session polyfill's redirect subscription — belongs to a single in-flight
|
|
54
|
+
promise inside the core and never surfaces as something a caller subscribes to or tears down. So
|
|
55
|
+
there is nothing for a hook, composable, or service to wrap, the same reason
|
|
56
|
+
[`@symbiote-native/secure-store`](../secure-store) does the same. `./angular` stays a physical
|
|
57
|
+
file/subpath since Angular ships through a separate `ngc`/AOT build (`build-ngc/`). Import from
|
|
58
|
+
`@symbiote-native/web-browser` directly if you don't care which adapter you're on; the per-adapter
|
|
59
|
+
subpaths exist so every wrapper package has the same import surface.
|
|
60
60
|
|
|
61
61
|
## Use it
|
|
62
62
|
|
|
@@ -101,18 +101,18 @@ await WebBrowser.coolDownAsync(servicePackage);
|
|
|
101
101
|
|
|
102
102
|
## API
|
|
103
103
|
|
|
104
|
-
| Export
|
|
105
|
-
|
|
106
|
-
| `openBrowserAsync`
|
|
107
|
-
| `dismissBrowser`
|
|
108
|
-
| `openAuthSessionAsync`
|
|
109
|
-
| `dismissAuthSession`
|
|
110
|
-
| `warmUpAsync`
|
|
111
|
-
| `mayInitWithUrlAsync`
|
|
112
|
-
| `coolDownAsync`
|
|
113
|
-
| `getCustomTabsSupportingBrowsersAsync` | `() => Promise<IWebBrowserCustomTabsResults>`
|
|
114
|
-
| `WebBrowserResultType`
|
|
115
|
-
| `WebBrowserPresentationStyle`
|
|
104
|
+
| Export | Signature | Notes |
|
|
105
|
+
| -------------------------------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------------------- |
|
|
106
|
+
| `openBrowserAsync` | `(url, options?) => Promise<IWebBrowserResult>` | Opens the in-app browser. |
|
|
107
|
+
| `dismissBrowser` | `() => Promise<IWebBrowserDismissResult>` | iOS only — throws elsewhere, since a Custom Tab cannot be closed programmatically. |
|
|
108
|
+
| `openAuthSessionAsync` | `(url, redirectUrl?, options?) => Promise<IWebBrowserAuthSessionResult>` | Resolves `{ type: 'success', url }` on the redirect. |
|
|
109
|
+
| `dismissAuthSession` | `() => void` | iOS only, for the same reason as `dismissBrowser`. |
|
|
110
|
+
| `warmUpAsync` | `(browserPackage?) => Promise<IWebBrowserWarmUpResult>` | Android. Resolves `{}` elsewhere. |
|
|
111
|
+
| `mayInitWithUrlAsync` | `(url, browserPackage?) => Promise<IWebBrowserMayInitWithUrlResult>` | Android. Resolves `{}` elsewhere. |
|
|
112
|
+
| `coolDownAsync` | `(browserPackage?) => Promise<IWebBrowserCoolDownResult>` | Android. Resolves `{}` elsewhere. |
|
|
113
|
+
| `getCustomTabsSupportingBrowsersAsync` | `() => Promise<IWebBrowserCustomTabsResults>` | Android. Throws on iOS — see the note below. |
|
|
114
|
+
| `WebBrowserResultType` | `enum` | `CANCEL`, `DISMISS`, `OPENED`, `LOCKED`. |
|
|
115
|
+
| `WebBrowserPresentationStyle` | `enum` | iOS modal presentation styles for `options.presentationStyle`. |
|
|
116
116
|
|
|
117
117
|
`IWebBrowserOpenOptions`: `toolbarColor`, `enableBarCollapsing`; Android's `browserPackage`,
|
|
118
118
|
`secondaryToolbarColor`, `showTitle`, `enableDefaultShareMenuItem`, `showInRecents`, `createTask`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native-module.js","sourceRoot":"","sources":["../../src/core/native-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAYxD,MAAM,4BAA4B,GAAG,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"native-module.js","sourceRoot":"","sources":["../../src/core/native-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAYxD,MAAM,4BAA4B,GAAG,gBAAgB,CAAC;AA+BtD,MAAM,CAAC,MAAM,cAAc,GAAG,mBAAmB,CAC/C,4BAA4B,CAC7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-browser.js","sourceRoot":"","sources":["../../src/core/web-browser.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,sFAAsF;AACtF,gGAAgG;AAChG,4FAA4F;AAC5F,gDAAgD;AAChD,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAElE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE/D,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EACL,oBAAoB,GAarB,MAAM,SAAS,CAAC;AAEjB,MAAM,kBAAkB,GAAG,kBAAkB,CAAC;AAE9C,MAAM,0BAA0B,GAAiC;IAC/D,qBAAqB,EAAE,SAAS;IAChC,uBAAuB,EAAE,SAAS;IAClC,eAAe,EAAE,EAAE;IACnB,eAAe,EAAE,EAAE;CACpB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,oCAAoC;IACxD,yFAAyF;IACzF,yFAAyF;IACzF,iDAAiD;IACjD,IAAI,CAAC,cAAc,CAAC,oCAAoC,EAAE,CAAC;QACzD,MAAM,IAAI,mBAAmB,
|
|
1
|
+
{"version":3,"file":"web-browser.js","sourceRoot":"","sources":["../../src/core/web-browser.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,sFAAsF;AACtF,gGAAgG;AAChG,4FAA4F;AAC5F,gDAAgD;AAChD,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAElE,OAAO,EAAE,QAAQ,E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AC;YAC/C,CAAC;QACH,CAAC,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbiote-native/web-browser",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "expo-web-browser wrapped for SymbioteNative — one framework-agnostic core, built once and reachable from the React, Vue, and Angular adapters. In-app browser (SFSafariViewController / Android Custom Tabs) and the OAuth auth-session flow.",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "expo-web-browser wrapped for SymbioteNative — one framework-agnostic core, built once and reachable from the React, Vue, Svelte, Solid, and Angular adapters. In-app browser (SFSafariViewController / Android Custom Tabs) and the OAuth auth-session flow.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -23,12 +23,20 @@
|
|
|
23
23
|
"default": "./build/core/index.js"
|
|
24
24
|
},
|
|
25
25
|
"./vue": {
|
|
26
|
-
"types": "./build/
|
|
27
|
-
"default": "./build/
|
|
26
|
+
"types": "./build/core/index.d.ts",
|
|
27
|
+
"default": "./build/core/index.js"
|
|
28
28
|
},
|
|
29
29
|
"./react": {
|
|
30
|
-
"types": "./build/
|
|
31
|
-
"default": "./build/
|
|
30
|
+
"types": "./build/core/index.d.ts",
|
|
31
|
+
"default": "./build/core/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./svelte": {
|
|
34
|
+
"types": "./build/core/index.d.ts",
|
|
35
|
+
"default": "./build/core/index.js"
|
|
36
|
+
},
|
|
37
|
+
"./solid": {
|
|
38
|
+
"types": "./build/core/index.d.ts",
|
|
39
|
+
"default": "./build/core/index.js"
|
|
32
40
|
},
|
|
33
41
|
"./angular": {
|
|
34
42
|
"types": "./build-ngc/angular/index.d.ts",
|
|
@@ -53,15 +61,19 @@
|
|
|
53
61
|
"expo-modules-core": "57.0.5"
|
|
54
62
|
},
|
|
55
63
|
"peerDependencies": {
|
|
64
|
+
"@symbiote-native/angular": ">=0.6.2",
|
|
56
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",
|
|
57
70
|
"@angular/core": ">=20",
|
|
58
71
|
"@vue/runtime-core": "^3.5.13",
|
|
59
72
|
"react": ">=19.0.0",
|
|
60
73
|
"react-native": ">=0.86",
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"@symbiote-native/angular": "0.6.2"
|
|
74
|
+
"solid-js": ">=1.9.0",
|
|
75
|
+
"svelte": ">=5.56.0",
|
|
76
|
+
"vue": ">=3.5.0"
|
|
65
77
|
},
|
|
66
78
|
"peerDependenciesMeta": {
|
|
67
79
|
"@symbiote-native/angular": {
|
|
@@ -70,6 +82,12 @@
|
|
|
70
82
|
"@symbiote-native/react": {
|
|
71
83
|
"optional": true
|
|
72
84
|
},
|
|
85
|
+
"@symbiote-native/solid": {
|
|
86
|
+
"optional": true
|
|
87
|
+
},
|
|
88
|
+
"@symbiote-native/svelte": {
|
|
89
|
+
"optional": true
|
|
90
|
+
},
|
|
73
91
|
"@symbiote-native/vue": {
|
|
74
92
|
"optional": true
|
|
75
93
|
},
|
|
@@ -82,24 +100,34 @@
|
|
|
82
100
|
"react": {
|
|
83
101
|
"optional": true
|
|
84
102
|
},
|
|
103
|
+
"solid-js": {
|
|
104
|
+
"optional": true
|
|
105
|
+
},
|
|
106
|
+
"svelte": {
|
|
107
|
+
"optional": true
|
|
108
|
+
},
|
|
85
109
|
"vue": {
|
|
86
110
|
"optional": true
|
|
87
111
|
}
|
|
88
112
|
},
|
|
89
113
|
"devDependencies": {
|
|
90
|
-
"@angular/compiler": "
|
|
91
|
-
"@angular/compiler-cli": "
|
|
92
|
-
"@angular/core": "
|
|
114
|
+
"@angular/compiler": "~22.0.8",
|
|
115
|
+
"@angular/compiler-cli": "~22.0.8",
|
|
116
|
+
"@angular/core": "~22.0.8",
|
|
93
117
|
"@types/node": "^26.0.0",
|
|
94
118
|
"@types/react": "^19.2.0",
|
|
95
119
|
"@vue/runtime-core": "^3.5.13",
|
|
96
120
|
"react": "19.2.3",
|
|
121
|
+
"solid-js": "^1.9.14",
|
|
122
|
+
"svelte": "^5.56.0",
|
|
97
123
|
"typescript": "~6.0.0",
|
|
98
|
-
"@symbiote-native/angular": "0.
|
|
99
|
-
"@symbiote-native/
|
|
100
|
-
"@symbiote-native/
|
|
101
|
-
"@symbiote-native/
|
|
102
|
-
"@symbiote-native/
|
|
124
|
+
"@symbiote-native/angular": "0.8.0",
|
|
125
|
+
"@symbiote-native/engine": "0.3.0",
|
|
126
|
+
"@symbiote-native/solid": "0.1.0",
|
|
127
|
+
"@symbiote-native/react": "0.4.0",
|
|
128
|
+
"@symbiote-native/svelte": "0.3.0",
|
|
129
|
+
"@symbiote-native/test-utils": "0.2.0",
|
|
130
|
+
"@symbiote-native/vue": "0.5.0"
|
|
103
131
|
},
|
|
104
132
|
"scripts": {
|
|
105
133
|
"typecheck": "tsc --build",
|
|
@@ -21,7 +21,10 @@ const EXPO_WEB_BROWSER_MODULE_NAME = 'ExpoWebBrowser';
|
|
|
21
21
|
// getCustomTabsSupportingBrowsersAsync. There is no way to dismiss a Custom Tab and no
|
|
22
22
|
// native auth session; the user has to press the tab's own close button.
|
|
23
23
|
export type INativeWebBrowserModule = {
|
|
24
|
-
openBrowserAsync?(
|
|
24
|
+
openBrowserAsync?(
|
|
25
|
+
url: string,
|
|
26
|
+
options: IProcessedOpenOptions,
|
|
27
|
+
): Promise<IWebBrowserResult>;
|
|
25
28
|
dismissBrowser?(): Promise<IWebBrowserDismissResult>;
|
|
26
29
|
openAuthSessionAsync?(
|
|
27
30
|
url: string,
|
package/src/core/types.ts
CHANGED
|
@@ -202,7 +202,8 @@ export type IServiceActionResult = {
|
|
|
202
202
|
servicePackage?: string;
|
|
203
203
|
};
|
|
204
204
|
|
|
205
|
-
export type IWebBrowserAuthSessionResult =
|
|
205
|
+
export type IWebBrowserAuthSessionResult =
|
|
206
|
+
IWebBrowserRedirectResult | IWebBrowserResult;
|
|
206
207
|
export type IWebBrowserMayInitWithUrlResult = IServiceActionResult;
|
|
207
208
|
export type IWebBrowserWarmUpResult = IServiceActionResult;
|
|
208
209
|
export type IWebBrowserCoolDownResult = IServiceActionResult;
|
package/src/core/web-browser.ts
CHANGED
|
@@ -45,7 +45,10 @@ export async function getCustomTabsSupportingBrowsersAsync(): Promise<IWebBrowse
|
|
|
45
45
|
// suffix, so this guard — kept in upstream's order deliberately — fires there before the
|
|
46
46
|
// non-Android early return below can be reached.
|
|
47
47
|
if (!expoWebBrowser.getCustomTabsSupportingBrowsersAsync) {
|
|
48
|
-
throw new UnavailabilityError(
|
|
48
|
+
throw new UnavailabilityError(
|
|
49
|
+
NATIVE_MODULE_NAME,
|
|
50
|
+
'getCustomTabsSupportingBrowsersAsync',
|
|
51
|
+
);
|
|
49
52
|
}
|
|
50
53
|
if (Platform.OS !== 'android') {
|
|
51
54
|
return EMPTY_CUSTOM_TABS_PACKAGES;
|
|
@@ -60,7 +63,9 @@ export async function getCustomTabsSupportingBrowsersAsync(): Promise<IWebBrowse
|
|
|
60
63
|
* @param browserPackage Browser to warm up. Defaults to the preferred one.
|
|
61
64
|
* @platform android
|
|
62
65
|
*/
|
|
63
|
-
export async function warmUpAsync(
|
|
66
|
+
export async function warmUpAsync(
|
|
67
|
+
browserPackage?: string,
|
|
68
|
+
): Promise<IWebBrowserWarmUpResult> {
|
|
64
69
|
if (!expoWebBrowser.warmUpAsync) {
|
|
65
70
|
throw new UnavailabilityError(NATIVE_MODULE_NAME, 'warmUpAsync');
|
|
66
71
|
}
|
|
@@ -100,7 +105,9 @@ export async function mayInitWithUrlAsync(
|
|
|
100
105
|
* @returns The cooled service, or an empty object when there was no connection to dismiss.
|
|
101
106
|
* @platform android
|
|
102
107
|
*/
|
|
103
|
-
export async function coolDownAsync(
|
|
108
|
+
export async function coolDownAsync(
|
|
109
|
+
browserPackage?: string,
|
|
110
|
+
): Promise<IWebBrowserCoolDownResult> {
|
|
104
111
|
if (!expoWebBrowser.coolDownAsync) {
|
|
105
112
|
throw new UnavailabilityError(NATIVE_MODULE_NAME, 'coolDownAsync');
|
|
106
113
|
}
|
|
@@ -174,7 +181,11 @@ export async function openAuthSessionAsync(
|
|
|
174
181
|
if (!expoWebBrowser.openAuthSessionAsync) {
|
|
175
182
|
throw new UnavailabilityError(NATIVE_MODULE_NAME, 'openAuthSessionAsync');
|
|
176
183
|
}
|
|
177
|
-
return expoWebBrowser.openAuthSessionAsync(
|
|
184
|
+
return expoWebBrowser.openAuthSessionAsync(
|
|
185
|
+
url,
|
|
186
|
+
redirectUrl,
|
|
187
|
+
processOptions(options),
|
|
188
|
+
);
|
|
178
189
|
}
|
|
179
190
|
|
|
180
191
|
/**
|
|
@@ -198,7 +209,9 @@ export function dismissAuthSession(): void {
|
|
|
198
209
|
void expoWebBrowser.dismissBrowser();
|
|
199
210
|
}
|
|
200
211
|
|
|
201
|
-
function processOptions(
|
|
212
|
+
function processOptions(
|
|
213
|
+
options: IAuthSessionOpenOptions,
|
|
214
|
+
): IProcessedOpenOptions {
|
|
202
215
|
return {
|
|
203
216
|
...options,
|
|
204
217
|
controlsColor: processColor(options.controlsColor),
|
|
@@ -242,7 +255,10 @@ async function openBrowserAndWaitAndroidAsync(
|
|
|
242
255
|
const appStateChangedToActive = new Promise<void>(resolve => {
|
|
243
256
|
onWebBrowserCloseAndroid = resolve;
|
|
244
257
|
});
|
|
245
|
-
const stateChangeSubscription = AppState.addEventListener(
|
|
258
|
+
const stateChangeSubscription = AppState.addEventListener(
|
|
259
|
+
'change',
|
|
260
|
+
onAppStateChangeAndroid,
|
|
261
|
+
);
|
|
246
262
|
|
|
247
263
|
let launched: IWebBrowserResult;
|
|
248
264
|
try {
|
|
@@ -275,7 +291,9 @@ async function openAuthSessionPolyfillAsync(
|
|
|
275
291
|
);
|
|
276
292
|
}
|
|
277
293
|
if (onWebBrowserCloseAndroid) {
|
|
278
|
-
throw new Error(
|
|
294
|
+
throw new Error(
|
|
295
|
+
'WebBrowser is already open, only one can be open at a time',
|
|
296
|
+
);
|
|
279
297
|
}
|
|
280
298
|
|
|
281
299
|
try {
|
|
@@ -303,14 +321,19 @@ function stopWaitingForRedirect(): void {
|
|
|
303
321
|
redirectSubscription = null;
|
|
304
322
|
}
|
|
305
323
|
|
|
306
|
-
function waitForRedirectAsync(
|
|
324
|
+
function waitForRedirectAsync(
|
|
325
|
+
returnUrl?: string | null,
|
|
326
|
+
): Promise<IWebBrowserRedirectResult> {
|
|
307
327
|
// Deliberately never resolves when `returnUrl` is nullish: the browser promise it is raced
|
|
308
328
|
// against is then the only thing that can settle the session.
|
|
309
329
|
return new Promise(resolve => {
|
|
310
|
-
redirectSubscription = Linking.addEventListener(
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
330
|
+
redirectSubscription = Linking.addEventListener(
|
|
331
|
+
'url',
|
|
332
|
+
(event: IRedirectEvent) => {
|
|
333
|
+
if (returnUrl && event.url.startsWith(returnUrl)) {
|
|
334
|
+
resolve({ url: event.url, type: 'success' });
|
|
335
|
+
}
|
|
336
|
+
},
|
|
337
|
+
);
|
|
315
338
|
});
|
|
316
339
|
}
|
package/build/react/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../core';
|
package/build/react/index.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
// @symbiote-native/web-browser/react: the React entry over the framework-agnostic core.
|
|
2
|
-
// Every export is a stateless free function. The one piece of live state — the Android
|
|
3
|
-
// auth-session polyfill's redirect subscription — belongs to a single in-flight promise inside the
|
|
4
|
-
// core and never surfaces as something a caller subscribes to or tears down, so there is nothing
|
|
5
|
-
// for a hook to wrap. Hence a plain re-export, the same shape packages/secure-store's React entry
|
|
6
|
-
// has for the same reason.
|
|
7
|
-
export * from '../core/index.js';
|
package/build/vue/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../core';
|
package/build/vue/index.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
// @symbiote-native/web-browser/vue: the Vue entry over the framework-agnostic core.
|
|
2
|
-
// Nothing here holds per-instance state or hands back a subscription, so there is no lifecycle for
|
|
3
|
-
// a composable to own — see the React entry for the full reasoning.
|
|
4
|
-
export * from '../core/index.js';
|
package/src/react/index.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
// @symbiote-native/web-browser/react: the React entry over the framework-agnostic core.
|
|
2
|
-
// Every export is a stateless free function. The one piece of live state — the Android
|
|
3
|
-
// auth-session polyfill's redirect subscription — belongs to a single in-flight promise inside the
|
|
4
|
-
// core and never surfaces as something a caller subscribes to or tears down, so there is nothing
|
|
5
|
-
// for a hook to wrap. Hence a plain re-export, the same shape packages/secure-store's React entry
|
|
6
|
-
// has for the same reason.
|
|
7
|
-
export * from '../core';
|
package/src/vue/index.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
// @symbiote-native/web-browser/vue: the Vue entry over the framework-agnostic core.
|
|
2
|
-
// Nothing here holds per-instance state or hands back a subscription, so there is no lifecycle for
|
|
3
|
-
// a composable to own — see the React entry for the full reasoning.
|
|
4
|
-
export * from '../core';
|