Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "openstack-uicore-foundation",
"version": "5.0.43",
"version": "5.0.44-beta.0",
"description": "ui reactjs components for openstack marketing site",
"main": "lib/openstack-uicore-foundation.js",
"scripts": {
Expand Down
17 changes: 17 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,23 @@ import 'font-awesome/css/font-awesome.css';
import 'openstack-uicore-foundation/lib/css/components.css';
import 'sweetalert2/dist/sweetalert2.css';

## Importing Components

Prefer importing components from their individual paths rather than the
`openstack-uicore-foundation/lib/components` barrel:

```js
import UploadInputV3 from 'openstack-uicore-foundation/lib/components/inputs/upload-input-v3';
```

Components that pull in heavy 3rd-party dependencies (MUI, Stripe,
react-beautiful-dnd, etc.) are intentionally commented out of
Comment on lines +23 to +24
`src/components/index.js` (see the `// these include 3rd party deps` block)
so that consumers who don't use them aren't forced to install those peer
dependencies just to import something unrelated from the barrel. These
components are only reachable via their individual path — a barrel import
will not resolve them.

### Enviroment Variables

* TIMEINTERVALSINCE1970_API_URL = URL used on clock component to get server time
Expand Down
2 changes: 1 addition & 1 deletion src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export {default as DateTimePicker} from './inputs/datetimepicker'
export {default as GroupedDropdown} from './inputs/grouped-dropdown'
export {default as UploadInput} from './inputs/upload-input'
export {default as UploadInputV2} from './inputs/upload-input-v2'
export {default as UploadInputV3} from './inputs/upload-input-v3'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@santipalenque Removing this export still breaks one consumer in summit-admin master.

fntechgit/summit-admin#1013 migrated the barrel imports of UploadInputV3 to the path import, but src/components/forms/event-category-form.js:33 was added by #1024 (merged 55 minutes after #1013) and still does:

import { UploadInputV3 } from "openstack-uicore-foundation/lib/components";

Because lib/ is a compiled UMD bundle, a missing named export is not a build error — it resolves to undefined and the event category edit page will fail at render ("Element type is invalid") as soon as summit-admin bumps to a uicore version that includes this change.

Suggested fix: land a one-line follow-up in summit-admin switching that import to

import UploadInputV3 from "openstack-uicore-foundation/lib/components/inputs/upload-input-v3";

(same pattern as #1013) and merge it before, or together with, the uicore bump that picks this PR up.

export {default as CompanyInput} from './inputs/company-input'
export {default as PromocodeInput} from './inputs/promocode-input'
export {default as SponsorInput} from './inputs/sponsor-input'
Expand Down Expand Up @@ -135,6 +134,7 @@ export {MuiBaseCustomTheme} from './mui/MuiBaseCustomTheme'
// export {default as TextEditorV2} from './inputs/editor-input-v2'
// export {default as TextEditorV3} from './inputs/editor-input-v3'
// export {default as CompanyInputV2} from './inputs/company-input-v2.js'
// export {default as UploadInputV3} from './inputs/upload-input-v3' // @mui/material, @mui/icons-material, @mui/x-date-pickers, spark-md5, dropzone, react-dropzone
// export {default as MuiDndList} from './mui/dnd-list' // react-beautiful-dnd
// export {default as MuiSortableTable} from './mui/sortable-table/mui-table-sortable' // react-beautiful-dnd
// export {default as MuiStripePayment} from './mui/StripePayment' // @stripe/react-stripe-js, @stripe/stripe-js
Expand Down
Loading