Skip to content

refactor(core): zero circulars + esm ready #10770

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 66 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
48b02ff
chore: TypeScript 5.8, nx migrate, dep updates - bundler resolution
NathanWalker Jul 5, 2025
4039e2c
chore: use esm with hooks
NathanWalker Jul 6, 2025
0fe6055
chore: define __metadata for bundlers
NathanWalker Jul 6, 2025
84f5f19
refactor: circular deps part 1
NathanWalker Jul 6, 2025
7f726e9
feat: use module type on core package + hook v3
NathanWalker Jul 6, 2025
01acf2c
chore: use sass-loader in devDeps to satisfy automated tests
NathanWalker Jul 8, 2025
5796cd9
fix: test imports
NathanWalker Jul 8, 2025
2fba017
feat: support esm hooks
NathanWalker Jul 8, 2025
47c7208
refactor: circular deps part 2
NathanWalker Jul 8, 2025
1fdc933
refactor: circular deps part 3
NathanWalker Jul 8, 2025
4285a33
refactor: circular deps part 4
NathanWalker Jul 8, 2025
6ede07a
chore: cleanup
NathanWalker Jul 8, 2025
b70aa2c
refactor: circular deps part 5
NathanWalker Jul 8, 2025
18e75b6
refactor: circular deps part 6
NathanWalker Jul 8, 2025
779def7
refactor: circular deps part 7
NathanWalker Jul 9, 2025
50cfd6f
refactor: circular deps part 8
NathanWalker Jul 9, 2025
d8681cb
refactor: circular deps part 9
NathanWalker Jul 9, 2025
1db6259
refactor: circular deps part 10
NathanWalker Jul 9, 2025
33d967b
refactor: circular deps part 11
NathanWalker Jul 9, 2025
ee03774
refactor: circular deps part 12
NathanWalker Jul 9, 2025
579a25d
refactor: circular deps part 13
NathanWalker Jul 10, 2025
cb9ddde
fix: e2e test that should have never passed in first place
NathanWalker Jul 10, 2025
be6a908
chore: cleanup
NathanWalker Jul 10, 2025
cebc784
feat(webpack): enable esm modules as default
NathanWalker Jul 10, 2025
e7ab426
refactor: circular deps part 14
NathanWalker Jul 10, 2025
35fef40
refactor: circular deps part 15
NathanWalker Jul 11, 2025
300af8f
feat(core): allow .mjs files in dist package
NathanWalker Jul 11, 2025
2d5d62b
chore: cleanup vitest setup
NathanWalker Jul 11, 2025
a6279e2
Merge remote-tracking branch 'origin/main' into refactor/circular-dep…
NathanWalker Jul 11, 2025
32df462
fix: remove invalid .d.ts files
NathanWalker Jul 14, 2025
f1a5d3b
fix: imports
NathanWalker Jul 14, 2025
445a48d
fix: retain comments
NathanWalker Jul 14, 2025
4218cb8
fix: file extension handling for fonts
NathanWalker Jul 14, 2025
d9aa930
chore: cleanup
NathanWalker Jul 14, 2025
49413e5
chore: base webpack with ability to switch between esm to commonjs as…
NathanWalker Jul 14, 2025
4fe0003
chore: tmp comments to verify loading order - cleanup after confirmed
NathanWalker Jul 14, 2025
88c952d
chore: testing local alpha bumps only, reset when ready
NathanWalker Jul 14, 2025
e023042
Merge remote-tracking branch 'origin/main' into refactor/circular-dep…
NathanWalker Jul 14, 2025
b2cfc80
cleanup
NathanWalker Jul 14, 2025
7bc5721
chore: cleanup
NathanWalker Jul 15, 2025
2fb70c1
chore: cleanup android refs
NathanWalker Jul 15, 2025
248a85f
chore: cleanup
NathanWalker Jul 19, 2025
3f88953
chore: use esm runtimes for testing
NathanWalker Jul 22, 2025
b4579d1
chore: global handling
NathanWalker Jul 22, 2025
0ba0ab0
chore: working with builder xml require vs dynamic import wip
NathanWalker Jul 22, 2025
b853447
chore: cleanup
NathanWalker Jul 23, 2025
b79801a
chore: cleanup
NathanWalker Jul 23, 2025
17ac48f
chore: cleanup
NathanWalker Jul 23, 2025
f4a1326
chore: 9.0.0-alpha.7
NathanWalker Jul 23, 2025
ac65c0b
chore(webpack): 5.1.0-esm.3
NathanWalker Jul 23, 2025
41f041e
chore: note on conditional virtual entry if needed
NathanWalker Jul 23, 2025
3c1995c
chore: cleanup
NathanWalker Jul 25, 2025
5aeaac7
Merge remote-tracking branch 'origin/main' into refactor/circular-deps
NathanWalker Jul 25, 2025
03dae26
feat(webpack): auto enable commonjs when a project is on core < 9
NathanWalker Jul 25, 2025
b548ac3
chore(webpack): 5.1.0-esm.4
NathanWalker Jul 25, 2025
b9b234d
chore: cleanup
NathanWalker Jul 25, 2025
99c151c
chore: 9.0.0-alpha.8
NathanWalker Jul 26, 2025
4f8f841
fix(core): pin source-map due to minor bump using url
NathanWalker Jul 26, 2025
5667e08
chore: sync changelog with release/8.9.x branch
NathanWalker Jul 26, 2025
a9e5a22
chore(deps): bump postcss and vue-loader in /packages/webpack5 (#10772)
dependabot[bot] Jul 27, 2025
f1e2df6
chore: security clearances (#10773)
NathanWalker Jul 27, 2025
9ae0bf3
chore: vitest 3.2.4
NathanWalker Jul 27, 2025
ee6927b
chore: cleanup
NathanWalker Jul 27, 2025
3b15117
feat(webpack): auto enable commonjs on core < 9 + consider prereleases
NathanWalker Jul 27, 2025
61663d1
chore(webpack): 5.1.0-esm.5
NathanWalker Jul 27, 2025
2c669da
Merge remote-tracking branch 'origin/main' into refactor/circular-deps
NathanWalker Jul 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions apps/automated/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
!webpack.config.js
hooks
2 changes: 1 addition & 1 deletion apps/automated/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"devDependencies": {
"@nativescript/android": "~8.9.0",
"@nativescript/ios": "~8.9.0",
"@nativescript/ios": "esm",
"@nativescript/visionos": "~8.9.0",
"@nativescript/webpack": "file:../../dist/packages/webpack5",
"circular-dependency-plugin": "^5.2.2",
Expand Down
7 changes: 6 additions & 1 deletion apps/automated/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@
"forDevice": false,
"prepare": false
},
"configurations": {},
"defaultConfiguration": "main",
"configurations": {
"main": {
"flags": "--env.commonjs"
}
},
"dependsOn": ["^build"]
},
"prepare": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"eventType":"StartElement","position":{"line":2,"column":1},"elementName":"DocumentElement","attributes":{"param":"value"}}{"eventType":"StartElement","position":{"line":3,"column":3},"elementName":"First.Element","attributes":{"some.attr":"some.value"}}{"eventType":"Text","position":{"line":3,"column":41},"data":"\n ¶ Some Text ®\n "}{"eventType":"EndElement","position":{"line":5,"column":3},"elementName":"First.Element"}{"eventType":"StartElement","position":{"line":7,"column":3},"elementName":"SecondElement","attributes":{"param2":"something"}}{"eventType":"Text","position":{"line":7,"column":37},"data":"\n Pre-Text "}{"eventType":"StartElement","position":{"line":8,"column":14},"elementName":"Inline"}{"eventType":"Text","position":{"line":8,"column":22},"data":"Inlined text"}{"eventType":"EndElement","position":{"line":8,"column":34},"elementName":"Inline"}{"eventType":"Text","position":{"line":8,"column":43},"data":" Post-text.\n "}{"eventType":"EndElement","position":{"line":9,"column":3},"elementName":"SecondElement"}{"eventType":"StartElement","position":{"line":10,"column":3},"elementName":"entities"}{"eventType":"Text","position":{"line":10,"column":13},"data":"Xml tags begin with \"<\" and end with \">\" Ampersand is & and apostrophe is '"}{"eventType":"EndElement","position":{"line":10,"column":123},"elementName":"entities"}{"eventType":"StartElement","position":{"line":11,"column":3},"elementName":"script"}{"eventType":"CDATA","position":{"line":12,"column":5},"data":"\nfunction sum(a,b)\n{\n return a+b;\n}\n"}{"eventType":"EndElement","position":{"line":18,"column":3},"elementName":"script"}{"eventType":"Comment","position":{"line":19,"column":3},"data":"\n Hello,\n I am a multi-line XML comment.\n"}{"eventType":"EndElement","position":{"line":23,"column":1},"elementName":"DocumentElement"}
{"eventType":"StartElement","position":{"line":2,"column":1},"elementName":"DocumentElement","attributes":{"param":"value"}}{"eventType":"StartElement","position":{"line":3,"column":3},"elementName":"First.Element","attributes":{"some.attr":"some.value"}}{"eventType":"Text","position":{"line":3,"column":41},"data":"\n ¶ Some Text ®\n "}{"eventType":"EndElement","position":{"line":5,"column":3},"elementName":"First.Element"}{"eventType":"StartElement","position":{"line":7,"column":3},"elementName":"SecondElement","attributes":{"param2":"something"}}{"eventType":"Text","position":{"line":7,"column":37},"data":"\n Pre-Text "}{"eventType":"StartElement","position":{"line":8,"column":14},"elementName":"Inline"}{"eventType":"Text","position":{"line":8,"column":22},"data":"Inlined text"}{"eventType":"EndElement","position":{"line":8,"column":34},"elementName":"Inline"}{"eventType":"Text","position":{"line":8,"column":43},"data":" Post-text.\n "}{"eventType":"EndElement","position":{"line":9,"column":3},"elementName":"SecondElement"}{"eventType":"StartElement","position":{"line":10,"column":3},"elementName":"entities"}{"eventType":"Text","position":{"line":10,"column":13},"data":"Xml tags begin with \"<\" and end with \">\" Ampersand is & and apostrophe is '"}{"eventType":"EndElement","position":{"line":10,"column":123},"elementName":"entities"}{"eventType":"StartElement","position":{"line":11,"column":3},"elementName":"script"}{"eventType":"CDATA","position":{"line":12,"column":5},"data":"\nfunction sum(a,b)\n{\n return a+b;\n}\n"}{"eventType":"EndElement","position":{"line":18,"column":3},"elementName":"script"}{"eventType":"Comment","position":{"line":19,"column":3},"data":"\n Hello,\n I am a multi-line XML comment.\n"}{"eventType":"EndElement","position":{"line":23,"column":1},"elementName":"DocumentElement"}
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ function sum(a,b)
Hello,
I am a multi-line XML comment.
-->
</DocumentElement>
</DocumentElement>
10 changes: 2 additions & 8 deletions apps/automated/src/debugger/dom-node-tests.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
import { assert, assertEqual } from '../tk-unit';
import { DOMNode } from '@nativescript/core/debugger/dom-node';
import { DOMNode } from '@nativescript/core/debugger/dom-types';
import { attachDOMInspectorCommandCallbacks, attachCSSInspectorCommandCallbacks, attachDOMInspectorEventCallbacks } from '@nativescript/core/debugger/devtools-elements';
import { InspectorCommands, InspectorEvents } from '@nativescript/core/debugger/devtools-elements';
import { unsetValue } from '@nativescript/core/ui/core/properties';
import { Button } from '@nativescript/core/ui/button';
import { Slider } from '@nativescript/core/ui/slider';
import { Label } from '@nativescript/core/ui/label';
import { unsetValue, Button, Slider, Label, TextView, StackLayout, isAndroid } from '@nativescript/core';
import { textProperty } from '@nativescript/core/ui/text-base';
import { TextView } from '@nativescript/core/ui/text-view';
import { StackLayout } from '@nativescript/core/ui/layouts/stack-layout';
import { isAndroid } from '@nativescript/core/platform';

let originalInspectorGlobal: InspectorCommands & InspectorEvents;

Expand Down
38 changes: 19 additions & 19 deletions apps/automated/src/file-system/file-system-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,15 @@ export var testFileRead = function () {
// << file-system-example-text
};

export var testFileReadWriteBinary = function () {
export function testFileReadWriteBinary() {
// >> file-system-read-binary
var fileName = 'logo.png';
var error;
const fileName = 'logo.png';
let error;
const appFolder = fs.knownFolders.currentApp().path;
const sourceFile = fs.File.fromPath(appFolder + '/assets/' + fileName);
const destinationFile = fs.knownFolders.documents().getFile(fileName);

var sourceFile = fs.File.fromPath(__dirname + '/assets/' + fileName);
var destinationFile = fs.knownFolders.documents().getFile(fileName);

var source = sourceFile.readSync((e) => {
const source = sourceFile.readSync((e) => {
error = e;
});

Expand All @@ -203,7 +203,7 @@ export var testFileReadWriteBinary = function () {
});

// >> (hide)
var destination = destinationFile.readSync((e) => {
const destination = destinationFile.readSync((e) => {
error = e;
});
TKUnit.assertNull(error);
Expand All @@ -216,14 +216,14 @@ export var testFileReadWriteBinary = function () {
destinationFile.removeSync();
// << (hide)
// << file-system-read-binary
};
}

export var testFileReadWriteBinaryAsync = function () {
export function testFileReadWriteBinaryAsync() {
// >> file-system-read-binary-async
var fileName = 'logo.png';

var sourceFile = fs.File.fromPath(__dirname + '/assets/' + fileName);
var destinationFile = fs.knownFolders.documents().getFile(fileName);
const fileName = 'logo.png';
const appFolder = fs.knownFolders.currentApp().path;
const sourceFile = fs.File.fromPath(appFolder + '/assets/' + fileName);
const destinationFile = fs.knownFolders.documents().getFile(fileName);

// Read the file
sourceFile.read().then(
Expand Down Expand Up @@ -263,7 +263,7 @@ export var testFileReadWriteBinaryAsync = function () {
},
);
// << file-system-read-binary-async
};
}

export var testGetKnownFolders = function () {
// >> file-system-known-folders
Expand Down Expand Up @@ -425,11 +425,11 @@ export var testFileNameExtension = function () {
var file = documents.getFile('Test.txt');
// Getting the file name "Test.txt".
var fileName = file.name;
// Getting the file extension ".txt".
// Getting the file extension "txt".
var fileExtension = file.extension;
// >> (hide)
TKUnit.assert(fileName === 'Test.txt', 'Wrong file name.');
TKUnit.assert(fileExtension === '.txt', 'Wrong extension.');
TKUnit.assert(fileExtension === 'txt', 'Wrong extension.');
file.remove();
// << (hide)
// << file-system-extension
Expand Down Expand Up @@ -633,7 +633,7 @@ export function test_FSEntity_Properties() {
var documents = fs.knownFolders.documents();
var file = documents.getFile('Test_File.txt');

TKUnit.assert(file.extension === '.txt', 'FileEntity.extension not working.');
TKUnit.assert(file.extension === 'txt', 'FileEntity.extension not working.');
TKUnit.assert(file.isLocked === false, 'FileEntity.isLocked not working.');
TKUnit.assert(file.lastModified instanceof Date, 'FileEntity.lastModified not working.');
TKUnit.assert(file.size === 0, 'FileEntity.size not working.');
Expand Down Expand Up @@ -746,7 +746,7 @@ export function testAndroidCreate() {

export function test_FileAppend(done) {
const content = 'Hello World';
const hello_world = global.isIOS ? NSString.stringWithString(content).dataUsingEncoding(NSUTF8StringEncoding) : new java.lang.String(content).getBytes('UTF-8');
const hello_world = __APPLE__ ? NSString.stringWithString(content).dataUsingEncoding(NSUTF8StringEncoding) : new java.lang.String(content).getBytes('UTF-8');
const file = fs.File.fromPath(fs.path.join(fs.knownFolders.temp().path, `${Date.now()}-app.txt`));
file
.appendText('Hello')
Expand Down
4 changes: 2 additions & 2 deletions apps/automated/src/globals/globals-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export function test_global_registerModule() {
TKUnit.assert(typeof global.registerModule === 'function', 'global.registerModule not a function');
}

export function test_global_registerWebpackModules() {
TKUnit.assert(typeof global.registerWebpackModules === 'function', 'global.registerWebpackModules not a function');
export function test_global_registerBundlerModules() {
TKUnit.assert(typeof global.registerBundlerModules === 'function', 'global.registerBundlerModules not a function');
}

export function test_global_loadModule() {
Expand Down
5 changes: 2 additions & 3 deletions apps/automated/src/navigation/custom-transition.ios.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { PageTransition, SharedTransition, SharedTransitionAnimationType, SharedTransitionHelper, Transition, Utils } from '@nativescript/core';
import { CORE_ANIMATION_DEFAULTS } from '@nativescript/core/utils';

export class CustomTransition extends Transition {
constructor(duration: number, curve: any) {
Expand Down Expand Up @@ -32,7 +31,7 @@ export class CustomTransition extends Transition {
},
(finished) => {
transitionContext.completeTransition(finished);
}
},
);
}
}
Expand Down Expand Up @@ -90,7 +89,7 @@ class PageTransitionController extends NSObject implements UIViewControllerAnima
}
}
}
return CORE_ANIMATION_DEFAULTS.duration;
return Utils.CORE_ANIMATION_DEFAULTS.duration;
}

animateTransition(transitionContext: UIViewControllerContextTransitioning): void {
Expand Down
8 changes: 4 additions & 4 deletions apps/automated/src/pages/property-bindings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Trace } from '@nativescript/core';
import * as gridModule from '@nativescript/core/ui/layouts/grid-layout';
import * as sliders from '@nativescript/core/ui/slider';
import * as switches from '@nativescript/core/ui/switch';
import * as bindable from '@nativescript/core/ui/core/bindable';
import type { BindingOptions } from '@nativescript/core/ui/core/bindable/bindable-types';

Trace.enable();
//Trace.setCategories(Trace.categories.Style + " ," + Trace.categories.Binding);
Expand Down Expand Up @@ -64,7 +64,7 @@ export function createPage() {
slider.value = desc.value;
stack.addChild(slider);

var options: bindable.BindingOptions = {
var options: BindingOptions = {
sourceProperty: 'value',
targetProperty: desc.name,
};
Expand All @@ -82,7 +82,7 @@ export function createPage() {
sw.horizontalAlignment = 'left';
stack.addChild(sw);

var options: bindable.BindingOptions = {
var options: BindingOptions = {
sourceProperty: 'checked',
targetProperty: desc.name,
};
Expand All @@ -99,7 +99,7 @@ export function createPage() {
txt.text = desc.value;
stack.addChild(txt);

var options: bindable.BindingOptions = {
var options: BindingOptions = {
sourceProperty: 'text',
targetProperty: desc.name,
};
Expand Down
4 changes: 2 additions & 2 deletions apps/automated/src/test-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import * as TKUnit from './tk-unit';
import './ui-test';

import { isIOS, isAndroid, Application, Device, platformNames, Trace, Button, Frame, StackLayout, Page, TextView, Utils, Color } from '@nativescript/core';
import { isAndroid, Device, platformNames, Trace, Button, Frame, StackLayout, Page, TextView, Utils, Color } from '@nativescript/core';
Frame.defaultAnimatedNavigation = false;

export function isRunningOnEmulator(): boolean {
Expand Down Expand Up @@ -147,7 +147,7 @@ import * as scrollViewSafeAreaTests from './ui/scroll-view/scroll-view-safe-area
import * as repeaterSafeAreaTests from './ui/repeater/repeater-safe-area-tests';
import * as webViewSafeAreaTests from './ui/web-view/web-view-safe-area-tests';

if (isIOS && Utils.ios.MajorVersion > 10) {
if (__APPLE__ && Utils.SDK_VERSION > 10) {
allTests['SAFEAREALAYOUT'] = safeAreaLayoutTests;
allTests['SAFEAREA-LISTVIEW'] = safeAreaListViewtTests;
allTests['SAFEAREA-SCROLL-VIEW'] = scrollViewSafeAreaTests;
Expand Down
13 changes: 6 additions & 7 deletions apps/automated/src/tk-unit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@

*/

import { isIOS, Trace, Device } from '@nativescript/core';
import * as types from '@nativescript/core/utils/types';
import { Trace, Device, Utils } from '@nativescript/core';

const sdkVersion = parseInt(Device.sdkVersion);

Expand Down Expand Up @@ -172,10 +171,10 @@ export function assertFalse(test: boolean, message?: string) {

export function assertNotEqual(actual: any, expected: any, message?: string) {
let equals = false;
if (types.isUndefined(actual) && types.isUndefined(expected)) {
if (Utils.isUndefined(actual) && Utils.isUndefined(expected)) {
equals = true;
} else if (!types.isNullOrUndefined(actual) && !types.isNullOrUndefined(expected)) {
if (types.isFunction(actual.equals)) {
} else if (!Utils.isNullOrUndefined(actual) && !Utils.isNullOrUndefined(expected)) {
if (Utils.isFunction(actual.equals)) {
// Use the equals method
if (actual.equals(expected)) {
equals = true;
Expand All @@ -191,7 +190,7 @@ export function assertNotEqual(actual: any, expected: any, message?: string) {
}

export function assertEqual<T extends { equals?(arg: T): boolean } | any>(actual: T, expected: T, message: string = '') {
if (!types.isNullOrUndefined(actual) && !types.isNullOrUndefined(expected) && types.getClass(actual) === types.getClass(expected) && types.isFunction((<any>actual).equals)) {
if (!Utils.isNullOrUndefined(actual) && !Utils.isNullOrUndefined(expected) && Utils.getClass(actual) === Utils.getClass(expected) && Utils.isFunction((<any>actual).equals)) {
// Use the equals method
if (!(<any>actual).equals(expected)) {
throw new Error(`${message} Actual: <${actual}>(${typeof actual}). Expected: <${expected}>(${typeof expected})`);
Expand Down Expand Up @@ -352,7 +351,7 @@ export function waitUntilReady(isReady: () => boolean, timeoutSec: number = 5, s
return;
}

if (isIOS) {
if (__APPLE__) {
const timeoutMs = timeoutSec * 1000;
let totalWaitTime = 0;
while (true) {
Expand Down
6 changes: 3 additions & 3 deletions apps/automated/src/ui-helper.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Color, Button, FormattedString, Span, ActionBar, Builder, isIOS, unsetValue, View, ViewBase, Frame, NavigationEntry, LayoutBase, StackLayout, Page, TabView, TabViewItem, Utils } from '@nativescript/core';
import { Color, Button, FormattedString, Span, ActionBar, Builder, unsetValue, View, ViewBase, Frame, NavigationEntry, LayoutBase, StackLayout, Page, TabView, TabViewItem, Utils } from '@nativescript/core';

import * as TKUnit from './tk-unit';

Expand Down Expand Up @@ -255,7 +255,7 @@ export function assertTabSelectedTabTextColor(testView: ViewBase, hexColor: stri
}

export function forceGC() {
if (isIOS) {
if (__APPLE__) {
/* tslint:disable:no-unused-expression */
// Could cause GC on the next call.
new ArrayBuffer(4 * 1024 * 1024);
Expand Down Expand Up @@ -295,7 +295,7 @@ export function _generateFormattedString(): FormattedString {
export function nativeView_recycling_test(createNew: () => View, createLayout?: () => LayoutBase, nativeGetters?: Map<string, (view) => any>, customSetters?: Map<string, any>) {
return;

// if (isIOS) {
// if (__APPLE__) {
// // recycling not implemented yet.
// return;
// }
Expand Down
30 changes: 10 additions & 20 deletions apps/automated/src/ui/action-bar/action-bar-tests-common.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
import * as TKUnit from '../../tk-unit';
import * as helper from '../../ui-helper';
import { Builder } from '@nativescript/core/ui/builder';
import { Label } from '@nativescript/core/ui/label';
import { Button } from '@nativescript/core/ui/button';
import { Page } from '@nativescript/core/ui/page';
import { View, isIOS } from '@nativescript/core';
import { fromObject } from '@nativescript/core/data/observable';
import { Frame } from '@nativescript/core/ui/frame';

// >> actionbar-common-require
import * as actionBarModule from '@nativescript/core/ui/action-bar';
// << actionbar-common-require
import { View, fromObject, Frame, Page, Button, Label, Builder, ActionItem, ActionBar } from '@nativescript/core';

export function test_actionItem_inherit_bindingContext() {
let page: Page;
Expand All @@ -20,7 +10,7 @@ export function test_actionItem_inherit_bindingContext() {
const pageFactory = function (): Page {
page = new Page();
page.bindingContext = context;
const actionItem = new actionBarModule.ActionItem();
const actionItem = new ActionItem();

actionItem.bind({
sourceProperty: 'text',
Expand Down Expand Up @@ -164,7 +154,7 @@ export function test_Setting_ActionItems_doesnt_thrown() {

const pageFactory = function (): Page {
page = new Page();
const actionItem = new actionBarModule.ActionItem();
const actionItem = new ActionItem();
actionItem.text = 'Item';
page.actionBar.actionItems.addItem(actionItem);

Expand Down Expand Up @@ -286,12 +276,12 @@ export function test_ActionBarVisibility_Never_ShouldNotShowDeclaredActionBar()
</ActionBar.titleView>
</ActionBar>
</Page>
`
`,
);

helper.navigate(() => page);
let actionBarHidden = false;
if (isIOS) {
if (__APPLE__) {
actionBarHidden = page.actionBar.nativeView.hidden;
} else {
actionBarHidden = !page.actionBar.nativeView.isShown();
Expand All @@ -314,12 +304,12 @@ export function test_ActionBarVisibility_Always_ShouldShownHiddenActionBar() {
</ActionBar.titleView>
</ActionBar>
</Page>
`
`,
);

helper.navigate(() => page);
let actionBarHidden = false;
if (isIOS) {
if (__APPLE__) {
actionBarHidden = page.actionBar.nativeView.hidden;
} else {
actionBarHidden = !page.actionBar.nativeView.isShown();
Expand All @@ -342,12 +332,12 @@ export function test_ActionBarVisibility_Auto_ShouldRespectPageActionBarHiddenPr
</ActionBar.titleView>
</ActionBar>
</Page>
`
`,
);

helper.navigate(() => page);
let actionBarHidden = false;
if (isIOS) {
if (__APPLE__) {
actionBarHidden = page.actionBar.nativeView.hidden;
} else {
actionBarHidden = !page.actionBar.nativeView.isShown();
Expand Down Expand Up @@ -391,5 +381,5 @@ export function createPageAndNavigate() {
}

export function test_recycling() {
helper.nativeView_recycling_test(() => new actionBarModule.ActionBar());
helper.nativeView_recycling_test(() => new ActionBar());
}
Loading
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy