Skip to content

Commit 62d9fb5

Browse files
authored
feat: Angular 20 (#151)
1 parent 0ec2721 commit 62d9fb5

32 files changed

+31199
-13105
lines changed

.eslintrc.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,13 @@
1212
"files": ["*.ts", "*.tsx"],
1313
"extends": ["plugin:@nx/typescript"],
1414
"rules": {
15-
"@typescript-eslint/no-inferrable-types": "off",
16-
"@typescript-eslint/no-extra-semi": "error",
17-
"no-extra-semi": "off"
15+
"@typescript-eslint/no-inferrable-types": "off"
1816
}
1917
},
2018
{
2119
"files": ["*.js", "*.jsx"],
2220
"extends": ["plugin:@nx/javascript"],
23-
"rules": {
24-
"@typescript-eslint/no-extra-semi": "error",
25-
"no-extra-semi": "off"
26-
}
21+
"rules": {}
2722
}
2823
]
2924
}

.github/workflows/build.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,8 @@ jobs:
2323
- uses: actions/setup-node@v3
2424
with:
2525
node-version: lts/*
26-
cache: 'yarn'
2726
- uses: nrwl/nx-set-shas@v3
28-
- name: Setup global dependencies
29-
run: npm i -g yarn
30-
- name: yarn install
31-
run: yarn
27+
- name: npm install
28+
run: npm install --legacy-peer-deps
3229
- name: Build.all affected
33-
run: yarn nx affected --target=build --exclude nativescript-demo-ng
30+
run: npx nx affected --target=build --exclude nativescript-demo-ng

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
# dependencies
99
/node_modules
1010
/packages/*/node_modules
11-
package-lock.json
1211
.npmrc
12+
yarn.lock
1313

1414
# IDEs and editors
1515
/.idea
@@ -48,4 +48,6 @@ Thumbs.db
4848
/.env
4949

5050
.nx/cache
51-
.nx/workspace-data
51+
.nx/workspace-data
52+
.cursor/rules/nx-rules.mdc
53+
.github/instructions/nx.instructions.md

.husky/pre-commit

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
41
npx lint-staged --allow-empty --relative

DevelopmentWorkflow.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ $ cd angular
3333

3434
```
3535
$ cd angular
36-
$ yarn clean.all
36+
$ npm run clean.all
3737
```
3838

3939
### Run some of the e2e applications e.g. router-tab-view
@@ -43,7 +43,7 @@ $ yarn clean.all
4343
Install NPM packages (use the local copy of `@nativescript/angular`):
4444
```
4545
$ cd e2e/router-tab-view
46-
$ yarn install
46+
$ npm install
4747
```
4848

4949
Start the app:

apps/nativescript-demo-ng/App_Resources/Android/app.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
//}
77

