Development notes

AppModule is gone

The last two NgModules were the shell. The browser now calls bootstrapApplication. The server forwards BootstrapContext. Decorator inputs stay as they were. That rewrite is a different PR.

commit 8d2a75fc01 t3code/standalone-appmodule-migration PR 10871

What changed

Feature routes were already standalone. This only moves root bootstrap and the provider list. I deleted AppModule and AppServerModule.

BeforeNow
src/app/app.module.ts Deleted. Providers live in src/app/app.config.ts.
src/app/app.server.module.ts Deleted. Server adds provideServerRendering() from @angular/platform-server in src/app/app.config.server.ts.
AppComponent standalone: false Standalone. Imports the shell the template already used. Dev toolbar still joins that list only when environment.production is false.
bootstrapModule(AppModule) bootstrapApplication(AppComponent, appConfig). Same delayed start and smoothscroll polyfill.
AppServerModule on CommonEngine bootstrap(context) is the third-argument form. Skip the context and Angular throws NG0401.
renderModule in serverless.ts renderApplication(bootstrap, { document, url }). Still exports app for the Lambda wrapper.
Firebase Universal 16 Retired. The function returns 501. Hosting already rewrote to static /index.html.
entryModule Removed from tsconfig.server.json.

Calls I made

  • Kept provideZoneChangeDetection() in appConfig. Angular 21 standalone bootstrap is zoneless unless you say otherwise.
  • Kept importProvidersFrom(ModalModule) as-is. No forRoot(). Toastr and Stripe still use their forRoot configs. NgRx uses provideStore with the same five keys and the same loose runtime checks.
  • Left withEventReplay() and withNoHttpTransferCache() on the client config.
  • Did not rename lamda.js. serverless.yml still lists lambda.js, which is not in the checkout. If that path is still deployed, someone has to pick one filename.

How I checked it

CheckResult
App typecheckPass. tsc -p tsconfig.app.json --noEmit with a 10 GB heap. 2567 files, 0 errors.
Server typecheckPass. tsc -p tsconfig.server.json --noEmit. Includes server.ts and serverless.ts.
Module leftoversPass. No AppModule or AppServerModule in .ts, .js, or .json.
QA / prod AOT buildNot run. An ng build was started and cut off after a few minutes.
SSR, hydration, logged-in productNot run. That is the checklist below.
node --max_old_space_size=10048 ./node_modules/typescript/bin/tsc -p tsconfig.app.json --noEmit
node --max_old_space_size=10048 ./node_modules/typescript/bin/tsc -p tsconfig.server.json --noEmit

Verification checklist

Human QA. A person has to click through a running build with the console open. Do not use / to prove SSR. server.ts serves browser/index.html for the homepage before it calls renderApp. That page can look fine while the new bootstrap throws NG0401 on every fresh render.

0 of 0 checked

High Fresh SSR and the shell

High Root providers

Medium Lazy routes and branding

Low Other entrypoints