-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Proof of concept: render a Gutenberg component in Calypso DevDocs #26088
Conversation
|
@youknowriad, any ideas why it happens? Did we simply miss it? |
@mmtr @gziolo Good catch, the WordPress/gutenberg#7640 has been updated and should be ready for a final review before merging which hopefully will simplify the work being done here. |
Thanks both @gziolo @youknowriad! I'm no longer getting those errors :) |
@gziolo I'm trying to compile the Not sure why the Did I skip any step for building the packages locally? |
While I understand the reasoning behind this change, I have some concerns about it. I tend to think we should reconsider this and only override styles with CSS. Sass files and sass variables are not an officially supported API in our npm packages. |
Thanks @youknowriad, I see your point. But that would depend on how we want to deliver the So the question now is, do we want to customize the Gutenberg components in Calypso in order to match the Calypso visual identity or is ok to leave them as originally defined by Gutenberg. What do you think @ehg? |
@mmtr, we are merging |
Thanks for the update @gziolo! Do you you have any plan for start working on the |
|
…ent' into try/gutenberg-devdocs-poc-component # Conflicts: # client/devdocs/design/gutenberg.jsx # npm-shrinkwrap.json # package.json
For the record, |
I have just updated the description describing a new issue we have related to the |
✨ This also ties in nicely as part of #26180 |
See #26088 (comment) |
} else { | ||
// jquery is only needed in the build for the desktop app | ||
// see electron bug: https://github.com/atom/electron/issues/254 | ||
webpackConfig.externals.push( 'jquery' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does @wordpress/components
still depend on jQuery?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep. @wordpress/components
needs @wordpress/api-fetch
, and this one needs jQuery
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Complete aside, but if you type y on a GitHub file view, it'll give you a permanent link to the file like so: https://github.com/WordPress/gutenberg/blob/348e463b7cbdd246cf0744f6fa1459fefd0f37a7/packages/components/package.json#L28 (so the highlighted line remains the same if folks click on it in the future)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I totally misread the summary of WordPress/gutenberg#7566, they're starting to move away from jQuery
but it's still a dep
I had a chat with @blowery and @mmtr, and the issue is that we don't declare var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties")); Next steps to remove this blocker:
|
We landed WordPress/gutenberg#8057 and published updated packages to npm. You shouldn't need to provide |
everything looks good so far with the the goal of this was to identify potential blockers and I think we're done with that :) thanks everyone involved! |
DO NOT MERGE
Work in progress
Summary
The next step of the current work for integrating the Gutenberg blocks in Calypso is to develop a proof on concept prototyping what a single Gutenberg block should look like in the new "Gutenberg Blocks" section in the DevDocs.
As the Gutenberg
core-blocks
package is not ready yet (WordPress/gutenberg#3955), this version of the POC will use the@wordpress/components
package in order to move forward and identify potential blockers.Notes
Built on top of DevDocs: add a Gutenberg blocks section #26065, so this PR contains files that have actually modified there.DevDocs: show Gutenberg blocks #26064 mergedAs the npm packages are not published yet, it's required to build them locally. I have included a git submodule for helping thatnpm package published!Tasks
@wordpress/components
as dependencyButton
Gutenberg componentButton
Gutenberg component in the Playground section@wordpress/compose
,@wordpress/deprecated
and@wordpress/dom
sub deps.Instructions
npm install
npm start
Button
component from Gutenberg should be renderedBlockers / Problems
Solved in Packages: Move the components module partially to the packages folder WordPress/gutenberg#7640@wordpress/utils
is still used, so I needed to include aresolve
inwebpack.config.js
handling itThere is a SCSS file in one of the Gutenberg components (Solved in Packages: Move the components module partially to the packages folder WordPress/gutenberg#7640scroll-lock
) that doesn't match the expected pattern for the styles (it should bestyle.scss
instead ofindex.scss
and it should be imported inpackages/components/src/styles.scss
instead of inpackages/components/src/scroll-block/index.js
). This is causing an error I have not been able to solve with any work-around, as I think it should be fixed on GutenbergStyles should be included either via a CSS loader in order to avoid the warning below.It will be solved with the newnode-sass
version (Including .css files with @import is non-standard behaviour which will be removed in future versions of LibSass. sass/node-sass#2362)Solved in Add @babel/runtime as a dependency to @wordpress/components WordPress/gutenberg#8057@babel/[email protected]
is required by the@wordpress/components
. This can be be fixed either by updating Babel in Calypso or by declaring a@babel/runtine
dependency in@wordpress/components
. Any project using@wordpress/components
will have the same issue if@babel/runtime
is not installed or if the installed version doesn’t match the one used during the package build process. It should be added to the@wordpress/components
package if we don't want to rely on the installed dependencies on a project using it, so the package works out-of-the-box.