88
android {
9+
namespace "org.nativescript.demong"
910
defaultConfig {
10-
minSdkVersion 17
11-
targetSdkVersion 29
11+
minSdkVersion 24
12+
targetSdkVersion 34
1213
generatedDensities = []
1314
applicationId = "org.nativescript.demong"
1415
manifestPlaceholders = [isUnitTesting:"${unitTesting}"]

apps/nativescript-demo-ng/App_Resources/Android/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
android:name="com.tns.NativeScriptActivity"
2727
android:label="@string/title_activity_kimera"
2828
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout|locale|uiMode"
29-
android:theme="@style/LaunchScreenTheme">
29+
android:theme="@style/LaunchScreenTheme"
30+
android:exported="true">
3031

3132
<meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="@style/AppTheme" />
3233

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,58 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
4-
<dict>
5-
<key>CFBundleDevelopmentRegion</key>
6-
<string>en</string>
7-
<key>CFBundleDisplayName</key>
8-
<string>${PRODUCT_NAME}</string>
9-
<key>CFBundleExecutable</key>
10-
<string>${EXECUTABLE_NAME}</string>
11-
<key>CFBundleInfoDictionaryVersion</key>
12-
<string>6.0</string>
13-
<key>CFBundleName</key>
14-
<string>${PRODUCT_NAME}</string>
15-
<key>CFBundlePackageType</key>
16-
<string>APPL</string>
17-
<key>CFBundleShortVersionString</key>
18-
<string>1.0</string>
19-
<key>CFBundleSignature</key>
20-
<string>????</string>
21-
<key>CFBundleVersion</key>
22-
<string>1.0</string>
23-
<key>LSRequiresIPhoneOS</key>
24-
<true/>
25-
<key>UILaunchStoryboardName</key>
26-
<string>LaunchScreen</string>
27-
<key>UIRequiresFullScreen</key>
28-
<true/>
29-
<key>UIRequiredDeviceCapabilities</key>
30-
<array>
31-
<string>armv7</string>
32-
</array>
33-
<key>UISupportedInterfaceOrientations</key>
34-
<array>
35-
<string>UIInterfaceOrientationPortrait</string>
36-
<string>UIInterfaceOrientationLandscapeLeft</string>
37-
<string>UIInterfaceOrientationLandscapeRight</string>
38-
</array>
39-
<key>UISupportedInterfaceOrientations~ipad</key>
40-
<array>
41-
<string>UIInterfaceOrientationPortrait</string>
42-
<string>UIInterfaceOrientationPortraitUpsideDown</string>
43-
<string>UIInterfaceOrientationLandscapeLeft</string>
44-
<string>UIInterfaceOrientationLandscapeRight</string>
45-
</array>
46-
<key>ITSAppUsesNonExemptEncryption</key>
47-
<false/>
48-
<key>NSAppTransportSecurity</key>
49-
<dict>
50-
<key>NSAllowsArbitraryLoads</key>
51-
<true/>
52-
<key>NSAllowsArbitraryLoadsForMedia</key>
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>en</string>
7+
<key>CFBundleDisplayName</key>
8+
<string>${PRODUCT_NAME}</string>
9+
<key>CFBundleExecutable</key>
10+
<string>${EXECUTABLE_NAME}</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>${PRODUCT_NAME}</string>
15+
<key>CFBundlePackageType</key>
16+
<string>APPL</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleSignature</key>
20+
<string>????</string>
21+
<key>CFBundleVersion</key>
22+
<string>1.0</string>
23+
<key>LSRequiresIPhoneOS</key>
5324
<true/>
54-
<key>NSAllowsArbitraryLoadsInWebContent</key>
25+
<key>UILaunchStoryboardName</key>
26+
<string>LaunchScreen</string>
27+
<key>UIRequiresFullScreen</key>
5528
<true/>
29+
<key>UIRequiredDeviceCapabilities</key>
30+
<array>
31+
<string>armv7</string>
32+
</array>
33+
<key>UISupportedInterfaceOrientations</key>
34+
<array>
35+
<string>UIInterfaceOrientationPortrait</string>
36+
<string>UIInterfaceOrientationLandscapeLeft</string>
37+
<string>UIInterfaceOrientationLandscapeRight</string>
38+
</array>
39+
<key>UISupportedInterfaceOrientations~ipad</key>
40+
<array>
41+
<string>UIInterfaceOrientationPortrait</string>
42+
<string>UIInterfaceOrientationPortraitUpsideDown</string>
43+
<string>UIInterfaceOrientationLandscapeLeft</string>
44+
<string>UIInterfaceOrientationLandscapeRight</string>
45+
</array>
46+
<key>ITSAppUsesNonExemptEncryption</key>
47+
<false/>
48+
<key>NSAppTransportSecurity</key>
49+
<dict>
50+
<key>NSAllowsArbitraryLoads</key>
51+
<true/>
52+
<key>NSAllowsArbitraryLoadsForMedia</key>
53+
<true/>
54+
<key>NSAllowsArbitraryLoadsInWebContent</key>
55+
<true/>
56+
</dict>
5657
</dict>
57-
</dict>
5858
</plist>

apps/nativescript-demo-ng/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
"@nativescript/core": "file:../../node_modules/@nativescript/core"
77
},
88
"devDependencies": {
9-
"@nativescript/android": "~8.8.0",
10-
"@nativescript/ios": "~8.8.0",
9+
"@nativescript/android": "~8.9.0",
10+
"@nativescript/ios": "~8.9.0",
1111
"@nativescript/tailwind": "^2.1.0",
1212
"@nativescript/unit-test-runner": "^3.0.1",
13-
"@nativescript/visionos": "8.8.1"
13+
"@nativescript/visionos": "~8.9.0"
1414
}
1515
}

