prefer @folio/stripes exports to private paths when importing components
Description
Environment
Potential Workaround
Attachments
- 11 Aug 2021, 02:59 PM
- 11 Aug 2021, 02:58 PM
defines
Checklist
hideTestRail: Results
Activity
Zak BurkeAugust 16, 2021 at 10:58 AM
Sounds good, @Former user. The doable work here is done!

Victoria_SmelovaAugust 16, 2021 at 7:42 AM
@Zak Burke are you Ok about closing this task?
Replacing private paths with @folio/stripes path will be done in scope of https://folio-org.atlassian.net/browse/UIDEXP-247#icft=UIDEXP-247.

Vadym ShchekotilinAugust 12, 2021 at 10:15 AM
@Zak Burke I've merged changes related to JS imports, For CSS imports. I created a separate task https://folio-org.atlassian.net/browse/UIDEXP-247 and linked it to this one, as it will probably require additional effort.
Zak BurkeAugust 11, 2021 at 4:39 PM
You are correct about the CSS imports, @Vadym Shchekotilin. @John Coburn, @Ryan Berger, @Michal Kuklis, any thoughts on if/how we can do this with some webpack magic? Reaching into the private structure of stripes-components feels icky.
If not, maaaaaybe we could mitigate the ickiness by declaring, "Thou shalt provide lib/ComponentName/ComponentName.css
" for everything in stripes-components? Granted that's still icky, but at least it provides a veneer of standardization.

Vadym ShchekotilinAugust 11, 2021 at 3:00 PM
@Zak Burke I've fixed all the imports for JS, but I'm not sure if we can import CSS this way. To import CSS, we need the absolute path to the corresponding file. You may know of some webpack plugins that can help us import and export CSS this way, but I couldn't find it.
I mean that is'n possible to do something like this, because it's not possible to export CSS files from index, like we do in JS files:
Error:
Details
Assignee
Vadym ShchekotilinVadym ShchekotilinReporter
Zak BurkeZak BurkePriority
P3Story Points
1Sprint
NoneDevelopment Team
FirebirdFix versions
TestRail: Cases
Open TestRail: CasesTestRail: Runs
Open TestRail: Runs
Details
Details
Assignee

Overview: component imports should happen through the
@folio/stripes/${repo}
namespace rather than directly via the repo's private path. e.g. preferimport LocationSelection from '@folio/stripes/smart-components/LocationSelection';
instead of
import LocationSelection from '@folio/stripes-smart-components/lib/LocationSelection';
The following files contain incorrect imports:
./ui-data-export/src/settings/DataExportSettings/DataExportSettings.js:13:import { Callout } from '@folio/stripes-components'; ./ui-data-export/src/settings/MappingProfiles/DuplicateMappingProfileRoute/DuplicateMappingProfileRoute.js:4:import { stripesConnect } from '@folio/stripes-core'; ./ui-data-export/src/settings/MappingProfiles/MappingProfilesTransformationsModal/TransformationsField/TransformationFieldGroup/TransformationFieldGroup.js:11:} from '@folio/stripes-components'; ./ui-data-export/src/settings/MappingProfiles/MappingProfileDetailsRoute/MappingProfileDetailsRoute.js:8:import { stripesConnect } from '@folio/stripes-core'; ./ui-data-export/src/settings/MappingProfiles/MappingProfilesForm/FolioRecordTypeField/utils/constants.js:5:import { InfoPopover } from '@folio/stripes-components'; ./ui-data-export/src/settings/MappingProfiles/EditMappingProfileRoute/EditMappingProfileRoute.js:6:import { stripesConnect } from '@folio/stripes-core'; ./ui-data-export/src/components/MultiColumnList/GridCell/GridCell.css:2: composes: mclCell from '@folio/stripes-components/lib/MultiColumnList/MCLRenderer.css'; ./ui-data-export/src/components/MultiColumnList/GridCell/GridCell.css:3: composes: mclCellStyle from '@folio/stripes-components/lib/MultiColumnList/MCLRenderer.css'; ./ui-data-export/src/components/MultiColumnList/HeaderGridRow/HeaderRow.css:2: composes: mclHeaderRow from '@folio/stripes-components/lib/MultiColumnList/MCLRenderer.css'; ./ui-data-export/src/components/MultiColumnList/HeaderGridRow/HeaderRow.css:6: composes: mclHeader from '@folio/stripes-components/lib/MultiColumnList/MCLRenderer.css'; ./ui-data-export/src/components/MultiColumnList/GridRow/GridRow.css:2: composes: mclRow from '@folio/stripes-components/lib/MultiColumnList/MCLRenderer.css'; ./ui-data-export/src/components/MultiColumnList/GridRow/GridRow.css:6: composes: mclIsOdd from '@folio/stripes-components/lib/MultiColumnList/MCLRenderer.css';
Attn: @Viktor Soroka