Skip to content

Conversation

@nmerget
Copy link
Collaborator

@nmerget nmerget commented Jan 14, 2026

Proposed changes

resolves https://github.com/db-ux-design-system/core-team/issues/1433

This PR refactors the component showcase generation system to use Mitosis for generating examples across multiple frameworks (Angular, React, Vue, Stencil). The change enables automatic generation of framework-specific showcase examples from a single source of truth written in Mitosis's .lite.tsx format.

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-generate-examples

@changeset-bot
Copy link

changeset-bot bot commented Jan 14, 2026

⚠️ No Changeset found

Latest commit: 7c1aa64

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 the 📺showcases Changes to 1-n showcases label Jan 19, 2026
github-actions bot and others added 3 commits January 22, 2026 16:50
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot added the 🚢📀cicd Changes inside .github folder label Jan 23, 2026
github-actions bot and others added 3 commits January 23, 2026 11:55
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions bot and others added 3 commits January 23, 2026 14:38
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions bot and others added 4 commits January 27, 2026 09:25
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions bot and others added 4 commits January 27, 2026 16:32
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions bot and others added 3 commits January 28, 2026 15:17
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions bot and others added 4 commits January 29, 2026 07:35
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@nmerget nmerget marked this pull request as ready for review January 29, 2026 10:01
@nmerget nmerget moved this from 🏗 In progress to 🎁 Ready for review in UX Engineering Team Backlog Jan 29, 2026
@sarahbrng sarahbrng moved this from 🎁 Ready for review to 👀 Actively In Review in UX Engineering Team Backlog Jan 29, 2026
@mfranzke mfranzke requested a review from Copilot January 30, 2026 05:53
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 component showcase generation system to use Mitosis for generating examples across multiple frameworks (Angular, React, Vue, Stencil). The change enables automatic generation of framework-specific showcase examples from a single source of truth written in Mitosis's .lite.tsx format.

Changes:

  • Migrated component examples from framework-specific implementations to Mitosis .lite.tsx files for unified cross-framework example generation
  • Added new Mitosis plugins for handling slots, attributes, and framework-specific transformations
  • Updated build scripts and configurations to support the new Mitosis-based workflow
  • Modified test snapshots to reflect changes in generated showcase structure

Reviewed changes

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

Show a summary per file
File Description
packages/components/src/components//examples/.example.lite.tsx Added Mitosis example files for all components (radio, popover, notification, navigation, link, input, etc.)
packages/components/src/components//showcase/.showcase.lite.tsx Added Mitosis showcase wrapper files for components
packages/components/configs/plugins/**/*.cjs New Mitosis plugins for handling slots (Vue, Stencil, Angular), className mapping, and attribute passing
packages/components/configs/angular/index.cjs Updated Angular config to include new plugins for proper code generation
packages/components/configs/vue/index.cjs Added slots plugin to Vue configuration
packages/components/configs/stencil/index.cjs Added slots and attribute-passing plugins to Stencil configuration
packages/components/scripts/post-build/react.ts Added 'data-density' to rootProps array for React builds
packages/components/scripts/post-build/angular.ts Fixed output path to use dynamic outputFolder variable and removed obsolete replacements
packages/components/package.json Extended dev watch patterns to include configs folder and .cjs files
.config/.jscpd.json Excluded generated example files from code duplication checks
snapshots/**/*.yaml Updated test snapshots reflecting structural changes in generated showcases

Copy link
Collaborator

@mfranzke mfranzke Jan 30, 2026

Choose a reason for hiding this comment

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

@nmerget why are we ignoring so many files? I totally get that the false positives are a pain in the … bucket, but not checking files in total, that done't seem to be build outputs or something similar seems to be wrong as well.

@mfranzke
Copy link
Collaborator

@nmerget could you please add at least a simple description to this PR?

Copy link
Contributor

@sarahbrng sarahbrng left a comment

Choose a reason for hiding this comment

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

The branch adds complex transformation logic without visible unit tests for the plugins. Do we need a test coverage here?

);
});

node.children.push();
Copy link
Contributor

Choose a reason for hiding this comment

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

Dead Code?

);
}
}
});
Copy link
Contributor

Choose a reason for hiding this comment

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

The Angular plugin only performs string replacements whitespace fixes. However, it doesn't validate that these patterns exist before applying replacements, which could silently fail on edge cases.

bindings: {},
children: binding,
properties: {
'v-slot': key.replace(/([A-Z])/g, '-$1').toLowerCase()
Copy link
Contributor

Choose a reason for hiding this comment

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

Just an idea:

Regex patterns and string literals are repeated; these should be extracted to constants.

const KEBAB_CASE_REGEX = /([A-Z])/g;
const KEBAB_CASE_REPLACEMENT = '-$1';

const toKebabCase = (str) => str.replace(KEBAB_CASE_REGEX, KEBAB_CASE_REPLACEMENT).toLowerCase();

// Usage
SLOT: toKebabCase(key)

@@ -102,6 +106,10 @@ const getStories = ({ target, name, fragment, meta, componentName }) => {
args
);
example = changedExample;
Copy link
Contributor

Choose a reason for hiding this comment

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

The new error check if (!example) comes AFTER example is already used in processBindings(example, target, args), which could throw before the check.

);
example = changedExample;
if (!example) {
throw Error(`somethings wrong with: ${name}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: "somethings" -> "something's"

test.describe('DBNavigationItem', () => {
// Set fixed height, because of issues with angulars `ngAfterContentInit`
getDefaultScreenshotTest({
path,
fixedHeight
fixedHeight,
skip: { stencil: true }
Copy link
Contributor

Choose a reason for hiding this comment

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

please add a comment why this is skipped

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🚢📀cicd Changes inside .github folder 🏘components 🛠️configuration 📺showcases Changes to 1-n showcases

Projects

Status: 👀 Actively In Review

Development

Successfully merging this pull request may close these issues.

4 participants