apps/nativescript-demo-ng/src/app/item/items.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ import { ModalDialogService, NativeDialogService, NativeScriptCommonModule } fro
1212
templateUrl: './items.component.html',
1313
imports: [NativeScriptCommonModule],
1414
standalone: true,
15-
schemas: [NO_ERRORS_SCHEMA]
15+
schemas: [NO_ERRORS_SCHEMA],
1616
})
1717
export class ItemsComponent implements OnInit, OnDestroy {
18-
message = 'Hello Angular 19!';
18+
message = 'Hello Angular 20.0.0!';
1919
items: Array<Item>;
2020

2121
constructor(

apps/nativescript-demo-ng/src/app/item3/items.component.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,23 @@ import { HttpClient } from '@angular/common/http';
44
import { Item } from '../item/item';
55
import { ItemService } from '../item/item.service';
66
import { ModalComponent } from '../modal/modal.component';
7-
import { ModalDialogService, NativeDialogService, NativeScriptCommonModule, NativeScriptRouterModule } from '@nativescript/angular';
7+
import {
8+
ModalDialogService,
9+
NativeDialogService,
10+
NativeScriptCommonModule,
11+
NativeScriptRouterModule,
12+
} from '@nativescript/angular';
813

914
@Component({
1015
selector: 'ns-items',
1116
moduleId: module.id,
1217
templateUrl: './items.component.html',
1318
imports: [NativeScriptCommonModule, NativeScriptRouterModule],
1419
standalone: true,
15-
schemas: [NO_ERRORS_SCHEMA]
20+
schemas: [NO_ERRORS_SCHEMA],
1621
})
1722
export class ItemsComponent implements OnInit, OnDestroy {
18-
message = 'Hello Angular 19';
23+
message = 'Hello Angular 20.0.0';
1924
items: Array<Item>;
2025
borderRadius: number;
2126
fontSize: number;

apps/nativescript-demo-ng/src/app/modal/modal.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<GridLayout [backgroundColor]="'#d63681'" rows="*,auto,auto">
22
<!-- <Image [src]="logo" stretch="aspectFit" width="200" marginTop="50" /> -->
3-
<Image src="~/assets/ng-18.png" stretch="aspectFit" (loaded)="loadedImg($event)" class="w-full" />
3+
<Image src="~/assets/ng-20.png" stretch="aspectFit" (loaded)="loadedImg($event)" class="w-full" />
44

55
<!-- @if (this.itemService.currentFlavor + 1 !== this.itemService.flavors.length) {
66
<Button row="1" (tap)="openNewModal()" text="Taste Another" fontSize="20" borderRadius="25"></Button>
125 KB
Loading
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
import './polyfills';
2+
import '@nativescript/zone-js/dist/pre-zone-polyfills';
3+
4+
// Zone JS is required by default for Angular itself
5+
import 'zone.js';
6+
7+
// Add NativeScript specific Zone JS patches
8+
import '@nativescript/zone-js';
29
import 'zone.js/testing';
310
import { TestBed } from '@angular/core/testing';
411
import { platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
512
import { NativeScriptTestingModule } from '@nativescript/angular/testing';
613

7-
TestBed.initTestEnvironment(NativeScriptTestingModule, platformBrowserDynamicTesting(), { teardown: { destroyAfterEach: true } });
14+
TestBed.initTestEnvironment(NativeScriptTestingModule, platformBrowserDynamicTesting(), {
15+
teardown: { destroyAfterEach: true },
16+
});

apps/nativescript-demo-ng/src/main.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,23 @@ import { withInterceptorsFromDi } from '@angular/common/http';
1212
import { setWindowBackgroundColor } from '@nativescript/core/utils/ios';
1313
import { AppComponent } from './app/app.component';
1414
import { routes } from './app/app.routes';
15-
import { provideExperimentalZonelessChangeDetection } from '@angular/core';
15+
import { provideZonelessChangeDetection } from '@angular/core';
1616

17-
const EXPERIMENTAL_ZONELESS = true;
17+
const ZONELESS = true;
1818

1919
Trace.enable();
2020
Trace.setCategories('ns-route-reuse-strategy,ns-router');
2121

2222
runNativeScriptAngularApp({
2323
appModuleBootstrap: () => {
24-
if (global.isIOS) {
24+
if (__APPLE__) {
2525
setWindowBackgroundColor('#a6120d');
2626
}
2727
return bootstrapApplication(AppComponent, {
2828
providers: [
2929
provideNativeScriptHttpClient(withInterceptorsFromDi()),
3030
provideNativeScriptRouter(routes),
31-
EXPERIMENTAL_ZONELESS ? provideExperimentalZonelessChangeDetection() : provideNativeScriptNgZone(),
31+
ZONELESS ? provideZonelessChangeDetection() : provideNativeScriptNgZone(),
3232
],
3333
});
3434
},

apps/nativescript-demo-ng/src/polyfills.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
import '@nativescript/core/globals';
77
// Install @nativescript/angular specific polyfills
88
import '@nativescript/angular/polyfills';
9-
109
/**
1110
* Zone.js and patches
1211
*/
1312
// Add pre-zone.js patches needed for the NativeScript platform
14-
import '@nativescript/zone-js/dist/pre-zone-polyfills';
13+
// import '@nativescript/zone-js/dist/pre-zone-polyfills';
1514

16-
// Zone JS is required by default for Angular itself
17-
import 'zone.js';
15+
// Uncomment if using zone:
16+
// // Zone JS is required by default for Angular itself
17+
// import 'zone.js';
1818

19-
// Add NativeScript specific Zone JS patches
20-
import '@nativescript/zone-js';
19+
// // Add NativeScript specific Zone JS patches
20+
// import '@nativescript/zone-js';

jest.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
const { getJestProjects } = require('@nx/jest');
1+
const { getJestProjectsAsync } = require('@nx/jest');
22

3-
export default { projects: getJestProjects() };
3+
export default async () => ({ projects: await getJestProjectsAsync() });

0 commit comments

Comments
 (0)