Skip to content

spike(CXSPA-13856): Compare approaches. - #21792

Draft
sp94sap wants to merge 1 commit into
developfrom
spike/base-site-detection-approaches
Draft

spike(CXSPA-13856): Compare approaches.#21792
sp94sap wants to merge 1 commit into
developfrom
spike/base-site-detection-approaches

Conversation

@sp94sap

@sp94sap sp94sap commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Spike: base-site detection for SSR request handlers

⚠️ Spike branch — not for production merge. Prerequisite for all AI-SEO handlers
(robots.txt, llms.txt, .well-known). Full analysis + recommendation in the ADR.

Example implementations of resolving baseSiteId at the SSR layer, comparing three approaches:

  • Approach A — Pure Node / Express: plain fetch() to OCC /basesites + a copied
    Java→JS regex converter + in-memory cache, resolved in an Express handler. No Angular.
  • Approach B — createApplication(): boots a minimal Angular app once at startup to get a
    persistent DI injector, queried from an Express handler. (Recommended target: reuse the real
    JavaRegExpConverter + OccSiteAdapter through the injector — no logic duplication.)
  • Approach C — Angular-native (provideX): reuses all existing resolution
    (SiteContextConfigInitializer) via a server-side provider; AI-SEO handlers become Angular routes.

Recommendation: Approach B — the only one that both reuses Spartacus' real resolution and is
callable from the Express serving layer (A = req.hostname hand-wave; C resolves but can't serve
clean text/plain — CommonEngine renders an HTML shell).

Switch active approach via the tagged blocks in server.ts / app.config.server.ts.
ADR:
branch: spike/base-site-detection-approaches
file: spartacus-requirements/spartacus-classic/adr-base-site-detection-ssr.md

@sp94sap
sp94sap requested a review from a team as a code owner July 24, 2026 13:56
@github-actions
github-actions Bot marked this pull request as draft July 24, 2026 13:56
@github-actions

Copy link
Copy Markdown
Contributor

🚨 PR Title Validation Failed 🚨

Your pull request title does not follow the required format. Please update it to match the expected pattern:

Expected format:
<type>: <subject>

Allowed Types

  • docs: Changes to documentation only
  • feat: New feature work
  • fix: Bug fixes
  • perf: Code improvements for performance
  • refactor: Code changes that are not bug fixes or features
  • style: Code style changes (e.g., whitespace, formatting)
  • test: Adding or updating tests
  • chore: Build, CI, scripts, configs, etc.

Example of a valid PR title

feat: Add user authentication
fix: Resolve checkout bug
docs: Update API documentation

Merge is blocked until the PR title is corrected.

2 similar comments
@github-actions

Copy link
Copy Markdown
Contributor

🚨 PR Title Validation Failed 🚨

Your pull request title does not follow the required format. Please update it to match the expected pattern:

Expected format:
<type>: <subject>

Allowed Types

  • docs: Changes to documentation only
  • feat: New feature work
  • fix: Bug fixes
  • perf: Code improvements for performance
  • refactor: Code changes that are not bug fixes or features
  • style: Code style changes (e.g., whitespace, formatting)
  • test: Adding or updating tests
  • chore: Build, CI, scripts, configs, etc.

Example of a valid PR title

feat: Add user authentication
fix: Resolve checkout bug
docs: Update API documentation

Merge is blocked until the PR title is corrected.

@github-actions

Copy link
Copy Markdown
Contributor

🚨 PR Title Validation Failed 🚨

Your pull request title does not follow the required format. Please update it to match the expected pattern:

Expected format:
<type>: <subject>

Allowed Types

  • docs: Changes to documentation only
  • feat: New feature work
  • fix: Bug fixes
  • perf: Code improvements for performance
  • refactor: Code changes that are not bug fixes or features
  • style: Code style changes (e.g., whitespace, formatting)
  • test: Adding or updating tests
  • chore: Build, CI, scripts, configs, etc.

Example of a valid PR title

feat: Add user authentication
fix: Resolve checkout bug
docs: Update API documentation

Merge is blocked until the PR title is corrected.

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.

1 participant