Skip to content

feat(translatr): convert root bootstrap to standalone (bootstrapApplication) - #358

Merged
resamsel merged 5 commits into
mainfrom
migrate-translatr-root-standalone
Sep 19, 2026
Merged

resamsel merged 5 commits into
mainfrom
migrate-translatr-root-standalone

Conversation

@resamsel

Copy link
Copy Markdown
Owner

Summary

  • Fourth and final layer of the apps/translatr standalone migration (after libs/translatr-components Migrate translatr-components to standalone components #352, apps/translatr/src/app/modules/shared Migrate translatr shared modules to standalone components #355, apps/translatr/src/app/modules/pages feat(translatr): convert pages layer to standalone components #356).
  • Converts SidenavComponent to standalone: true, deleting sidenav.module.ts and updating its 8 consumers to import the component directly. Converts SidenavTestingModule's mock the same way.
  • Converts AppComponent to standalone: true (its own template is only <router-outlet> — every other import on the old AppModule was vestigial for it specifically, since AppModule only ever declared AppComponent).
  • Deletes app.module.ts and rewrites main.ts to call bootstrapApplication(AppComponent, { providers: [...] }), using native NgRx/Router provider functions (provideRouter, provideRouterStore, provideStoreDevtools, provideAnimations, provideHttpClient) plus importProvidersFrom(StoreModule.forRoot(...))/importProvidersFrom(EffectsModule.forRoot(...)) for the root store/effects — kept as the NgModule form deliberately, since every lazy page module still registers its feature state via StoreModule.forFeature()/EffectsModule.forFeature() (unchanged, out of scope here), and those require the StoreRootModule/EffectsRootModule marker only the NgModule forRoot() provides.
  • TranslocoRootModule and TranslatrSdkModule stay as NgModules, pulled in via importProvidersFrom.
  • app-routing.module.ts now exports its Routes array directly instead of wrapping it in an NgModule.

Test plan

  • nx test translatr — 159/159 passing
  • nx build translatr — clean build
  • tsc -p apps/translatr/tsconfig.app.json --noEmit — clean
  • Full local e2e suite — 187/187 passing (this caught the one real bug in this change: provideStore()/provideEffects() don't provide the marker tokens StoreModule.forFeature()/EffectsModule.forFeature() need, breaking every lazy route with NG0201 — fixed by keeping root store/effects registration on the NgModule form via importProvidersFrom)
  • Manual browser smoke test: main page and /login route render with zero console errors beyond expected unauthenticated 401s

🤖 Generated with Claude Code

renepanzar and others added 5 commits September 19, 2026 14:00
Fourth and final layer of the apps/translatr standalone migration:
AppModule/AppComponent/main.ts root bootstrap plus SidenavComponent/
SidenavModule, converting to bootstrapApplication with native NgRx/
Router provider functions.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Convert SidenavComponent to standalone: true. Delete sidenav.module.ts,
updating its 8 consumers to import SidenavComponent directly. Convert
SidenavTestingModule's MockSidenavComponent to standalone, renamed to
mock-sidenav.component.ts, deleting the wrapper module.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Convert AppComponent to standalone: true. Delete app.module.ts and
rewrite main.ts to bootstrapApplication with native NgRx/Router
provider functions (provideRouter, provideStore, provideEffects,
provideRouterStore, provideStoreDevtools, provideAnimations,
provideHttpClient) replacing StoreModule.forRoot/EffectsModule.forRoot/
StoreRouterConnectingModule.forRoot/StoreDevtoolsModule.instrument/
RouterModule.forRoot/BrowserAnimationsModule. TranslocoRootModule and
TranslatrSdkModule stay as NgModules, pulled in via importProvidersFrom.

app-routing.module.ts now exports its Routes array directly instead of
wrapping it in an NgModule.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ideEffects

provideStore()/provideEffects() (the functional forms) don't provide the
StoreRootModule/EffectsRootModule marker tokens that
StoreModule.forFeature()/EffectsModule.forFeature() - used throughout every
lazy page module, unchanged here - inject in their factories. Mixing them
with the functional root providers threw NG0201 on every lazy route, caught
by a full e2e run (unit tests mock facades and never exercise this wiring).

Root store/effects registration goes back to importProvidersFrom(
StoreModule.forRoot(...)) / importProvidersFrom(EffectsModule.forRoot(...)).
provideRouterStore and provideStoreDevtools have no forFeature counterpart
elsewhere in the app and stay as their native functional forms.

Full local e2e suite: 187/187 passing.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
All groups done: SidenavComponent conversion, AppComponent standalone,
bootstrapApplication root bootstrap rewrite, and final verification
(159/159 unit tests, clean build, 187/187 e2e).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@resamsel
resamsel merged commit 74357f8 into main Sep 19, 2026
6 checks passed
@resamsel
resamsel deleted the migrate-translatr-root-standalone branch September 19, 2026 12:50
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