Skip to content

Commit fb57cf3

Browse files
authored
feat: Node-API engine support (#10710)
1 parent 640db95 commit fb57cf3

File tree

6 files changed

+11
-10
lines changed

6 files changed

+11
-10
lines changed

packages/core/ui/gestures/index.android.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Definitions.
22
import { GestureEventData, TapGestureEventData, SwipeGestureEventData, PanGestureEventData, RotationGestureEventData, GestureEventDataWithState } from '.';
3-
import { View } from '../core/view';
3+
import type { View } from '../core/view';
44
import { EventData } from '../../data/observable';
55

66
// Types.

packages/core/ui/gestures/index.ios.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Definitions.
22

33
import { GestureEventData, TapGestureEventData, GestureEventDataWithState, SwipeGestureEventData, PanGestureEventData, RotationGestureEventData, PinchGestureEventData } from '.';
4-
import { View } from '../core/view';
4+
import type { View } from '../core/view';
55
import { EventData } from '../../data/observable';
66

77
// Types.

packages/core/ui/gestures/touch-manager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import { GestureEventData, GestureEventDataWithState, TouchGestureEventData } from '.';
66
import { Animation } from '../animation';
77
import { AnimationDefinition } from '../animation/animation-interfaces';
8-
import { View } from '../core/view';
8+
import type { View } from '../core/view';
99
import { isObject, isFunction } from '../../utils/types';
1010
import { GestureEvents, GestureStateTypes, GestureTypes } from './gestures-common';
1111

@@ -169,7 +169,7 @@ export class TouchManager {
169169
}
170170
}
171171

172-
view.on(View.disposeNativeViewEvent, (args) => {
172+
view.on('disposeNativeView', (args) => {
173173
const index = TouchManager.touchHandlers?.findIndex((handler) => handler.view === args.object);
174174
if (index > -1) {
175175
TouchManager.touchHandlers.splice(index, 1);

packages/core/ui/styling/style/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class Style extends Observable implements StyleDefinition {
4343
super();
4444

4545
// HACK: Could not find better way for cross platform WeakRef type checking.
46-
if (ownerView.constructor.toString().indexOf('[native code]') !== -1) {
46+
if (ownerView.constructor.toString().indexOf('[native code]') !== -1 || ownerView.toString() == '[object WeakRef]') {
4747
this.viewRef = <WeakRef<ViewBase>>ownerView;
4848
} else {
4949
this.viewRef = new WeakRef(<ViewBase>ownerView);

packages/webpack5/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/webpack5/src/loaders/nativescript-hot-loader/hmr.runtime.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,15 @@ if (module.hot) {
5959
},
6060
};
6161

62-
const checkAndApply = async () => {
62+
// Important: Keep as function and not fat arrow; at the moment hermes does not support them
63+
const checkAndApply = async function () {
6364
hash = __webpack_require__.h();
6465
const modules = await module.hot.check().catch((error) => {
6566
return setStatus(
6667
hash,
6768
'failure',
6869
'Failed to check.',
69-
error.message || error.stack
70+
error.message || error.stack,
7071
);
7172
});
7273

@@ -82,7 +83,7 @@ if (module.hot) {
8283
hash,
8384
'failure',
8485
'Failed to apply.',
85-
error.message || error.stack
86+
error.message || error.stack,
8687
);
8788
});
8889

0 commit comments

Comments
 (0)