Skip to content

Type issues in registerBlockType and BlockType #78415

@joshualip-plaudit

Description

@joshualip-plaudit

Description

  • The typedef for registerBlockType does not properly encode that name is only loaded from the first parameter.
  • The typedef for BlockType does not properly accept lists of entrypoints for the script and style fields

I'll have a PR up shortly.

Step-by-step reproduction instructions

  1. Try to add multiple entrypoints to the same script or style key in a block type and then try to register it. It won't compile despite multiple entrypoints per script/style key being supported

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Metadata

Metadata

Labels

[Package] Blocks/packages/blocks[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions