Skip to content

Conversation

@nmerget
Copy link
Collaborator

@nmerget nmerget commented Jan 22, 2026

Proposed changes

resolves # (issue number)

Types of changes

  • Bugfix (non-breaking change that fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (improvements to existing components or architectural decisions)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Further comments

🔭🐙🐈 Test this branch here: https://design-system.deutschebahn.com/core-web/review/refactor-astro-stencil-showcase

@changeset-bot
Copy link

changeset-bot bot commented Jan 22, 2026

⚠️ No Changeset found

Latest commit: ef4b919

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added 📕documentation Improvements or additions to documentation 📺showcases Changes to 1-n showcases 🛠️configuration 🏘components labels Jan 22, 2026
@mfranzke mfranzke requested a review from Copilot January 22, 2026 22:05
@mfranzke mfranzke changed the title Refactor astro stencil showcase refactor: astro stencil showcase Jan 22, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the stencil-showcase from an Angular-based implementation to an Astro-based implementation. This is a significant architectural change that enables web components to be rendered with Astro's static site generation capabilities.

Changes:

  • Migrated stencil-showcase from Angular to Astro framework
  • Added Mitosis plugin for Astro code generation supporting hybrid rendering (static + web components)
  • Fixed boolean string handling in utility functions to properly parse 'true'/'false' strings for HTML attribute compatibility
  • Added new component properties and lifecycle improvements (open prop for accordion-item, hideSubNavigation for navigation-item)
  • Updated Stencil build configuration to generate bundled custom elements for easier Astro integration

Reviewed changes

Copilot reviewed 88 out of 92 changed files in this pull request and generated 23 comments.

Show a summary per file
File Description
xo.config.js Excludes stencil-showcase from linting
showcases/stencil-showcase/tsconfig.json Replaces Angular config with Astro config, points to output/astro
showcases/stencil-showcase/package.json Replaces Angular build scripts with Astro, updates dependencies
showcases/stencil-showcase/astro.config.mjs New Astro configuration with Vite plugin for copying Stencil bundle
showcases/stencil-showcase/src/**/*.astro New Astro component pages replacing Angular components
packages/components/src/utils/index.ts Fixed boolean string parsing to check 'true'/'false' explicitly
packages/components/src/components/*/ Various component updates for Astro compatibility (page, header, navigation-item, drawer, custom-select, accordion, accordion-item)
packages/components/configs/plugins/astro/ New Mitosis plugin for generating Astro components
packages/components/configs/mitosis.config.cjs Added Astro as compilation target
packages/components/scripts/post-build/stencil.ts Added logic to remove duplicate Astro-rendered elements on hydration
output/stencil/stencil.config.ts Added bundled custom elements output target
showcases/e2e/default.ts Updated routing logic to handle Astro's non-hash routing
showcases/e2e/header/*.spec.ts Removed stencil skip conditions for header tests
Comments suppressed due to low confidence (1)

packages/components/src/utils/index.ts:111

  • The change from checking Boolean(originBool) to explicitly checking originBool === 'true' for string values is significant and could break existing code.

The old behavior: Boolean('false') returns true (any non-empty string is truthy)
The new behavior: 'false' === 'true' returns false

This is actually a bug fix, but it's a breaking change. Any code that was passing the string 'false' and expecting it to be treated as truthy will now be treated as falsy.

Verify that:

  1. All usages in the codebase that pass boolean string values are updated
  2. This change is documented as potentially breaking
  3. Framework integrations (especially Astro with HTML attributes) correctly pass 'true'/'false' strings

Additionally, consider whether strings other than 'true' should be treated as false (e.g., should empty string '' return false or undefined?).

export const getBoolean = (
	originBool?: boolean | string,
	propertyName?: string
): boolean | undefined => {
	if (originBool === undefined || originBool === null) return;

	if (typeof originBool === 'string') {
		return Boolean(propertyName === originBool || originBool === 'true');
	}

	return Boolean(originBool);
};

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions bot and others added 3 commits January 26, 2026 13:36
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🏘components 🛠️configuration 📕documentation Improvements or additions to documentation 🏗foundations 📺showcases Changes to 1-n showcases

Projects

Status: 🏗 In progress

Development

Successfully merging this pull request may close these issues.

2 participants