Skip to content

Conversation

@Platonn
Copy link
Contributor

@Platonn Platonn commented Jan 21, 2026

Detailed scope:

  1. use bootstrapApplication instead of bootstrapModule in our storefrontapp and mimic app structure of a fresh Standalone app
    • use bootstrapApplication in main.ts and main.server.ts
    • change AppComponent to standalone
    • create app.config.ts with Angular-speciifc providers (+ importProvidersFrom(AppModule))
    • create app.config.server.ts Angular-specific SSR providers (+ importsProvidersFrom(AppServerModule))
    • renamed default JS import in server.ts from AppServerModule to bootstrap
  2. changed the installation schematics
    • angular-specific providers are placed in app.config.ts and app.config.server.ts
    • various pre-existing modules (ngrx modules, SpartacusModule and Spartacus AppRoutingModule) are kept in AppModule
    • Spartacus provideServer() is kept in AppServerModule
    • default JS import in server.ts is now bootstrap (instead of AppServerModule)
    • removed old unnecessary logic for installing non-standalone SSR (i.e. logic that cleaned up app.module.server.ts)
  3. No longer use --standalone=false:
    • in unit tests of schematics (which create fresh apps)
    • in 221121_08/installation.md
    • in scripts/install/.run.sh script
  4. Update unit tests of installation schematics
    • update snapshots of generated angular.json - to include standalone:true config for generator schematics
    • update assertions of positions of code changes - for tests that implicitly relied on the non-standalone app strucutre
  5. Update unit tests of add-cms-component generator schematics. But the schematics seem to have been broken and unmaintained even before this PR on develop. This PR doesn't address pre-existing issues with this generator.

By the way, moved out our private repo's stuff from AppModule and SpartacusConfigurationModule - to align it 1:1 with fresh customer's apps:

  • Move out stuff from AppModule:
    • i18n config moved from AppModule to SpartacusConfigurationModule
    • configs specific to only our example storefront app and e2e testing moved from AppModule to privateProviders in separate file in storefrontapp
  • Created file SpartacusConfigurationModule with things common for b2b and b2c (like in customer apps)
    • SpartacusB2bConfigurationModule (and B2c) renamed to spartacusB2bConfigurationProviders (and B2c respectively) and moved there only stuff related to b2b (and b2c respectively)
    • used conditionally spartacusB2bConfigurationProviders (and B2c) in SpartacusConfigurationModule, based on the environment.b2b

By the way:

  • added missing command to package.json: test:schematics - which runs tests just for the the projects/schematics/

Note: in another partial PR there are modernization/migration schematics for existing projects: #21043

closes https://jira.tools.sap/browse/CXSPA-11890


Things to QA:

  • our storefrontapp: check CSR and SSR
  • installation: create fresh angular+spartacus app, then check CSR and SSR

Platonn and others added 30 commits January 16, 2026 15:53
- use bootstrapApplication in main.ts and main.server.ts
- change AppComponent to standalone
- create app.config.ts with Angular providers and importProvidersFrom(AppModule)
- create app.config.server.ts with SSR-specific providers (moved from AppServerModule)
- remove AppServerModule as empty (because moved its contents to new app.config.server.ts)

By the way, aligned the shape of AppModule and SpartacusConfigurationModule to customer's apps:
1. Move out stuff from AppModule:
- i18n config moved from AppModule to SpartacusConfigurationModule
- configs specific to only our example storefront app and e2e testing moved from AppModule to privateProviders in separate file
2. Created file SpartacusConfigurationModule with things common for b2b and b2c
- SpartacusB2bConfigurationModule (and B2c) renamed to spartacusB2bConfigurationProviders (and B2c respectively)
- imported spartacusB2bConfigurationProviders (and B2c) in SpartacusConfigurationModule, based on the environment.b2b
…ar.json files to include new standalone:true config for generator schematics
@Platonn Platonn marked this pull request as ready for review January 28, 2026 07:41
@cypress
Copy link

cypress bot commented Jan 28, 2026

spartacus    Run #51442

Run Properties:  status check passed Passed #51442  •  git commit 060c6e83d2 ℹ️: Merge 289723196a6664481ef96e7ccddef50dde8eeb16 into a7085407af428e382d8ff84b4bf8...
Project spartacus
Branch Review feature/CXSPA-11890-v2
Run status status check passed Passed #51442
Run duration 11m 43s
Commit git commit 060c6e83d2 ℹ️: Merge 289723196a6664481ef96e7ccddef50dde8eeb16 into a7085407af428e382d8ff84b4bf8...
Committer Krzysztof Platis
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 4
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 101
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.
View all changes introduced in this branch ↗︎

@github-actions github-actions bot marked this pull request as draft January 28, 2026 08:50
@Platonn Platonn marked this pull request as ready for review January 28, 2026 09:01
@github-actions
Copy link
Contributor

Merge Checks Failed

Please push a commit to re-trigger the build.
To push an empty commit you can use `git commit --allow-empty -m "Trigger Build"`

@github-actions github-actions bot marked this pull request as draft January 28, 2026 09:24
@Platonn Platonn marked this pull request as ready for review January 28, 2026 09:53
Copy link
Contributor

@pawelfras pawelfras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review and QA done.
What was tested

  • installation in fresh Angular app, with CSR
  • installation in fresh Angular app, with SSR
  • migration of Spartacus app, with CSR
  • migration of Spartacus app, with SSR
  • build of storefrontapp in various combination
  • serving storefrontapp in various combination

LGTM!
Before merging, please run the branch against Spartacus build pipeline to run all e2es

@cypress
Copy link

cypress bot commented Jan 28, 2026

spartacus    Run #51443

Run Properties:  status check passed Passed #51443  •  git commit 289723196a: refactor: fix lint
Project spartacus
Branch Review feature/CXSPA-11890-v2
Run status status check passed Passed #51443
Run duration 41m 30s
Commit git commit 289723196a: refactor: fix lint
Committer Krzysztof Platis
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 5
Tests that did not run due to a developer annotating a test with .skip  Pending 17
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 699
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.
View all changes introduced in this branch ↗︎

@Platonn Platonn merged commit 6622a52 into release/221121.7.x Jan 28, 2026
70 checks passed
@Platonn Platonn deleted the feature/CXSPA-11890-v2 branch January 28, 2026 11:21
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.

3 participants