-
Notifications
You must be signed in to change notification settings - Fork 0
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
Update blocks to build using wp-scripts, register with block.json. Test with WordPress 6.5 #47
Comments
The blocks to retain are:
|
What should I do about this?
Should I be bothered by the last message produced by running npm install?
Running
Running
|
Add the following to
change license to
See also bobbingwide/sb-debug-block#1 This change can also be applied retrospectively to other plugins that use |
When refactoring the oik-block/person block I was getting the following message The block was being registered in the server using the following code.
It took me a while to realise that the $args parameter was not being passed on the register call.
|
Internationalise and localize using the solution developed for oik, which is documented in bobbingwide/sb-post-edit-block#5 |
Updating wp-scripts today... The following package versions were changed: |
Since this is still open, it's time to update to wp-scripts v26.12.0 |
update wp-scripts to v27.4.0 |
The oik-blocks plugin was originally built using webpack.
When used in WordPress 5.8 the Widget block editor produces a "doing it wrong" message due to the enqueueing of wp-editor;
This is used for Server Side Rendering
It seems the best solution is to rework the code to build it using wp-scripts which will enable use of
import ServerSideRender from '@wordpress/server-side-render';
See bobbingwide/bobbingwide#30 (comment)
It also is dependent upon
wp-editor
for other functions such asgetPermalinkParts
, which is used by theoik-block/blockinfo
block. Whenwp-editor
is not enqueued the Widget block editor fails with:I don't yet know how to resolve this additional problem.
Note: When
wp-editor
is not enqueued the Block editor fails earlier than the Block widget editor, withUncaught TypeError: Cannot read property 'ServerSideRender' of undefined
.Requirements
block.json
Proposed solution
webpack.config.js
and.babelrc
package.json
block.json
for each blockindex.js
to register the blockblock.json
get_block_wrapper_attributes()
, where applicablenode_modules
and rebuildProcess for updating node_modules
node_modules
foldernpm install
npm install @wordpress/scripts --save-dev
See https://developer.wordpress.org/block-editor/reference-guides/packages/packages-scripts/
The text was updated successfully, but these errors were encountered: