@symbiote-native/angular 3.4.0 → 3.5.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/build/angular/index.d.ts +2 -1
- package/build/angular/index.js +2 -1
- package/build/angular/index.js.map +1 -1
- package/build/angular/render/index.d.ts +2 -2
- package/build/angular/render/index.js +10 -29
- package/build/angular/render/index.js.map +1 -1
- package/build/angular/root-tag.d.ts +4 -0
- package/build/angular/root-tag.js +10 -0
- package/build/angular/root-tag.js.map +1 -0
- package/package.json +4 -4
- package/src/index.ts +7 -0
- package/src/render/index.ts +23 -50
- package/src/root-tag.ts +14 -0
package/build/angular/index.d.ts
CHANGED
|
@@ -25,11 +25,12 @@ export type { IStatusBarProps, IStatusBarStyle } from './modules/status-bar';
|
|
|
25
25
|
export { AppRegistry, HeadlessJsTaskError, setHostRegistrar, } from './modules/app-registry';
|
|
26
26
|
export type { IComponentProvider, IAppConfig, IAppParameters, IRunnable, IHostRegistrar, IWrapperComponentProvider, IRegistry, IHeadlessTask, ITaskProvider, ITaskCanceller, ITaskCancelProvider, } from './modules/app-registry';
|
|
27
27
|
export { ColorSchemeService, WindowDimensionsService, createResourceHook, createEventValueHook, injectEvent, injectEventListener, connectWatchedSignal, PermissionsServiceBase, } from './services';
|
|
28
|
+
export { ROOT_TAG, injectRootTag } from './root-tag';
|
|
28
29
|
export { createAnimatedColor as injectAnimatedColor, createAnimatedValue as injectAnimatedValue, createAnimatedValueXY as injectAnimatedValueXY, } from '@symbiote-native/engine';
|
|
29
30
|
export { AccessibilityInputsBase } from './accessibility-inputs';
|
|
30
31
|
export { NativeViewBase } from './native-view-base';
|
|
31
32
|
export { anchorStyleProp } from './primitives/shared';
|
|
32
|
-
export { Alert, Share, ActionSheetIOS, Linking, Vibration, ToastAndroid, Settings, I18nManager, Dimensions, Appearance, AppState, Keyboard, KEYBOARD_EVENT, TextInputState, BackHandler, PermissionsAndroid, PERMISSIONS, RESULTS, AccessibilityInfo, LayoutAnimation, InteractionManager, PanResponder, PixelRatio, PlatformColor, DynamicColorIOS, } from '@symbiote-native/engine';
|
|
33
|
+
export { Alert, Share, ActionSheetIOS, Linking, Vibration, ToastAndroid, Settings, I18nManager, Dimensions, Appearance, matchMedia, MediaQueryList, MediaQueryListEvent, setVariable, getComputedVariable, registerProperty, AppState, Keyboard, KEYBOARD_EVENT, TextInputState, BackHandler, PermissionsAndroid, PERMISSIONS, RESULTS, AccessibilityInfo, LayoutAnimation, InteractionManager, PanResponder, PixelRatio, PlatformColor, DynamicColorIOS, } from '@symbiote-native/engine';
|
|
33
34
|
export type { IAlertType, IAlertButtonStyle, IAlertButton, IAlertButtons, IAlertOptions, IShareContent, IShareOptions, IShareAction, IActionSheetIOSOptions, IShareActionSheetIOSOptions, IShareActionSheetError, IUrlEvent, II18nManagerConstants, IDisplayMetrics, IDisplayMetricsAndroid, IDimensionsPayload, IDimensionsSet, IDimensionsKey, IDimensionsChangeListener, IDimensionsStatic, IColorSchemeName, IColorSchemePreference, IAppStateStatus, IAppStateEvent, IKeyboardEventName, IKeyboardEvent, IKeyboardMetrics, IBackPressEventName, IBackPressHandler, IPermission, IPermissionStatus, IRationale, IAccessibilityChangeEvent, IAccessibilityChangeEventName, IAccessibilityChangeEventHandler, IAccessibilityAnnouncementFinishedEvent, IAnnounceForAccessibilityOptions, IAccessibilityEventType, ILayoutAnimationType, ILayoutAnimationProperty, ILayoutAnimationConfig, ILayoutAnimationAnim, IInteractionEvent, ISimpleTask, IPromiseTask, ITask, IHandle, IPanResponderGestureState, IPanResponderCallbacks, IGestureResponderHandlers, IPanResponderInstance, IPixelRatioStatic, IColorValue, IOpaqueColorValue, IDynamicColorIOSTuple, } from '@symbiote-native/engine';
|
|
34
35
|
export { dlog, isDebug, Platform, processColor, setColorProcessor, setNativeViewConfigSource, StyleSheet, } from '@symbiote-native/engine';
|
|
35
36
|
export type { IRootTag, ISymbioteEvent, ISymbioteNode, } from '@symbiote-native/engine';
|
package/build/angular/index.js
CHANGED
|
@@ -63,13 +63,14 @@ export { StatusBar } from './modules/status-bar';
|
|
|
63
63
|
// registrar so the native Fabric host finds our runnable by app key.
|
|
64
64
|
export { AppRegistry, HeadlessJsTaskError, setHostRegistrar, } from './modules/app-registry';
|
|
65
65
|
export { ColorSchemeService, WindowDimensionsService, createResourceHook, createEventValueHook, injectEvent, injectEventListener, connectWatchedSignal, PermissionsServiceBase, } from './services';
|
|
66
|
+
export { ROOT_TAG, injectRootTag } from './root-tag';
|
|
66
67
|
export { createAnimatedColor as injectAnimatedColor, createAnimatedValue as injectAnimatedValue, createAnimatedValueXY as injectAnimatedValueXY, } from '@symbiote-native/engine';
|
|
67
68
|
export { AccessibilityInputsBase } from './accessibility-inputs';
|
|
68
69
|
export { NativeViewBase } from './native-view-base';
|
|
69
70
|
export { anchorStyleProp } from './primitives/shared';
|
|
70
71
|
// Framework-agnostic runtime modules from @symbiote-native/engine. Every adapter re-exports them so
|
|
71
72
|
// app code names only @symbiote-native/angular.
|
|
72
|
-
export { Alert, Share, ActionSheetIOS, Linking, Vibration, ToastAndroid, Settings, I18nManager, Dimensions, Appearance, AppState, Keyboard, KEYBOARD_EVENT, TextInputState, BackHandler, PermissionsAndroid, PERMISSIONS, RESULTS, AccessibilityInfo, LayoutAnimation, InteractionManager, PanResponder, PixelRatio, PlatformColor, DynamicColorIOS, } from '@symbiote-native/engine';
|
|
73
|
+
export { Alert, Share, ActionSheetIOS, Linking, Vibration, ToastAndroid, Settings, I18nManager, Dimensions, Appearance, matchMedia, MediaQueryList, MediaQueryListEvent, setVariable, getComputedVariable, registerProperty, AppState, Keyboard, KEYBOARD_EVENT, TextInputState, BackHandler, PermissionsAndroid, PERMISSIONS, RESULTS, AccessibilityInfo, LayoutAnimation, InteractionManager, PanResponder, PixelRatio, PlatformColor, DynamicColorIOS, } from '@symbiote-native/engine';
|
|
73
74
|
export { dlog, isDebug, Platform, processColor, setColorProcessor, setNativeViewConfigSource, StyleSheet, } from '@symbiote-native/engine';
|
|
74
75
|
// Diagnostics: per-window Angular-side counters (change-detection passes, renderer writes, list
|
|
75
76
|
// recomputes, cell views). The engine's readCommitProfile() prices the commit; these say how many
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,yGAAyG;AACzG,8FAA8F;AAC9F,sGAAsG;AACtG,EAAE;AACF,4FAA4F;AAC5F,wFAAwF;AACxF,EAAE;AACF,kFAAkF;AAClF,kGAAkG;AAClG,mGAAmG;AACnG,EAAE;AACF,mGAAmG;AACnG,sGAAsG;AACtG,oFAAoF;AACpF,EAAE;AACF,kGAAkG;AAClG,mGAAmG;AACnG,mFAAmF;AAEnF,OAAO,yBAAyB,CAAC;AACjC,OAAO,YAAY,CAAC;AAEpB,OAAO,EACL,eAAe,EACf,QAAQ,EACR,2BAA2B,EAC3B,oBAAoB,EACpB,KAAK,EACL,oBAAoB,EACpB,KAAK,EACL,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,0BAA0B,EAC1B,2BAA2B,EAC3B,IAAI,EACJ,uBAAuB,EACvB,IAAI,EACJ,0BAA0B,EAC1B,eAAe,EACf,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,cAAc,CAAC;AACtB,wFAAwF;AACxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,kGAAkG;AAClG,6FAA6F;AAC7F,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,EACZ,YAAY,GACb,MAAM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,MAAM,yBAAyB,CAAC;AAoCjC,gGAAgG;AAChG,kGAAkG;AAClG,mFAAmF;AACnF,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,eAAe,CAAC;AAGvB,8EAA8E;AAC9E,OAAO,EACL,kBAAkB,EAClB,MAAM,EACN,YAAY,EACZ,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AAWjC,kGAAkG;AAClG,oDAAoD;AACpD,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,OAAO,EACP,WAAW,EACX,MAAM,EACN,uBAAuB,EACvB,aAAa,EACb,UAAU,EACV,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,QAAQ,EACR,SAAS,EACT,mBAAmB,EACnB,SAAS,EACT,WAAW,GACZ,MAAM,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,yGAAyG;AACzG,8FAA8F;AAC9F,sGAAsG;AACtG,EAAE;AACF,4FAA4F;AAC5F,wFAAwF;AACxF,EAAE;AACF,kFAAkF;AAClF,kGAAkG;AAClG,mGAAmG;AACnG,EAAE;AACF,mGAAmG;AACnG,sGAAsG;AACtG,oFAAoF;AACpF,EAAE;AACF,kGAAkG;AAClG,mGAAmG;AACnG,mFAAmF;AAEnF,OAAO,yBAAyB,CAAC;AACjC,OAAO,YAAY,CAAC;AAEpB,OAAO,EACL,eAAe,EACf,QAAQ,EACR,2BAA2B,EAC3B,oBAAoB,EACpB,KAAK,EACL,oBAAoB,EACpB,KAAK,EACL,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,0BAA0B,EAC1B,2BAA2B,EAC3B,IAAI,EACJ,uBAAuB,EACvB,IAAI,EACJ,0BAA0B,EAC1B,eAAe,EACf,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EAC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AAE,MAAM,qBAAqB,CAAC;AAEtD,oGAAoG;AACpG,gDAAgD;AAChD,OAAO,EACL,KAAK,EACL,KAAK,EACL,cAAc,EACd,OAAO,EACP,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,UAAU,EACV,UAAU,EACV,UAAU,EACV,cAAc,EACd,mBAAmB,EACnB,WAAW,EACX,mBAAmB,EACnB,gBAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,OAAO,EACP,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,YAAY,EACZ,UAAU,EACV,aAAa,EACb,eAAe,GAChB,MAAM,yBAAyB,CAAC;AA0DjC,OAAO,EACL,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,iBAAiB,EACjB,yBAAyB,EACzB,UAAU,GACX,MAAM,yBAAyB,CAAC;AAoCjC,gGAAgG;AAChG,kGAAkG;AAClG,mFAAmF;AACnF,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,eAAe,CAAC;AAGvB,8EAA8E;AAC9E,OAAO,EACL,kBAAkB,EAClB,MAAM,EACN,YAAY,EACZ,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AAWjC,kGAAkG;AAClG,oDAAoD;AACpD,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,OAAO,EACP,WAAW,EACX,MAAM,EACN,uBAAuB,EACvB,aAAa,EACb,UAAU,EACV,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,QAAQ,EACR,SAAS,EACT,mBAAmB,EACnB,SAAS,EACT,WAAW,GACZ,MAAM,yBAAyB,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type IRootTag, type SymbioteSurface } from '@symbiote-native/engine';
|
|
2
2
|
import { type EnvironmentProviders, type Provider, type Type } from '@angular/core';
|
|
3
|
-
export
|
|
3
|
+
export type IMountOptions = {
|
|
4
4
|
initialProps?: object;
|
|
5
5
|
wrapperComponent?: Type<unknown>;
|
|
6
|
-
}
|
|
6
|
+
};
|
|
7
7
|
export declare function setRootProviders(providers: (Provider | EnvironmentProviders)[]): void;
|
|
8
8
|
export declare function mount(rootTag: IRootTag, rootComponent: Type<unknown>, options?: IMountOptions): SymbioteSurface;
|
|
9
9
|
export declare function unmount(rootTag: IRootTag): void;
|
|
@@ -8,6 +8,7 @@ import { createElement as createEngineElement, createSurface, disposeRoot, dlog,
|
|
|
8
8
|
import { descriptorFor } from '@symbiote-native/components';
|
|
9
9
|
import { ApplicationRef, createComponent, createEnvironmentInjector, DOCUMENT, enableProdMode, ErrorHandler, RendererFactory2, ɵINJECTOR_SCOPE as INJECTOR_SCOPE, ɵprovideZonelessChangeDetectionInternal as provideZonelessChangeDetectionInternal, } from '@angular/core';
|
|
10
10
|
import { SymbioteRendererFactory } from '../renderer';
|
|
11
|
+
import { ROOT_TAG } from '../root-tag';
|
|
11
12
|
import { ColorSchemeService, WindowDimensionsService } from '../services';
|
|
12
13
|
// The two FFI-edge casts of this adapter, both confined here to bootstrap. Angular's core
|
|
13
14
|
// types model a browser: the injector parent is a non-null EnvironmentInjector, the host is
|
|
@@ -29,39 +30,18 @@ function asAngularHost(hostNode) {
|
|
|
29
30
|
});
|
|
30
31
|
return hostNode;
|
|
31
32
|
}
|
|
32
|
-
// A bare `view` node
|
|
33
|
-
//
|
|
34
|
-
//
|
|
35
|
-
// wrapperComponentProvider is set: Angular has no hostElement-less bootstrap for our renderer
|
|
36
|
-
// (it would try `renderer.createElement(rootComponent.selector)`, which throws for anything
|
|
37
|
-
// that isn't one of our primitives), so the root needs an explicit host too, one we then hand
|
|
38
|
-
// to the wrapper as projectable content.
|
|
33
|
+
// A bare `view` node made through the engine, since Angular's `createElement` resolves only
|
|
34
|
+
// known primitives, never a component selector
|
|
35
|
+
// Host of the root when `wrapperComponentProvider` is set, projected into the wrapper
|
|
39
36
|
function createDetachedViewHost() {
|
|
40
37
|
// 'view', not 'View': the public name is not a Fabric view name, and until
|
|
41
38
|
// makeDescriptorFor learned to reject one it fell through to a view literally named `View`.
|
|
42
39
|
const descriptor = descriptorFor('view');
|
|
43
40
|
return toPublicInstance(createEngineElement(descriptor.component, descriptor.isText));
|
|
44
41
|
}
|
|
45
|
-
// Angular's whole unhandled-error funnel
|
|
46
|
-
//
|
|
47
|
-
//
|
|
48
|
-
// Angular app reaches the same native redbox as a React one instead of a console line nobody sees
|
|
49
|
-
// off a dev machine.
|
|
50
|
-
//
|
|
51
|
-
// There is deliberately no caught-vs-uncaught split here, unlike the React adapter's
|
|
52
|
-
// onUncaughtError/onCaughtError pair. Angular has no error boundary, and every path where the app
|
|
53
|
-
// DID handle something keeps clear of this seam on its own: a `@defer` block with an `@error`
|
|
54
|
-
// branch renders that branch (defer/rendering.ts calls handleUncaughtError only when there is
|
|
55
|
-
// none), `resource()` parks the failure in its own error signal, and an app-level try/catch or
|
|
56
|
-
// `catchError` never reaches Angular at all. So anything arriving here is by construction
|
|
57
|
-
// unclaimed, and the redbox is the right answer for all of it.
|
|
58
|
-
//
|
|
59
|
-
// Two things this must not do. It must not also call `super.handleError` — reportUncaughtError
|
|
60
|
-
// picks exactly one channel (host reporter or console) precisely because RN routes console.error
|
|
61
|
-
// into LogBox too, so the pair would double-report every error. And it must not throw: the
|
|
62
|
-
// scheduler invokes this from inside its own `catch` (zoneless_scheduling_impl.ts's tick), where a
|
|
63
|
-
// second throw escapes to the host and kills the "report and keep running" behaviour the provider
|
|
64
|
-
// exists for.
|
|
42
|
+
// Angular's whole unhandled-error funnel, routed to the engine for the native redbox
|
|
43
|
+
// No caught-vs-uncaught split, Angular has no error boundary and handled errors never arrive
|
|
44
|
+
// Never `super.handleError` (double report) and never throws (the scheduler calls it in a `catch`)
|
|
65
45
|
class SymbioteErrorHandler extends ErrorHandler {
|
|
66
46
|
handleError(error) {
|
|
67
47
|
reportUncaughtError(error, { origin: 'angular render' });
|
|
@@ -129,10 +109,11 @@ function settleAngularDevMode() {
|
|
|
129
109
|
enableProdMode();
|
|
130
110
|
}
|
|
131
111
|
// Kept apart from `mount` so the provider list reads as one block
|
|
132
|
-
function createRootInjector(surface, rendererFactory) {
|
|
112
|
+
function createRootInjector(rootTag, surface, rendererFactory) {
|
|
133
113
|
return createEnvironmentInjector([
|
|
134
114
|
...rootProviders,
|
|
135
115
|
{ provide: RendererFactory2, useValue: rendererFactory },
|
|
116
|
+
{ provide: ROOT_TAG, useValue: rootTag },
|
|
136
117
|
// `resource()` resolves TransferState, which calls `doc.getElementById`
|
|
137
118
|
// a stub without it throws mid-construction and the whole screen renders nothing
|
|
138
119
|
{
|
|
@@ -184,7 +165,7 @@ export function mount(rootTag, rootComponent, options) {
|
|
|
184
165
|
teardown(rootTag);
|
|
185
166
|
const surface = createSurface(rootTag);
|
|
186
167
|
const rendererFactory = new SymbioteRendererFactory(surface);
|
|
187
|
-
const injector = createRootInjector(surface, rendererFactory);
|
|
168
|
+
const injector = createRootInjector(rootTag, surface, rendererFactory);
|
|
188
169
|
const { cmpRef, rootRef } = createRoots(injector, surface, rootComponent, options);
|
|
189
170
|
// `tick()` then drives both root views through the real scheduler
|
|
190
171
|
const appRef = injector.get(ApplicationRef);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/render/index.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,yFAAyF;AACzF,2FAA2F;AAC3F,oFAAoF;AACpF,8EAA8E;AAC9E,8BAA8B;AAE9B,OAAO,EACL,aAAa,IAAI,mBAAmB,EACpC,aAAa,EACb,WAAW,EACX,IAAI,EACJ,mBAAmB,EACnB,gBAAgB,GAIjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EACL,cAAc,EACd,eAAe,EACf,yBAAyB,EACzB,QAAQ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S,wBAAwB;IAC/B,UAAU,CAAC,cAAc,GAAG,CAAC,SAAiB,EAAQ,EAAE;QACtD,OAAO,CAAC,SAAS,CAAC,CAAC;IACrB,CAAC,CAAC;IACF,IAAI,CAAC,iCAAiC,CAAC,CAAC;AAC1C,CAAC;AAED,wBAAwB,EAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// RN's `RootTagContext` for Angular: `mount` provides the surface tag, 0 outside any surface
|
|
2
|
+
import { InjectionToken, inject } from '@angular/core';
|
|
3
|
+
const NO_SURFACE = 0;
|
|
4
|
+
export const ROOT_TAG = new InjectionToken('symbiote.rootTag', {
|
|
5
|
+
factory: () => NO_SURFACE,
|
|
6
|
+
});
|
|
7
|
+
export function injectRootTag() {
|
|
8
|
+
return inject(ROOT_TAG);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=root-tag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root-tag.js","sourceRoot":"","sources":["../../src/root-tag.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAE7F,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAGvD,MAAM,UAAU,GAAG,CAAC,CAAC;AAErB,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAW,kBAAkB,EAAE;IACvE,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU;CAC1B,CAAC,CAAC;AAEH,MAAM,UAAU,aAAa;IAC3B,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbiote-native/angular",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0",
|
|
4
4
|
"description": "SymbioteNative's Angular adapter — a Renderer2/RendererFactory2 with DOM-less bootstrap driving real native iOS/Android views through the same engine as the other adapters.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"@angular/core": ">=20",
|
|
74
74
|
"@angular/forms": ">=20",
|
|
75
75
|
"react-native": ">=0.86",
|
|
76
|
-
"@symbiote-native/engine": "^1.
|
|
76
|
+
"@symbiote-native/engine": "^1.8.0"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
79
|
"@angular/compiler": "~22.0.8",
|
|
@@ -83,8 +83,8 @@
|
|
|
83
83
|
"@types/babel__core": "^7.20.5",
|
|
84
84
|
"@types/node": "^26.0.0",
|
|
85
85
|
"typescript": "~6.0.0",
|
|
86
|
-
"@symbiote-native/engine": "1.
|
|
87
|
-
"@symbiote-native/test-utils": "0.5.
|
|
86
|
+
"@symbiote-native/engine": "1.8.0",
|
|
87
|
+
"@symbiote-native/test-utils": "0.5.1"
|
|
88
88
|
},
|
|
89
89
|
"scripts": {
|
|
90
90
|
"clean": "rm -rf build",
|
package/src/index.ts
CHANGED
|
@@ -242,6 +242,7 @@ export {
|
|
|
242
242
|
connectWatchedSignal,
|
|
243
243
|
PermissionsServiceBase,
|
|
244
244
|
} from './services';
|
|
245
|
+
export { ROOT_TAG, injectRootTag } from './root-tag';
|
|
245
246
|
export {
|
|
246
247
|
createAnimatedColor as injectAnimatedColor,
|
|
247
248
|
createAnimatedValue as injectAnimatedValue,
|
|
@@ -264,6 +265,12 @@ export {
|
|
|
264
265
|
I18nManager,
|
|
265
266
|
Dimensions,
|
|
266
267
|
Appearance,
|
|
268
|
+
matchMedia,
|
|
269
|
+
MediaQueryList,
|
|
270
|
+
MediaQueryListEvent,
|
|
271
|
+
setVariable,
|
|
272
|
+
getComputedVariable,
|
|
273
|
+
registerProperty,
|
|
267
274
|
AppState,
|
|
268
275
|
Keyboard,
|
|
269
276
|
KEYBOARD_EVENT,
|
package/src/render/index.ts
CHANGED
|
@@ -34,6 +34,7 @@ import {
|
|
|
34
34
|
type Type,
|
|
35
35
|
} from '@angular/core';
|
|
36
36
|
import { SymbioteRendererFactory } from '../renderer';
|
|
37
|
+
import { ROOT_TAG } from '../root-tag';
|
|
37
38
|
import { ColorSchemeService, WindowDimensionsService } from '../services';
|
|
38
39
|
|
|
39
40
|
// The two FFI-edge casts of this adapter, both confined here to bootstrap. Angular's core
|
|
@@ -57,13 +58,9 @@ function asAngularHost(hostNode: SymbioteSurface | ISymbioteNode): Element {
|
|
|
57
58
|
return hostNode as unknown as Element;
|
|
58
59
|
}
|
|
59
60
|
|
|
60
|
-
// A bare `view` node
|
|
61
|
-
//
|
|
62
|
-
//
|
|
63
|
-
// wrapperComponentProvider is set: Angular has no hostElement-less bootstrap for our renderer
|
|
64
|
-
// (it would try `renderer.createElement(rootComponent.selector)`, which throws for anything
|
|
65
|
-
// that isn't one of our primitives), so the root needs an explicit host too, one we then hand
|
|
66
|
-
// to the wrapper as projectable content.
|
|
61
|
+
// A bare `view` node made through the engine, since Angular's `createElement` resolves only
|
|
62
|
+
// known primitives, never a component selector
|
|
63
|
+
// Host of the root when `wrapperComponentProvider` is set, projected into the wrapper
|
|
67
64
|
function createDetachedViewHost(): ISymbioteNode {
|
|
68
65
|
// 'view', not 'View': the public name is not a Fabric view name, and until
|
|
69
66
|
// makeDescriptorFor learned to reject one it fell through to a view literally named `View`.
|
|
@@ -73,53 +70,32 @@ function createDetachedViewHost(): ISymbioteNode {
|
|
|
73
70
|
);
|
|
74
71
|
}
|
|
75
72
|
|
|
76
|
-
// Angular's whole unhandled-error funnel
|
|
77
|
-
//
|
|
78
|
-
//
|
|
79
|
-
// Angular app reaches the same native redbox as a React one instead of a console line nobody sees
|
|
80
|
-
// off a dev machine.
|
|
81
|
-
//
|
|
82
|
-
// There is deliberately no caught-vs-uncaught split here, unlike the React adapter's
|
|
83
|
-
// onUncaughtError/onCaughtError pair. Angular has no error boundary, and every path where the app
|
|
84
|
-
// DID handle something keeps clear of this seam on its own: a `@defer` block with an `@error`
|
|
85
|
-
// branch renders that branch (defer/rendering.ts calls handleUncaughtError only when there is
|
|
86
|
-
// none), `resource()` parks the failure in its own error signal, and an app-level try/catch or
|
|
87
|
-
// `catchError` never reaches Angular at all. So anything arriving here is by construction
|
|
88
|
-
// unclaimed, and the redbox is the right answer for all of it.
|
|
89
|
-
//
|
|
90
|
-
// Two things this must not do. It must not also call `super.handleError` — reportUncaughtError
|
|
91
|
-
// picks exactly one channel (host reporter or console) precisely because RN routes console.error
|
|
92
|
-
// into LogBox too, so the pair would double-report every error. And it must not throw: the
|
|
93
|
-
// scheduler invokes this from inside its own `catch` (zoneless_scheduling_impl.ts's tick), where a
|
|
94
|
-
// second throw escapes to the host and kills the "report and keep running" behaviour the provider
|
|
95
|
-
// exists for.
|
|
73
|
+
// Angular's whole unhandled-error funnel, routed to the engine for the native redbox
|
|
74
|
+
// No caught-vs-uncaught split, Angular has no error boundary and handled errors never arrive
|
|
75
|
+
// Never `super.handleError` (double report) and never throws (the scheduler calls it in a `catch`)
|
|
96
76
|
class SymbioteErrorHandler extends ErrorHandler {
|
|
97
77
|
override handleError(error: unknown): void {
|
|
98
78
|
reportUncaughtError(error, { origin: 'angular render' });
|
|
99
79
|
}
|
|
100
80
|
}
|
|
101
81
|
|
|
102
|
-
|
|
82
|
+
type IMountedApp = {
|
|
103
83
|
cmpRef: ComponentRef<unknown>;
|
|
104
84
|
rootRef: ComponentRef<unknown> | undefined;
|
|
105
85
|
injector: EnvironmentInjector;
|
|
106
86
|
/**
|
|
107
|
-
* Kept so teardown can release it
|
|
108
|
-
*
|
|
109
|
-
* for as long as the surface lives. See `SymbioteRendererFactory.dispose`.
|
|
87
|
+
* Kept so teardown can release it, a `useValue` provider gives the injector nothing to destroy
|
|
88
|
+
* See `SymbioteRendererFactory.dispose`
|
|
110
89
|
*/
|
|
111
90
|
rendererFactory: SymbioteRendererFactory;
|
|
112
|
-
}
|
|
91
|
+
};
|
|
113
92
|
|
|
114
|
-
//
|
|
115
|
-
//
|
|
116
|
-
|
|
117
|
-
// `<ng-content>` in the wrapper's template is the Angular idiom for "render my children", the
|
|
118
|
-
// direct twin of React's `createElement(Wrapper, null, rootElement)`.
|
|
119
|
-
export interface IMountOptions {
|
|
93
|
+
// `wrapperComponentProvider` support: the root renders detached and the wrapper, attached to the
|
|
94
|
+
// surface, receives its host as projected content through `<ng-content>`
|
|
95
|
+
export type IMountOptions = {
|
|
120
96
|
initialProps?: object;
|
|
121
97
|
wrapperComponent?: Type<unknown>;
|
|
122
|
-
}
|
|
98
|
+
};
|
|
123
99
|
|
|
124
100
|
// App-level providers (`provideHttpClient()` and the like), set once at bootstrap
|
|
125
101
|
let rootProviders: (Provider | EnvironmentProviders)[] = [];
|
|
@@ -158,14 +134,9 @@ function teardown(rootTag: IRootTag): void {
|
|
|
158
134
|
disposeRoot(rootTag);
|
|
159
135
|
}
|
|
160
136
|
|
|
161
|
-
// Metro's build switch, and esbuild's in this repo's headless runner
|
|
162
|
-
// an ambient `globals.d.ts
|
|
163
|
-
//
|
|
164
|
-
// reaches — seven of them went red with `Cannot find name '__DEV__'`, reported as an empty
|
|
165
|
-
// diagnostic set, which reads as "the template checker found nothing" and is not that.
|
|
166
|
-
//
|
|
167
|
-
// `declare const` emits no JavaScript, so it shadows nothing at runtime and both bundlers still
|
|
168
|
-
// substitute the identifier.
|
|
137
|
+
// Metro's build switch, and esbuild's in this repo's headless runner
|
|
138
|
+
// Declared here, not in an ambient `globals.d.ts`: the AOT tests build their own ngtsc programs
|
|
139
|
+
// from an explicit file list that never reaches an ambient declaration
|
|
169
140
|
declare const __DEV__: boolean;
|
|
170
141
|
|
|
171
142
|
/**
|
|
@@ -202,6 +173,7 @@ function settleAngularDevMode(): void {
|
|
|
202
173
|
|
|
203
174
|
// Kept apart from `mount` so the provider list reads as one block
|
|
204
175
|
function createRootInjector(
|
|
176
|
+
rootTag: IRootTag,
|
|
205
177
|
surface: SymbioteSurface,
|
|
206
178
|
rendererFactory: SymbioteRendererFactory,
|
|
207
179
|
): EnvironmentInjector {
|
|
@@ -209,6 +181,7 @@ function createRootInjector(
|
|
|
209
181
|
[
|
|
210
182
|
...rootProviders,
|
|
211
183
|
{ provide: RendererFactory2, useValue: rendererFactory },
|
|
184
|
+
{ provide: ROOT_TAG, useValue: rootTag },
|
|
212
185
|
// `resource()` resolves TransferState, which calls `doc.getElementById`
|
|
213
186
|
// a stub without it throws mid-construction and the whole screen renders nothing
|
|
214
187
|
{
|
|
@@ -232,10 +205,10 @@ function createRootInjector(
|
|
|
232
205
|
);
|
|
233
206
|
}
|
|
234
207
|
|
|
235
|
-
|
|
208
|
+
type IRoots = {
|
|
236
209
|
cmpRef: ComponentRef<unknown>;
|
|
237
210
|
rootRef: ComponentRef<unknown> | undefined;
|
|
238
|
-
}
|
|
211
|
+
};
|
|
239
212
|
|
|
240
213
|
function createRoots(
|
|
241
214
|
injector: EnvironmentInjector,
|
|
@@ -279,7 +252,7 @@ export function mount(
|
|
|
279
252
|
|
|
280
253
|
const surface = createSurface(rootTag);
|
|
281
254
|
const rendererFactory = new SymbioteRendererFactory(surface);
|
|
282
|
-
const injector = createRootInjector(surface, rendererFactory);
|
|
255
|
+
const injector = createRootInjector(rootTag, surface, rendererFactory);
|
|
283
256
|
const { cmpRef, rootRef } = createRoots(
|
|
284
257
|
injector,
|
|
285
258
|
surface,
|
package/src/root-tag.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// RN's `RootTagContext` for Angular: `mount` provides the surface tag, 0 outside any surface
|
|
2
|
+
|
|
3
|
+
import { InjectionToken, inject } from '@angular/core';
|
|
4
|
+
import type { IRootTag } from '@symbiote-native/engine';
|
|
5
|
+
|
|
6
|
+
const NO_SURFACE = 0;
|
|
7
|
+
|
|
8
|
+
export const ROOT_TAG = new InjectionToken<IRootTag>('symbiote.rootTag', {
|
|
9
|
+
factory: () => NO_SURFACE,
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export function injectRootTag(): IRootTag {
|
|
13
|
+
return inject(ROOT_TAG);
|
|
14
|
+
}
|