close
Skip to content

Fixed additional issues with block registration types#78416

Merged
ramonjd merged 3 commits into
WordPress:trunkfrom
joshualip-plaudit:update/additional-block-registration-types-fixes
May 19, 2026
Merged

Fixed additional issues with block registration types#78416
ramonjd merged 3 commits into
WordPress:trunkfrom
joshualip-plaudit:update/additional-block-registration-types-fixes

Conversation

@joshualip-plaudit
Copy link
Copy Markdown
Contributor

What?

Closes #78415

Updates the types to match what is missing.

Why?

The types are currently incorrect.

How?

  • I made name mandatory and separated out the types for the settings parameter from the standard BlockConfiguration parameter
  • I added "| string[]" to every script/style type

Testing Instructions

  • Try to compile the code

Use of AI Tools

  • I don't use AI tools

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 18, 2026

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: joshualip-plaudit <joshualipstone@git.wordpress.org>
Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions github-actions Bot added the [Package] Blocks /packages/blocks label May 18, 2026
@joshualip-plaudit
Copy link
Copy Markdown
Contributor Author

I'm not particularly pleased with how I had to implement the separate type for block settings parameter, so although it shouldn't break any existing properties, it might be worth it to split that into a separate PR.

@t-hamano t-hamano added the [Type] Code Quality Issues or PRs that relate to code quality label May 19, 2026
Comment thread package-lock.json
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this change related?

Copy link
Copy Markdown
Contributor Author

@joshualip-plaudit joshualip-plaudit May 19, 2026

Choose a reason for hiding this comment

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

Oh. Shoot. It's not strictly related - I just couldn't get anything to build until I ran npm up and then accidentally committed it after I ran the command to update the readme. TypeScript was giving me errors that implied that the version of ajv being loaded was horribly out of date.

(I've removed it)

@joshualip-plaudit joshualip-plaudit force-pushed the update/additional-block-registration-types-fixes branch from 464b139 to 0617cc5 Compare May 19, 2026 04:04
Copy link
Copy Markdown
Member

@ramonjd ramonjd left a comment

Choose a reason for hiding this comment

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

Just left a non-blocking question about the & { name?: unknown } and potential typing looseness.

Thanks!!

Comment thread packages/blocks/src/api/registration.ts
@ramonjd ramonjd enabled auto-merge (squash) May 19, 2026 06:46
@ramonjd ramonjd merged commit e0cede8 into WordPress:trunk May 19, 2026
41 of 43 checks passed
@github-actions github-actions Bot added this to the Gutenberg 23.3 milestone May 19, 2026
@joshualip-plaudit joshualip-plaudit deleted the update/additional-block-registration-types-fixes branch May 19, 2026 17:46
@arthur791004 arthur791004 added the [Package] Block editor /packages/block-editor label May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Block editor /packages/block-editor [Package] Blocks /packages/blocks [Type] Code Quality Issues or PRs that relate to code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Type issues in registerBlockType and BlockType

4 participants