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

Create Block: Add missing viewScriptModule field #59140

Merged
merged 3 commits into from
Feb 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 packages/create-block-interactive-template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This is a template for [`@wordpress/create-block`](https://github.com/WordPress/
This block template can be used by running the following command:

```bash
npx @wordpress/create-block --template @wordpress/create-block-interactive-template
npx @wordpress/create-block --template @wordpress/create-block-interactive-template
Copy link
Contributor Author

@t-hamano t-hamano Feb 17, 2024

Choose a reason for hiding this comment

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

Minor fix

```

It requires Gutenberg 17.5 or higher.
Expand Down
2 changes: 1 addition & 1 deletion packages/create-block-tutorial-template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This is a template for [`@wordpress/create-block`](https://github.com/WordPress/
This block template can be used by running the following command:

```bash
npx @wordpress/create-block --template @wordpress/create-block-tutorial-template
npx @wordpress/create-block --template @wordpress/create-block-tutorial-template
```

Use the default options when prompted in the terminal.
Expand Down
4 changes: 4 additions & 0 deletions packages/create-block/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Bug Fix

- Add missing `viewScriptModule` field ([#59140](https://github.com/WordPress/gutenberg/pull/59140)).

## 4.35.0 (2024-02-09)

## 4.34.0 (2024-01-24)
Expand Down
2 changes: 2 additions & 0 deletions packages/create-block/lib/init-block.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ async function initBlockJSON( {
viewStyle,
render,
viewModule,
Copy link
Member

Choose a reason for hiding this comment

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

We don't need viewModule anymore in @wordpress/create-block. It's been replaced with viewScriptModule in all places now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the feedback! I would like to submit a follow-up PR.

viewScriptModule,
viewScript,
customBlockJSON,
example,
Expand Down Expand Up @@ -66,6 +67,7 @@ async function initBlockJSON( {
viewStyle,
render,
viewModule,
viewScriptModule,
viewScript,
...customBlockJSON,
} ).filter( ( [ , value ] ) => !! value )
Expand Down
2 changes: 2 additions & 0 deletions packages/create-block/lib/scaffold.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ module.exports = async (
viewStyle,
render,
viewModule,
viewScriptModule,
viewScript,
variantVars,
customPackageJSON,
Expand Down Expand Up @@ -88,6 +89,7 @@ module.exports = async (
viewStyle,
render,
viewModule,
viewScriptModule,
viewScript,
variantVars,
customPackageJSON,
Expand Down
Loading