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

Packages: Make usage of core-data explicit #8911

Merged
merged 4 commits into from
Aug 24, 2018
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
4 changes: 4 additions & 0 deletions edit-post/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
/**
* WordPress dependencies
*/
import '@wordpress/core-data';
import '@wordpress/editor';
import '@wordpress/nux';
Copy link
Contributor

Choose a reason for hiding this comment

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

viewport?

Copy link
Member Author

Choose a reason for hiding this comment

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

There is no explicit usage in the module so I missed it ...
I will fix.

We need to figure a more robust way 😄

Copy link
Member

Choose a reason for hiding this comment

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

There is no explicit usage in the module so I missed it ...

This confused me a bit. If there's not explicit usage, the module shouldn't need to define it?

But in looking closer, there is explicit usage:

const isMobileViewPort = () => select( 'core/viewport' ).isViewportMatch( '< medium' );

Copy link
Member Author

Choose a reason for hiding this comment

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

It was all my fault, I didn't grep properly ...

import '@wordpress/viewport';
import { registerCoreBlocks } from '@wordpress/block-library';
import { render, unmountComponentAtNode } from '@wordpress/element';
import { dispatch } from '@wordpress/data';
Expand Down
1 change: 0 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/block-library/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Core Blocks
# Block library

Core Blocks for the WordPress editor.
Block library for the WordPress editor.

## Installation

Expand Down
5 changes: 2 additions & 3 deletions packages/block-library/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@wordpress/block-library",
"version": "1.0.0",
"description": "Core Blocks of the WordPress editor.",
"description": "Block library for the WordPress editor.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
"keywords": [
Expand All @@ -20,8 +20,7 @@
"module": "build-module/index.js",
"react-native": "src/index",
"dependencies": {
"@babel/runtime": "^7.0.0-beta.52",
"@wordpress/api-fetch": "file:../api-fetch",
"@babel/runtime-corejs2": "7.0.0-beta.56",
Copy link
Member

Choose a reason for hiding this comment

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

There are local changes to master after npm install with these changes. I think we missed an update to package-lock.json.

Copy link
Member Author

Choose a reason for hiding this comment

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

I was wondering if there is a way to catch this kind of issue on Travis and fail the build. It isn’t first time when it happens.

"@wordpress/autop": "file:../autop",
"@wordpress/blob": "file:../blob",
"@wordpress/blocks": "file:../blocks",
Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/**
* WordPress dependencies
*/
import '@wordpress/core-data';
import {
registerBlockType,
setDefaultBlockName,
Expand Down
11 changes: 11 additions & 0 deletions packages/editor/src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
/**
* WordPress dependencies
*/
import '@wordpress/blocks';
import '@wordpress/core-data';
import '@wordpress/nux';
import '@wordpress/viewport';
Copy link
Contributor

Choose a reason for hiding this comment

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

I think edit-post also uses a bunch of stores, should we add theme there as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

Added in 2c4f0b0.


/**
* Internal dependencies
*/
import './store';
import './hooks';

Expand Down