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

Make GCB compatible with 6.5 #178

Merged
merged 31 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
46b5a7b
Run unit and e2e tests on WP 6.5
kienstra Mar 12, 2024
3244e39
Start wp-env first
kienstra Mar 12, 2024
c0dcfed
Run unit tests on WP 6.5
kienstra Mar 12, 2024
05da109
Bump e2e test helpers
kienstra Mar 12, 2024
01849bd
Migrate away from a deprecated function
kienstra Mar 12, 2024
b060401
Change artifacts path
kienstra Mar 12, 2024
80044a8
Update wp-env
kienstra Mar 12, 2024
d010c7f
Revert "Update wp-env"
kienstra Mar 12, 2024
30152d1
Use a custom insert function
kienstra Mar 12, 2024
239444f
Log in an admin user
kienstra Mar 12, 2024
58631b5
Click 'new field
kienstra Mar 12, 2024
78741ab
Fix the 'Add a new field' selector
kienstra Mar 12, 2024
35dfc90
Click the button 'Add a new field'
kienstra Mar 12, 2024
92184ba
Remove login logic
kienstra Mar 12, 2024
39f2a68
Remove needless gulp script
kienstra Mar 12, 2024
2cb9bad
Bump wp-env to the latest
kienstra Mar 12, 2024
0b560ea
Test if 'Add a new field' is in the document
kienstra Mar 12, 2024
e225df9
Revert "Bump wp-env to the latest"
kienstra Mar 12, 2024
bb2a602
Test an element is truthy
kienstra Mar 12, 2024
2fcbd2a
Revert changes to setup file
kienstra Mar 12, 2024
3446960
Use the new post ID
kienstra Mar 12, 2024
0e0a3d3
Pass the post type from post
kienstra Mar 12, 2024
e387c0c
Remove needless useEditor()
kienstra Mar 12, 2024
11fbcc3
Revert needless changes to all-fields test
kienstra Mar 12, 2024
7170def
See if this passes test on WP 6.2
kienstra Mar 12, 2024
3e0a697
Bump Tested up to
kienstra Mar 12, 2024
8d1b376
Move WordPress back to latest for e2e tests
kienstra Mar 12, 2024
a9acbda
Handle setupEditorState() not existing
kienstra Mar 12, 2024
daacea5
Move tested WP version back to latest
kienstra Mar 12, 2024
7c950ce
Also run PHPUnit tests on PHP 8.3
kienstra Mar 12, 2024
83dd7f3
Remove needless function wrappers
kienstra Mar 12, 2024
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
2 changes: 1 addition & 1 deletion .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 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 );
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixes a console error in WP 6.5:

wp.data.dispatch( 'core/editor' ).setupEditorState is deprecated since version 6.5. Please use wp.data.dispatch( 'core/editor' ).setEditedPost instead.

} 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