GitHunt
SP

sp90/example-application-builder

An example of using the new application builder in angular

ExampleApplicationBuilder

This is to showcase thew new build system in angular - i would love to take a PR on running the server with one of the following webframeworks

Lets create a folder with alternative server.ts files and make an angular ssr benchmark

Commands

  • Dev SSR: npm run dev:ssr
  • Build SSR: npm run build:ssr
  • Serve SSR: npm run serve:ssr

This uses

  • angular@next
  • angular/ssr@next
  • The CommonEngine from angular/ssr

Footnotes

This is basically a project generated with

  • ng new appName --standalone --skip-tests
  • ng add @angular/ssr

Then its upgraded to version 17 using

  • ng update @angular/core@next @angular/cli@next with the force command because angular/ssr is not compatable with v17 of the core
  • Patch angular/ssr version in the package-json and npm i

Then updating the following files

  • angular.json - here the config is taken from the angular internal example that was shared as a screenshot
  • server.ts - same here example-file
  • tsconfig.app.js - added main.server.ts to includes (IMPORTANT do not add for files)

Useful info

  • Wanna learn about the CommonEngine here is the source to it
  • builds is about 1s for cold start ng serve
  • npm run dev:ssr ~8-10s
  • Changes are ~200ms on the initial package
  • npm run build:ssr ~8-10s

Languages

HTML86.1%TypeScript13.6%SCSS0.3%

Contributors

Created September 19, 2023
Updated September 19, 2023