-
-
Notifications
You must be signed in to change notification settings - Fork 327
Missing @wordpress/server-side-render dependency #292
Comments
What I discovered was, that the final package coming out from CGB Scripts is way smaller (ca. 50k) than the WP-CLI script (about 150k). I guess it comes from NOT importing all packages. ServerSideRenderer is a not recommended and not oftenly used package (I use it, though), so I guess tha's the reason why they droped it. As you wrote, you can opt it in with |
@gollenia I don't think you are supposed to actually install the You might get a different incompatible version than Gutenberg is actually running and it bloats your bundle size. Instead what should happen is that the bundler should resolve the dependency to the global When using the official /***/ "@wordpress/server-side-render":
/*!***************************************************!*\
!*** external {"this":["wp","serverSideRender"]} ***!
\***************************************************/
/***/ (function(module, exports) {
(function() { module.exports = this["wp"]["serverSideRender"]; }());
/***/ }), Can't get any smaller than that! 😄 CGB also does this for some classes correctly, but not for |
OK, I get the point. So I did it all wrong, since I also manually imported api-fetch and compose, both packages seemed to be missing. https://developer.wordpress.org/block-editor/tutorials/block-tutorial/generate-blocks-with-wp-cli/ |
Feature Request
Is your feature request related to a problem? Please describe.
It appears that the
@wordpress/server-side-render
dependency is not included by default in CGB, which makes it impossible to import theServerSideRender
component.Describe the solution you'd like
It would be good if all packages that are published for the block editor would be included in Gutenberg. See full list: https://developer.wordpress.org/block-editor/packages/
Describe alternatives you've considered
You can import it manually using
npm i @wordpress/server-side-render dependency
.Teachability, Documentation, Adoption, Migration Strategy
N/A
The text was updated successfully, but these errors were encountered: