Skip to content

feat: Angular 20 #151

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

Merged
merged 16 commits into from
Jun 1, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: Angular 20 rc
  • Loading branch information
NathanWalker committed May 20, 2025
commit 501c8cd2847f51629bcdd8ee53dd6eb7b862df8c
6 changes: 3 additions & 3 deletions apps/nativescript-demo-ng/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"@nativescript/core": "file:../../node_modules/@nativescript/core"
},
"devDependencies": {
"@nativescript/android": "~8.8.0",
"@nativescript/ios": "~8.8.0",
"@nativescript/android": "~8.9.0",
"@nativescript/ios": "~8.9.0",
"@nativescript/tailwind": "^2.1.0",
"@nativescript/unit-test-runner": "^3.0.1",
"@nativescript/visionos": "8.8.1"
"@nativescript/visionos": "~8.9.0"
}
}
4 changes: 2 additions & 2 deletions apps/nativescript-demo-ng/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { withInterceptorsFromDi } from '@angular/common/http';
import { setWindowBackgroundColor } from '@nativescript/core/utils/ios';
import { AppComponent } from './app/app.component';
import { routes } from './app/app.routes';
import { provideExperimentalZonelessChangeDetection } from '@angular/core';
import { provideZoneChangeDetection } from '@angular/core';

const EXPERIMENTAL_ZONELESS = true;

Expand All @@ -28,7 +28,7 @@ runNativeScriptAngularApp({
providers: [
provideNativeScriptHttpClient(withInterceptorsFromDi()),
provideNativeScriptRouter(routes),
EXPERIMENTAL_ZONELESS ? provideExperimentalZonelessChangeDetection() : provideNativeScriptNgZone(),
EXPERIMENTAL_ZONELESS ? provideZoneChangeDetection() : provideNativeScriptNgZone(),
],
});
},
Expand Down
4 changes: 3 additions & 1 deletion apps/nativescript-demo-ng/src/polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
import '@nativescript/core/globals';
// Install @nativescript/angular specific polyfills
import '@nativescript/angular/polyfills';

import { AbortController, AbortSignal } from '@nativescript/core/abortcontroller';
(global as any).AbortController = AbortController;
(global as any).AbortSignal = AbortSignal;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be in the pre-zone polyfills

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed but I'll leave comment in case want to adjust further - they are in pre-zone polyfills now.

/**
* Zone.js and patches
*/
Expand Down
8 changes: 8 additions & 0 deletions apps/nativescript-demo-ng/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
const webpack = require('@nativescript/webpack');
const { ProvidePlugin } = require("webpack");

module.exports = (env) => {
webpack.init(env);
webpack.useConfig('angular');

webpack.chainWebpack((config) => {
config.resolve.set('fallback', {
AbortController: require.resolve('@nativescript/core/abortcontroller'),
AbortSignal: require.resolve('@nativescript/core/abortcontroller'),
});
});

return webpack.resolveConfig();
};
36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,42 +36,42 @@
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s"
},
"dependencies": {
"@angular/animations": "19.2.9",
"@angular/common": "19.2.9",
"@angular/compiler": "19.2.9",
"@angular/core": "19.2.9",
"@angular/forms": "19.2.9",
"@angular/platform-browser": "19.2.9",
"@angular/platform-browser-dynamic": "19.2.9",
"@angular/router": "19.2.9",
"@nativescript/core": "~8.8.0",
"@angular/animations": "next",
"@angular/common": "next",
"@angular/compiler": "next",
"@angular/core": "next",
"@angular/forms": "next",
"@angular/platform-browser": "next",
"@angular/platform-browser-dynamic": "next",
"@angular/router": "next",
"@nativescript/core": "~8.9.0",
"@nativescript/tailwind": "^2.1.0",
"nativescript-fonticon": "~8.1.3",
"rxjs": "^7.8.0",
"zone.js": "~0.15.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "19.2.9",
"@angular-devkit/core": "19.2.9",
"@angular-devkit/schematics": "19.2.9",
"@angular-devkit/build-angular": "next",
"@angular-devkit/core": "next",
"@angular-devkit/schematics": "next",
"@angular-eslint/eslint-plugin": "19.4.0",
"@angular-eslint/eslint-plugin-template": "19.4.0",
"@angular-eslint/template-parser": "19.4.0",
"@angular/compiler-cli": "19.2.9",
"@angular/compiler-cli": "next",
"@jsdevtools/coverage-istanbul-loader": "3.0.5",
"@nativescript/nx": "20.0.4",
"@nativescript/types": "~8.8.0",
"@nativescript/nx": "~20.8.0",
"@nativescript/types": "~8.9.0",
"@nativescript/unit-test-runner": "^3.0.4",
"@nativescript/webpack": "~5.0.22",
"@ngtools/webpack": "~19.0.0",
"@ngtools/webpack": "next",
"@nx/angular": "21.1.0",
"@nx/eslint": "21.1.0",
"@nx/eslint-plugin": "21.1.0",
"@nx/jest": "21.1.0",
"@nx/js": "21.1.0",
"@nx/node": "21.1.0",
"@nx/workspace": "21.1.0",
"@schematics/angular": "19.2.9",
"@schematics/angular": "next",
"@types/jasmine": "5.1.4",
"@types/jest": "29.5.13",
"@types/node": "^20.0.0",
Expand Down Expand Up @@ -108,7 +108,7 @@
"ts-jest": "~29.2.0",
"ts-node": "10.9.2",
"tslib": "^2.8.0",
"typescript": "5.7.3"
"typescript": "~5.8.0"
},
"xplat": {
"prefix": "nativescript",
Expand Down
6 changes: 3 additions & 3 deletions packages/angular/src/lib/legacy/router/page-router-outlet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import {
EnvironmentInjector,
EventEmitter,
Inject,
InjectFlags,
InjectionToken,
InjectOptions,
Injector,
NgZone,
OnDestroy,
Output,
SkipSelf,
Type,
ViewContainerRef,
} from '@angular/core';
Expand Down Expand Up @@ -84,12 +84,12 @@ export class DestructibleInjector implements Injector {
private destructibleProviders: ProviderSet,
private parent: Injector,
) {}
get<T>(token: Type<T> | InjectionToken<T>, notFoundValue?: T, flags?: InjectOptions | InjectFlags): T {
get<T>(token: Type<T> | InjectionToken<T>, notFoundValue?: T, flags?: InjectOptions): T {
const ref = this.parent.get(token, notFoundValue, flags);

// if we're skipping ourselves then it's not our responsibility to destroy
if (typeof flags === 'number') {
if (!(flags & InjectFlags.SkipSelf) && this.destructibleProviders.has(token)) {
if (!(flags && this.destructibleProviders.has(token))) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this breaks the skipself flags

this.refs.add(ref);
}
} else {
Expand Down
Loading