Skip to content

Conversation

@nmerget
Copy link
Collaborator

@nmerget nmerget commented Oct 29, 2025

Proposed changes

The goal of this PR is to centralize all example definitions in Mitosis and automatically generate showcase outputs for all targets (React, Angular, Vue, Patternhub).

The PR provides

  • a central example contract (*.examples.meta.ts that represents a typed metadata file for all examples, including identifiers, display names, grouping, and Storybook mappings)
  • Mitosis-based showcase generation (created new *.showcase.lite.tsx components that consume the metadata, generate the corresponding React, Angular, and Vue showcase files and ensures a consistent structure across all frameworks)
  • Showcase plugin architecture (plugin mechanism that provides the correct showcase component depending on the host context)
  • Patternhub routing integration (updated routing so the button component now uses the new generated showcases and example pages)
  • Output and build adjustments (correct file extensions and include generated meta files)

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/feat-examples-plugins

@changeset-bot
Copy link

changeset-bot bot commented Oct 29, 2025

⚠️ No Changeset found

Latest commit: 094ac0c

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 bot and others added 2 commits October 30, 2025 12:03
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@michaelmkraus michaelmkraus self-assigned this Nov 19, 2025
@michaelmkraus michaelmkraus marked this pull request as ready for review November 24, 2025 08:28
@mfranzke mfranzke requested a review from Copilot November 24, 2025 09:35
Copilot finished reviewing on behalf of mfranzke November 24, 2025 09:36
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 showcase architecture to use Mitosis-based examples that can generate both showcase and Storybook files. The key change is moving from JSON-based configuration files to .lite.tsx example files that are compiled to framework-specific code, establishing a single source of truth for component examples across showcases and Storybooks.

Key Changes

  • Introduces Mitosis-based showcase architecture with .lite.tsx example files for the Button component
  • Adds path alias configuration (@components) across all showcase projects for cleaner imports
  • Removes JSON-based configuration (showcases/shared/button.json) in favor of TypeScript example files
  • Creates reusable showcase wrapper components for consistent presentation across platforms

Reviewed changes

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

Show a summary per file
File Description
packages/components/src/components/button/showcase/button.showcase.lite.tsx New main showcase component for Button using Mitosis
packages/components/src/components/button/examples/*.lite.tsx Individual example components for each Button variant/property
packages/components/src/components/button/examples/button.examples.meta.ts Metadata defining all button examples with IDs and grouping
packages/components/src/shared/showcase/*.lite.tsx Reusable wrapper components for showcase presentation
packages/components/configs/mitosis.showcase.config.cjs New Mitosis configuration for compiling showcase files
showcases/shared/showcase-plugins.tsx Plugin system for registering and retrieving showcase components
showcases/*/tsconfig.json Path alias configuration for @components across all showcases
showcases/*/vite.config.ts Vite alias configuration for @components
storybooks/react-storybook/src/stories/Variant.stories.tsx Updated to use actual DBButton component
showcases/patternhub/scripts/generate-docs-mdx.js Removed old code generation logic
output/*/tsconfig.json Excludes showcase/example files from compilation
__snapshots__/button/showcase/**/*.yaml Updated snapshots reflecting reordered examples

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Collaborator

Choose a reason for hiding this comment

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

@michaelmkraus these seem to be middle instead of bottom aligned so some elements are now positioned centered instead of block-end. Is this expected and should have happened like this with this PR ?

Copy link
Contributor

Choose a reason for hiding this comment

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

No, that change is not intentional.
The centered vs. block-end alignment in the snapshot looks like an unintended side effect, likely coming from a shared wrapper that DBInput also uses. I’ll double-check the affected CSS.

Copy link
Contributor

Choose a reason for hiding this comment

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

Found the relevant CSS and reverted it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@michaelmkraus these seem to be middle instead of top aligned so some elements are now positioned centered instead of block-start. Is this expected and should have happened like this with this PR ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Found the relevant CSS and reverted it.

@mfranzke
Copy link
Collaborator

mfranzke commented Nov 30, 2025

@michaelmkraus could you please add a description to this PR ? Why we did this change, on the expected outcome and a summary of the changes as well as what we need to do differently (in our processes) afterwards ?

github-actions bot and others added 3 commits December 2, 2025 09:04
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 📺showcases Changes to 1-n showcases

Projects

Status: 🏗 In progress

Development

Successfully merging this pull request may close these issues.

4 participants