Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-53030

Type-only PatternFly dynamic module import build warnings should be suppressed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • 4.19.0
    • Management Console
    • None
    • None
    • False
    • Hide

      None

      Show
      None

      Description of problem:

      Let's say a Console dynamic plugin imports some TypeScript types from a PatternFly package:

      import type { ThSortType } from '@patternfly/react-table/dist/esm/components/Table/base/types';
      

      This will trigger the following warning when building the plugin with webpack:

      LOG from @openshift-console/dynamic-plugin-sdk-webpack/lib/webpack/loaders/dynamic-module-import-loader ../node_modules/ts-loader/index.js??ruleSet[1].rules[0].use[0]!./components/Nav.tsx
      <w> Non-index and non-dynamic module import @patternfly/react-table/dist/esm/components/Table/base/types
      

      Since this import is type-only, it has no impact on generated module federation code and dynamic-module-import-loader should not report the above warning.

       

      Steps to Reproduce:

      1. Add the type-only import as show above to dynamic plugin code.
      2. Run plugin webpack build.
      

      Actual results:

      Build warning issued for the above type-only import.
      

      Expected results:

      No build warning for the above type-only import.
      

              vszocs@redhat.com Vojtech Szocs
              vszocs@redhat.com Vojtech Szocs
              YaDan Pei YaDan Pei
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: