Skip to content

build: share example routes with web components - #802

Draft
spike-rabbit wants to merge 1 commit into
mainfrom
build/share-example-routes
Draft

build: share example routes with web components#802
spike-rabbit wants to merge 1 commit into
mainfrom
build/share-example-routes

Conversation

@spike-rabbit

@spike-rabbit spike-rabbit commented Aug 14, 2026

Copy link
Copy Markdown
Member

What kind of change does this PR introduce? (check one with "x")

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior? (You can also link to an open issue here)

Web-component examples are registered through a separate switch statement and do not share the application route configuration.

What is the new behavior?

Web-component examples load their components from the shared lazy route map. Route paths now follow the component selector convention without the -demo suffix.

Does this PR introduce a breaking change? (check one with "x")

  • Yes
  • No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

@spike-rabbit
spike-rabbit requested a review from a team as a code owner August 14, 2026 15:27
@fh1ch
fh1ch requested a lite review from Copilot August 16, 2026 16:18
@fh1ch fh1ch added the enhancement New feature or request label Aug 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Aligns the web-components entrypoint with the Angular app’s shared route configuration so examples are loaded from the same lazy route map and route paths follow the component-selector naming convention (without the -demo suffix).

Changes:

  • Switched the main app bootstrap to consume routes from app.routes.ts.
  • Added a redirect from the empty path to fluid-row-height and renamed the “10k Rows” route to ten-k-rows.
  • Refactored web-components example loading to resolve components from the shared routes map instead of a dedicated switch.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/main.web-components.ts Builds an example loader map from shared routes and registers web component examples dynamically.
src/main.ts Updates route import to use ./app/app.routes.
src/app/app.routes.ts Adds default redirect and renames 10k-rows to ten-k-rows in the route map.
src/app/app.component.html Updates navigation link to the renamed ten-k-rows route.
Suppressed comments (1)

src/app/app.routes.ts:21

  • This renames the example route from 10k-rows to ten-k-rows, which will break existing deep links/bookmarks (and any external references) to #/10k-rows. Consider keeping backward compatibility by adding a redirect route from the old path to the new one.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@spike-rabbit
spike-rabbit force-pushed the build/share-example-routes branch from 927f3bc to 743676b Compare August 17, 2026 06:56

@fh1ch fh1ch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@spike-rabbit nice work here, I like the direction 🙇

Just two points from my end, but the rest looks good 🏓

Comment thread src/app/app.routes.ts
// Basic
{
path: '10k-rows',
path: 'ten-k-rows',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

IMO, this change doesn't make much sense. Everything is called 10k-rows (file, title, ...), so why do we suddenly call it ten-k? We should align this here, no hard feelings into which direction.

Comment thread src/app/app.routes.ts
@@ -1,15 +1,21 @@
import { Routes } from '@angular/router';

// Route paths must match their component selectors without the `-demo` suffix.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we have some sort of linting for this? We don't really test our demo app, meaning errors will only be noticed during runtime/by the reader.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

My plan is to generate this file in the future. I guess this is easier than to lint it?

@spike-rabbit
spike-rabbit marked this pull request as draft August 20, 2026 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants