Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build: Fix components exports after refactor #957

Merged
merged 1 commit into from
May 31, 2017
Merged
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
1 change: 1 addition & 0 deletions blocks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ import './library';
// and then stored as objects in state, from which it is then rendered for editing.
export * from './api';
export { default as Editable } from './editable';
export { default as MediaUploadButton } from './media-upload-button';
2 changes: 2 additions & 0 deletions components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ export { default as Dashicon } from './dashicon';
export { default as FormToggle } from './form-toggle';
export { default as IconButton } from './icon-button';
export { default as Panel } from './panel';
export { default as PanelHeader } from './panel/header';
export { default as PanelBody } from './panel/body';
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to treat nested components the same as top-level? Wondering if either Panel.Body or import PanelBody from 'components/panel/header'; are better alternatives.

Copy link
Member

Choose a reason for hiding this comment

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

The problem with import PanelBody from 'components/panel/header' is that it will cause the code to be duplicated across builds. This may be solvable via some trick I don't know about, see #941.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for context @nylen . I'm finding I'm reading the sequence of these pull requests very much out of order 😛

export { default as Placeholder } from './placeholder';
export { default as Spinner } from './spinner';
export { default as Toolbar } from './toolbar';
Expand Down
6 changes: 5 additions & 1 deletion components/panel/body.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
* WordPress dependencies
*/
import { Component } from 'element';
import { IconButton } from 'components';

/**
* Internal dependencies
*/
import IconButton from '../icon-button';

class PanelBody extends Component {
constructor( props ) {
Expand Down