Skip to content
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

update(angular-universal-ssr): updating angular version from 10 to 15 #2717

Draft
wants to merge 22 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions angular-universal-ssr/client-app/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ speed-measure-plugin*.json
.history/*

# misc
/.angular/cache
/.sass-cache
/connect.lock
/coverage
Expand Down
31 changes: 20 additions & 11 deletions angular-universal-ssr/client-app/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"cli": {
"packageManager": "yarn"
"packageManager": "yarn",
"analytics": "e9693d44-eea8-4fdb-918a-9139355769eb"
},
"newProjectRoot": "projects",
"projects": {
Expand All @@ -28,7 +29,6 @@
"skipTests": true
},
"@schematics/angular:module": {
"skipTests": true
},
"@schematics/angular:pipe": {
"skipTests": true
Expand All @@ -49,10 +49,20 @@
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": true,
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.scss"],
"scripts": []
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.scss"
],
"scripts": [],
"vendorChunk": true,
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": true,
"optimization": false,
"namedChunks": true
},
"configurations": {
"production": {
Expand All @@ -65,7 +75,6 @@
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
Expand All @@ -83,7 +92,8 @@
}
]
}
}
},
"defaultConfiguration": ""
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
Expand All @@ -104,6 +114,5 @@
}
}
}
},
"defaultProject": "client-app"
}
}
}
49 changes: 25 additions & 24 deletions angular-universal-ssr/client-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "angular-universal-ssr_client-app",
"version": "0.0.0",
"type": "commonjs",
"scripts": {
"ng": "ng",
"start": "ng serve",
Expand All @@ -14,33 +15,33 @@
},
"private": true,
"dependencies": {
"@angular/animations": "~10.2.0",
"@angular/common": "~10.2.0",
"@angular/compiler": "~10.2.0",
"@angular/core": "~10.2.0",
"@angular/forms": "~10.2.0",
"@angular/platform-browser": "~10.2.0",
"@angular/platform-browser-dynamic": "~10.2.0",
"@angular/router": "~10.2.0",
"rxjs": "~6.6.0",
"serve": "^13.0.0",
"tslib": "^2.0.0",
"zone.js": "~0.11.0"
"@angular/animations": "^15.1.2",
"@angular/common": "^15.1.2",
"@angular/compiler": "^15.1.2",
"@angular/core": "^15.1.2",
"@angular/forms": "^15.1.2",
"@angular/platform-browser": "^15.1.2",
"@angular/platform-browser-dynamic": "^15.1.2",
"@angular/router": "^15.1.2",
"rxjs": "^7.8.0",
"serve": "^14.2.0",
"tslib": "^2.5.0",
"zone.js": "~0.12.0"
},
"devDependencies": {
"@ngtools/webpack": "file:../patched_packages/_ngtools_webpack.tgz",
"@angular-devkit/build-angular": "0.1102.19",
"@angular/cli": "10.2.4",
"@angular/compiler-cli": "10.2.5",
"@types/node": "12.20.55",
"@ngtools/webpack": "15.1.4",
"@angular-devkit/build-angular": "15.1.4",
"@angular/cli": "15.1.4",
"@angular/compiler-cli": "15.1.2",
"@types/node": "18.11.9",
"clean-webpack-plugin": "4.0.0",
"html-webpack-plugin": "5.5.0",
"raw-loader": "4.0.2",
"sass-loader": "12.6.0",
"ts-node": "9.1.1",
"tslint": "6.1.3",
"typescript": "4.0.8",
"webpack": "5.72.1",
"webpack-cli": "4.10.0"
"sass-loader": "13.2.0",
"ts-node": "10.9.1",
"tslint": "6.2.0",
"typescript": "4.9.5",
"webpack": "5.75.0",
"webpack-cli": "5.0.1"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const routes: Routes = [
];

@NgModule({
imports: [RouterModule.forRoot(routes)],
imports: [RouterModule.forRoot(routes, {})],
exports: [RouterModule],
})
export class AppRoutingModule {}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import { ClientCitiesRoutingModule } from './client-cities-routing.module';
import { ClientCityComponent } from './client-city/client-city.component';

@NgModule({
declarations: [ClientCitiesHomeComponent, ClientCityComponent],
imports: [CommonModule, ClientCitiesRoutingModule],
exports: [ClientCitiesHomeComponent],
entryComponents: [ClientCityComponent],
declarations: [ClientCitiesHomeComponent, ClientCityComponent],
imports: [CommonModule, ClientCitiesRoutingModule],
exports: [ClientCitiesHomeComponent]
})
export class ClientCitiesModule {}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ export const environment = {
* This import should be commented out in production mode because it will have a negative impact
* on performance if an error is thrown.
*/
// import 'zone.js/dist/zone-error'; // Included with Angular CLI.
// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.
12 changes: 1 addition & 11 deletions angular-universal-ssr/client-app/src/polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,6 @@
* BROWSER POLYFILLS
*/

/** IE10 and IE11 requires the following for NgClass support on SVG elements */
// import 'classlist.js'; // Run `npm install --save classlist.js`.

/**
* Web Animations `@angular/platform-browser/animations`
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
*/
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.

/**
* By default, zone.js will patch all possible macroTask and DomEvents
* user can disable parts of macroTask/DomEvents patch by setting following flags
Expand Down Expand Up @@ -55,7 +45,7 @@
/***************************************************************************************************
* Zone JS is required by default for Angular itself.
*/
import 'zone.js/dist/zone'; // Included with Angular CLI.
import 'zone.js'; // Included with Angular CLI.

/***************************************************************************************************
* APPLICATION IMPORTS
Expand Down
2 changes: 1 addition & 1 deletion angular-universal-ssr/client-app/src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting,
} from '@angular/platform-browser-dynamic/testing';
import 'zone.js/dist/zone-testing';
import 'zone.js/testing';

declare const require: {
context(
Expand Down
10 changes: 8 additions & 2 deletions angular-universal-ssr/client-app/tsconfig.app.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": []
},
"files": ["src/main.ts", "src/polyfills.ts"],
"include": ["src/**/*.d.ts"]
"files": [
"src/main.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.d.ts"
]
}
12 changes: 6 additions & 6 deletions angular-universal-ssr/client-app/tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"compileOnSave": false,
"compilerOptions": {
Expand All @@ -7,14 +8,13 @@
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"module": "es2020",
"moduleResolution": "node",
"importHelpers": true,
"target": "es2015",
"lib": ["es2018", "dom"]
},
"angularCompilerOptions": {
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true
"module": "es2020",
"lib": [
"es2018",
"dom"
]
}
}
39 changes: 27 additions & 12 deletions angular-universal-ssr/client-app/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
/*
This is a "Solution Style" tsconfig.json file, and is used by editors and TypeScript’s language server to improve development experience.
It is not intended to be used to perform a compilation.

To learn more about this file see: https://angular.io/config/solution-tsconfig.
*/
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"files": [],
"references": [
{
"path": "./tsconfig.app.json"
}
]
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"forceConsistentCasingInFileNames": true,
"strict": false,
"strictPropertyInitialization": false,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"importHelpers": true,
"target": "es2015",
"module": "es2020",
"lib": [
"es2018",
"dom"
]
},
"angularCompilerOptions": {
"strictInjectionParameters": true,
"strictTemplates": true
}
}
4 changes: 2 additions & 2 deletions angular-universal-ssr/client-app/webpack/client-app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { resolve } = require('path');
const { AngularCompilerPlugin } = require('@ngtools/webpack');
const { AngularWebpackPlugin } = require('@ngtools/webpack');
const ProgressPlugin = require('webpack/lib/ProgressPlugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ModuleFederationPlugin = require('webpack').container.ModuleFederationPlugin;
Expand Down Expand Up @@ -34,7 +34,7 @@ module.exports = (env = {}) => {
],
}),

new AngularCompilerPlugin({
new AngularWebpackPlugin({
tsConfigPath: './tsconfig.app.json',
entryModule: './src/app/app.module#AppModule',
skipCodeGeneration: true,
Expand Down
4 changes: 2 additions & 2 deletions angular-universal-ssr/client-app/webpack/client-ssr.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { AngularCompilerPlugin, PLATFORM } = require('@ngtools/webpack');
const { AngularWebpackPlugin } = require('@ngtools/webpack');
const { resolve } = require('path');
const ProgressPlugin = require('webpack/lib/ProgressPlugin');
const ModuleFederationPlugin = require('webpack').container.ModuleFederationPlugin;
Expand Down Expand Up @@ -35,7 +35,7 @@ module.exports = (env = {}) => {
{ '@angular/router': { singleton: true, eager: true } },
],
}),
new AngularCompilerPlugin({
new AngularWebpackPlugin({
entryModule: resolve(__dirname, '../src/app/app.module#AppModule'),
tsConfigPath: './tsconfig.app.json',
skipCodeGeneration: true,
Expand Down
Loading