-
Notifications
You must be signed in to change notification settings - Fork 800
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor production blocks registration 3 (#33604)
Co-authored-by: Jeremy Herve <[email protected]>
- Loading branch information
1 parent
0da71a7
commit 7693bbd
Showing
39 changed files
with
355 additions
and
710 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
projects/plugins/jetpack/changelog/refactor-production-blocks-registration-3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: other | ||
|
||
Refactor blocks registration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 15 additions & 2 deletions
17
projects/plugins/jetpack/extensions/blocks/mailchimp/edit.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 14 additions & 3 deletions
17
projects/plugins/jetpack/extensions/blocks/mailchimp/editor.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,15 @@ | ||
import registerJetpackBlock from '../../shared/register-jetpack-block'; | ||
import { name, settings } from '.'; | ||
import { registerJetpackBlockFromMetadata } from '../../shared/register-jetpack-block'; | ||
import metadata from './block.json'; | ||
import deprecatedV1 from './deprecated/v1'; | ||
import edit from './edit'; | ||
import save from './save'; | ||
import transforms from './transforms'; | ||
|
||
registerJetpackBlock( name, settings ); | ||
import './editor.scss'; | ||
|
||
registerJetpackBlockFromMetadata( metadata, { | ||
edit, | ||
save, | ||
deprecated: [ deprecatedV1 ], | ||
transforms, | ||
} ); |
112 changes: 0 additions & 112 deletions
112
projects/plugins/jetpack/extensions/blocks/mailchimp/index.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { InnerBlocks } from '@wordpress/block-editor'; | ||
|
||
export default () => <InnerBlocks.Content />; |
23 changes: 8 additions & 15 deletions
23
projects/plugins/jetpack/extensions/blocks/mailchimp/test/validate.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,14 @@ | ||
import { name, settings } from '../'; | ||
import runBlockFixtureTests from '../../../shared/test/block-fixtures'; | ||
import { settings as buttonSettings } from '../../button'; | ||
import metadata from '../block.json'; | ||
import deprecated from '../deprecated/v1'; | ||
import edit from '../edit'; | ||
import save from '../save'; | ||
|
||
/** | ||
* Update this array of blocks to contain the name and settings for all blocks | ||
* involved in this set of tests. | ||
* | ||
* Example containing multiple blocks: | ||
* ``` | ||
* const blocks = [ | ||
* { name: 'jetpack/whatsapp-button', settings }, | ||
* { name: 'jetpack/send-a-message', settings: parentSettings }, | ||
* ]; | ||
* ``` | ||
*/ | ||
const { name } = metadata; | ||
const blocks = [ | ||
{ name: `jetpack/${ name }`, settings }, | ||
{ name, settings: { ...metadata, edit, save, deprecated: [ deprecated ] } }, | ||
{ name: `jetpack/button`, settings: buttonSettings }, | ||
]; | ||
runBlockFixtureTests( `jetpack/${ name }`, blocks, __dirname ); | ||
|
||
runBlockFixtureTests( name, blocks, __dirname ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.