From 07d38da0658c5f4dc20143f0c8c3527b53de268c Mon Sep 17 00:00:00 2001 From: Florian Rappl Date: Fri, 24 Nov 2023 21:07:52 +0100 Subject: [PATCH] Updated Angular to v17 --- CHANGELOG.md | 2 ++ src/converters/piral-ng/README.md | 31 +++++++++++++++++++++++++- src/converters/piral-ng/src/startup.ts | 30 +++++++++++++------------ 3 files changed, 48 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30eebe29f..6ea0a4df2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,9 @@ - Moved `piral-jest-utils` and `piral-ie11polyfills-utils` into a separate repository - Updated documentation on `piral-ng` (#646) - Updated dependencies (#641) +- Updated `piral-cli` compatibility with Bun as runtime - Updated generated code to fully use ES2020 +- Added support for Angular 17 in `piral-ng` - Added `piral-react` as converter for React - Added possibility to publish emulator as a website (#644) - Added orchestration engine choices (`systemjs`, `module-federation`) (#643) diff --git a/src/converters/piral-ng/README.md b/src/converters/piral-ng/README.md index ed0b57290..7541d5da6 100644 --- a/src/converters/piral-ng/README.md +++ b/src/converters/piral-ng/README.md @@ -699,7 +699,36 @@ The basic dependencies look as follows: } ``` -Besides the usual imports, the explicit import of the `@angular/compiler` package may be necessary. TypeScript has to be higher than 4.8 (4.9 or later). +Besides the usual imports, the explicit import of the `@angular/compiler` package may be necessary. TypeScript has to be higher than 4.8 (and pre-5.0). + +So include in your app shell as preamble: + +```js +import 'core-js/proposals/reflect-metadata'; +import '@angular/compiler'; +``` + +### Angular 17 + +In general, Angular 17 seems to work and is **supported**. + +The basic dependencies look as follows: + +```json +{ + "@angular/common": "^17", + "@angular/compiler": "^17", + "@angular/core": "^17", + "@angular/router": "^17", + "@angular/platform-browser": "^17", + "@angular/platform-browser-dynamic": "^17", + "core-js": "^3.19.0", + "rxjs": "^7.4", + "zone.js": "~0.14.0" +} +``` + +Besides the usual imports, the explicit import of the `@angular/compiler` package may be necessary. TypeScript has to be higher or equal to 5.2 (and less than 5.3). So include in your app shell as preamble: diff --git a/src/converters/piral-ng/src/startup.ts b/src/converters/piral-ng/src/startup.ts index 31350d2fd..de2ea8489 100644 --- a/src/converters/piral-ng/src/startup.ts +++ b/src/converters/piral-ng/src/startup.ts @@ -109,16 +109,16 @@ if (process.env.NODE_ENV === 'development') { // May be used later for something useful. Right now only debugging output. const versionHandlers = { legacy() { - console.log('Running in legacy mode (Angular 2, Angular 4)'); + console.log('Running in legacy mode (Angular 2-8)'); }, outdated() { - console.log('Running in outdated mode (Angular 5-8)'); + console.log('Running in outdated mode (Angular 9-13)'); }, current() { - console.log('Running in current mode (Angular 9-15)'); + console.log('Running in current mode (Angular 14-17)'); }, next() { - console.log('Running in next mode (Angular 16)'); + console.log('Running in next mode (Angular 18)'); }, unknown() { console.log('Running with an unknown version of Angular'); @@ -127,18 +127,20 @@ if (process.env.NODE_ENV === 'development') { const versions = { v2: versionHandlers.legacy, v4: versionHandlers.legacy, - v5: versionHandlers.outdated, - v6: versionHandlers.outdated, - v7: versionHandlers.outdated, - v8: versionHandlers.outdated, - v9: versionHandlers.current, - v10: versionHandlers.current, - v11: versionHandlers.current, - v12: versionHandlers.current, - v13: versionHandlers.current, + v5: versionHandlers.legacy, + v6: versionHandlers.legacy, + v7: versionHandlers.legacy, + v8: versionHandlers.legacy, + v9: versionHandlers.outdated, + v10: versionHandlers.outdated, + v11: versionHandlers.outdated, + v12: versionHandlers.outdated, + v13: versionHandlers.outdated, v14: versionHandlers.current, v15: versionHandlers.current, - v16: versionHandlers.next, + v16: versionHandlers.current, + v17: versionHandlers.current, + v18: versionHandlers.next, }; const handler = getVersionHandler(versions) || versionHandlers.unknown;