Uploaded image for project: 'ui-users'
  1. ui-users
  2. UIU-2642

components are incorrectly imported directly from stripes-* packages

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • TBD
    • Resolution: Done
    • None
    • 8.2.0
    • None
    • stripes-force 147
    • Stripes Force
    • TBD

    Description

      Overview: One or more components are imported directly from their root @folio/stripes-* packages, which are not directly imported into the bundle, instead of via the @folio/stripes wrapper package, which is so imported, e.g.

      import { Button } from '@folio/stripes-components'; 

      must be replaced with 

       import { Button } from '@folio/stripes/components'; 
      

      Note the - after stripes is converted to a /. Likewise, imports from SSC would use @folio/stripes/smart-components.

      The current import strategy is technically incorrect since individual modules like @folio/stripes-components are not direct dependencies or peer-dependencies. Somehow yarn is not bothered and manages to provide webpack with what it needs to resolve the imports when creating the bundle. When creating the bundle with npm, however, this surfaces as an actual error and causes the job to fail. We anticipate migrating from yarn to npm within the next release or two, so while this is not urgent now, it will become so soon.

      ./src/views/AccountDetails/AccountDetails.js:import { IfPermission } from '@folio/stripes-core';
       

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                zburke Zak_Burke
                zburke Zak_Burke
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases