Skip to content

Upgrade Angular 7 → 21, Nebular 3 → 17, modernize SSR#1

Draft
ehsanshrz with Copilot wants to merge 2 commits into
masterfrom
copilot/update-to-latest-version
Draft

Upgrade Angular 7 → 21, Nebular 3 → 17, modernize SSR#1
ehsanshrz with Copilot wants to merge 2 commits into
masterfrom
copilot/update-to-latest-version

Conversation

Copilot AI commented Jul 8, 2026

Copy link
Copy Markdown

Project was on Angular 7 (2018) with a deprecated @nguniversal SSR setup and a one-line README.

Dependencies

  • All @angular/*: 7 → 21.2.17; @nebular/theme: 3 → 17; TypeScript: 3.1 → 5.9; RxJS: 6 → 7.8; zone.js: 0.8 → 0.16
  • Added @angular/ssr + express 5; pinned @angular/cdk to ~21.0.0 (Nebular 17 uses internal CDK symbols removed in 21.2.x)
  • Removed: @nguniversal/*, @angular/http, domino, core-js, tslint, phantomjs, protractor, webpack-cli, ts-loader

SSR

Replaced @nguniversal/express-engine + webpack bundle + domino window polyfills with the Angular-native CommonEngine:

// server.ts — before: custom NgFactory + domino global patching
// server.ts — after:
import { CommonEngine } from '@angular/ssr/node';
const commonEngine = new CommonEngine();
server.get('**', (req, res, next) => {
  commonEngine.render({ bootstrap: AppServerModule, ... })
    .then(html => res.send(html))
    .catch(next);
});

angular.json now uses the unified application builder (browser + server in one pass); webpack.server.config.js deleted.

Angular 21 Breaking Changes

  • standalone: false added to all @Component decorators (Angular 19+ defaults to standalone)
  • BrowserModule.withServerTransition() removed (dropped in v21) → plain BrowserModule
  • Lazy loading updated from deprecated string syntax ('./sample/sample.module#SomePageModule') to dynamic import()
  • class Herointerface Hero; strict-mode property initialization fixed across components
  • main.server.ts exports AppServerModule as default (required by Angular 17+ SSR bootstrap)

Config

  • tsconfig.json: ES2022 target/module, moduleResolution: bundler, strict mode
  • Root-level tsconfig.app.json / tsconfig.spec.json added (required by new builder)
  • karma.conf.js: karma-coverage replaces deprecated karma-coverage-istanbul-reporter

README

Rewritten with setup steps, project structure, SSR architecture explanation, scripts reference, and dependency table.

Copilot AI changed the title Upgrade Angular 7 → 21, Nebular 3 → 17, rewrite SSR, add proper README Upgrade Angular 7 → 21, Nebular 3 → 17, modernize SSR Jul 8, 2026
Copilot AI requested a review from ehsanshrz July 8, 2026 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants