Uploaded image for project: 'Red Hat Developer Hub Bugs'
  1. Red Hat Developer Hub Bugs
  2. RHDHBUGS-986

Dynamic plugin loaded plugins that uses MUI v5 looks different then static loaded plugins

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • 1.9.0
    • 1.3.0, 1.4.0, 1.5.0, 1.6.0
    • Dynamic Plugins
    • None
    • RHDH Dynamic Plugins 3278, RHDH Plugins 3279, RHDH Plugins 3280

      Description of problem:

      Dynamic plugins are loaded via a (webpack) federation. However, plugins loaded with that look different (buggy) than plugins loaded statically. We have a workaround (see https://github.com/janus-idp/backstage-plugins/pull/2183), which we added in 1.4 also to our wrappers (see https://github.com/janus-idp/backstage-showcase/pull/2022).

      Plugins wrappers or plugins must include currently this workaround if they using MUI v5 components:

      import { unstable_ClassNameGenerator as ClassNameGenerator } from '@mui/material/className';
      
      ClassNameGenerator.configure(componentName => {
        return componentName.startsWith('v5-')
          ? componentName
          : `v5-${componentName}`;
      })
      

      But this will not work when users build the plugins their own. Locally or on a cluster.

      Some options:

      1. If there a way that we share also (as a webpack singleton) the ClassNameGenerator?
      2. Can the janus cli automatically adds this code if the package.json contains @mui/* with the version 5.? (maybe 6. as well)

      Prerequisites (if any, like setup, operators/versions):

      Steps to Reproduce

      Build, for example, the Bulk import plugin and install it into the dynamic-plugins-root of your showcase:

      npx @janus-idp/cli package export-dynamic-plugin --dynamic-plugins-root ~/git/janus-idp/backstage-showcase/dynamic-plugins-root --dev
      

      Actual results:

      The Repository | Organization switcher on the first page from the add flow is broken (no padding)

      Expected results:

      The Bulk import add flow should work.

      Reproducibility (Always/Intermittent/Only Once):

      Always

      Build Details:

      Latest main

      Additional info (Such as Logs, Screenshots, etc):

        1. screenshot-1.png
          294 kB
          Stan Lewis
        2. screenshot-2.png
          319 kB
          Stan Lewis
        3. screenshot-3.png
          142 kB
          Stan Lewis
        4. screenshot-4.png
          38 kB
          Stan Lewis
        5. screenshot-5.png
          7 kB
          Stan Lewis
        6. screenshot-6.png
          148 kB
          Stan Lewis

              stlewis_2 Stan Lewis
              cjerolim Christoph Jerolimov
              RHIDP - Plugins
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: