Skip to content

Commit

Permalink
Make GCB compatible with 6.5 (#178)
Browse files Browse the repository at this point in the history
* Run unit and e2e tests on WP 6.5

* Start wp-env first

* Run unit tests on WP 6.5
  • Loading branch information
kienstra authored Mar 13, 2024
1 parent 4d9ba37 commit 8fb1877
Show file tree
Hide file tree
Showing 9 changed files with 182 additions and 165 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ jobs:
npm run wp-env start
npm run test:e2e
- store_artifacts:
path: /tmp/artifacts/
path: artifacts/

svn-deploy:
executor:
Expand All @@ -151,7 +151,7 @@ workflows:
only: /.*/
matrix:
parameters:
php-version: [ '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ]
php-version: [ '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ]
- js-tests:
filters:
tags:
Expand Down
2 changes: 1 addition & 1 deletion .wp-env.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"core": null,
"plugins": [ ".", "./tests/e2e/plugins/testing-blocks" ],
"phpVersion": "8.2"
"phpVersion": "8.3"
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

Contributors: lukecarbis, ryankienstra, Stino11, rheinardkorf, studiopress, wpengine
Tags: gutenberg, blocks, block editor, fields, template
Requires at least: 5.7
Tested up to: 6.3
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.0
Stable tag: 1.6.0
License: GPLv2 or later
Expand Down
17 changes: 9 additions & 8 deletions js/src/edit-block/components/editor-provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ import { EntityProvider } from '@wordpress/core-data';
// @ts-ignore type declaration not available
import { store as noticesStore } from '@wordpress/notices';

/**
* Internal dependencies
*/
import { useEditor } from '../hooks';

/**
* @typedef {Object} EditorProviderProps The props of the component.
* @property {Object} post The post for the editor.
Expand All @@ -41,19 +36,25 @@ const EditorProvider = ( {
settings,
children,
} ) => {
const { setupEditor } = useEditor();
const {
setEditedPost,
setupEditorState,
updatePostLock,
updateEditorSettings,
} = useDispatch( 'core/editor' );
// @ts-ignore type declaration not available
const { createWarningNotice } = useDispatch( noticesStore );

// Iniitialize the editor.
// Ideally this should be synced on each change and not just something you do once.
useLayoutEffect( () => {
updatePostLock( settings.postLock );
setupEditor( post );

if ( setEditedPost ) {
setEditedPost( post.type, post.id );
} else {
setupEditorState( post );
}

if ( settings.autosave ) {
createWarningNotice(
__( 'There is an autosave of this post that is more recent than the version below.', 'genesis-custom-blocks' ),
Expand Down
1 change: 0 additions & 1 deletion js/src/edit-block/hooks/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export { default as useBlock } from './useBlock';
export { default as useCopyToClipboard } from './useCopyToClipboard';
export { default as useEditor } from './useEditor';
export { default as useField } from './useField';
export { default as usePostTypes } from './usePostTypes';
export { default as useTemplate } from './useTemplate';
38 changes: 0 additions & 38 deletions js/src/edit-block/hooks/useEditor.js

This file was deleted.

Loading

0 comments on commit 8fb1877

Please sign in to comment.