Skip to content

Reconsider server-side block code loading #1097

@nylen

Description

@nylen

Currently we load server-side code for our blocks by requiring each relevant file and registering blocks immediately.

The first part is fine; the second should potentially be done on init instead, if only to set an example for block implementers. (We can guarantee that register_block_type will be defined when we call it; other plugins won't be able to, and so should probably wait until init.)

The initialization was partly done this way in the original PR that added this code, but if we want to do this, then it should probably be done with a single callback for each block instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Gutenberg PluginIssues or PRs related to Gutenberg Plugin management related efforts[Feature] BlocksOverall functionality of blocks[Status] Needs More InfoFollow-up required in order to be actionable.

    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