Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

v3.0.0💥

Latest
Compare
Choose a tag to compare
@SofiaSousa SofiaSousa released this 21 Nov 09:45
· 27 commits to master since this release

v3.0.0 Breaking changes

  • We removed react, react-dom, moment and jquery from gutenberg-js package, but it still needs those libraries to run, so don't forget to include them in your editor page. Example:
<!-- Example: -->
<script src="https://unpkg.com/[email protected]/umd/react.production.min.js"></script>
<script src="https://unpkg.com/[email protected]/umd/react-dom.production.min.js"></script>
<script src="https://unpkg.com/[email protected]/min/moment.min.js"></script>
<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
<script>window.lodash = _.noConflict();</script>
  • Also, we only have 2 style files: style.css and block-library/style.css. The editor needs both, but front end only needs the blocks style (block-library/style.css).
// Gutenberg JS Style
import '@frontkom/gutenberg-js/build/css/block-library/style.css';
// import '@frontkom/gutenberg-js/build/css/components/style.css';
// import '@frontkom/gutenberg-js/build/css/nux/style.css';
// import '@frontkom/gutenberg-js/build/css/editor/style.css';
// import '@frontkom/gutenberg-js/build/css/block-library/theme.css';
// import '@frontkom/gutenberg-js/build/css/block-library/edit-blocks.css';
import '@frontkom/gutenberg-js/build/css/style.css';
  • The index request ('/') now is 'wp/v2/themes'.
// response
[{
  theme_supports: {
    formats: ['standard', 'aside', 'image', 'video', 'quote', 'link', 'gallery', 'audio'],
    'post-thumbanials': true,
    'responsive-embeds': false,
 },
}]
  • The editor settings object requires a new property:
const settings = {
  ...
  postLock: {
    isLocked: false,
  },
 ...
};
  • New request: wp/v2/media OPTIONS Requests Upload Permissions from the REST API.
{
  headers: {
    get: value => {
      if (value === 'allow') {
        return [ 'POST' ];
      }
    },
  },
}