Skip to content

Block classes in PHP #3

Closed
Closed

Description

@n4ff4h

Each block has a PHP class that defines its attributes, validation rules, server-side rendering (Blade and React) and the JS module that implements it in the editor. A block registry that apps and other packages register blocks with.

Activity

  1. added
    next-genNext-gen Javaabu packages
    featurePackage feature from the spec
    on Nov 4, 2026
  2. n4ff4h commented on Nov 5, 2026

    @n4ff4h
    CollaboratorAuthor

    Done on main. The contract is on the epic: #14 (comment)

    Javaabu\BlockEditor\Blocks\Block defines the name, group, content expression, allowed marks, attributes() (Attribute::string()/url()/enum()/… with defaults, rules, settings inputs and Thaana), rules(), sanitize(), render() (Blade view), $script (the manifest asset with the JS half) and menu metadata. The registry is the BlockEditor facade (register, forget, profile, editorConfig, scripts).

    The React half is defineBlock({ name, extensions, render, insert, … }) + registerBlock(), in a registry shared on globalThis. Decision: a block with only a PHP class still works in the editor. A generic node is built from its config (a card plus the settings panel for leaves, an outlined area for text and containers), so the JS module is optional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurePackage feature from the specnext-genNext-gen Javaabu packages

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions