Skip to content

feat: add BlockComponents to render registered blocks as Blade components - #112

Merged
YvetteNikolov merged 4 commits into
mainfrom
feat/block-components
Oct 5, 2026
Merged

YvetteNikolov merged 4 commits into
mainfrom
feat/block-components

Conversation

@YvetteNikolov

Copy link
Copy Markdown
Contributor

Met deze change kunnen we nu gemakkelijke al onze server-side rendered blokjes gebruiken in Blade: <x-block-{namespace}-{name}>

Bijvoorbeeld een collapse nodig in je Blade template? Kun je gemakkelijk toevoegen met dit:

<x-block-yard-collapse>
    <x-block-yard-collapse-item headingText="Heading text">
        <p>Inner content</p>
    </x-block-yard-collapse-item>
</x-block-yard-collapse>

Banner nodig op je search.blade.php pagina? Doe dit:

<x-block-theme-banner>
	<h1>Zoekresultaten</h1>
</x-block-theme-banner>

Hang samen met deze PR in Yard Gutenberg https://github.com/yardinternet/plugin-yard-gutenberg/pull/104/changes#diff-b62e72f06eb91477cd58fa1e9e14a4434a5ef664eed48c78a1ea4e65421d7bea en deze PR in Brave yardinternet/brave#188

Copilot AI balanced review requested due to automatic review settings October 1, 2026 19:46
@YvetteNikolov
YvetteNikolov requested a review from a team as a code owner October 1, 2026 19:46
@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Coverage report for commit: 1049fc4
File: coverage.xml

Cover ┌─────────────────────────┐ Freq.
   0% │ ███████████████████████ │ 100.0%
  10% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  20% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  30% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  40% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  50% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  60% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  70% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  80% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  90% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
 100% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
      └─────────────────────────┘
 *Legend:* █ = Current Distribution 
Summary - Lines: 0.27% | Methods: 0.71%
FilesLinesMethodsBranches
src
   ACF.php--100.00%
   Admin.php--100.00%
   Authorization.php--100.00%
   BlockComponents.php--100.00%
   Config.php--100.00%
   DuplicatePost.php--100.00%
   Elasticsearch.php--100.00%
   FacetWP.php--100.00%
   GravityForms.php--100.00%
   Gutenberg.php--100.00%
   HookServiceProvider.php--100.00%
   Imagify.php--100.00%
   OneloginSSO.php--100.00%
   OpenIDConnect.php--100.00%
   PageGuard.php--100.00%
   Plugin.php--100.00%
   SEOPress.php--100.00%
   SearchWP.php--100.00%
   Security.php3.77%12.50%100.00%
   SimpleHistory.php--100.00%
   SimpleWPCrosspost.php--100.00%
   Theme.php--100.00%
   User.php--100.00%
   Warden.php--100.00%
src/Components
   BlockComponent.php--100.00%
src/Traits
   ParentPage.php--100.00%

🤖 comment via lucassabreu/comment-coverage-clover

@YvetteNikolov
YvetteNikolov requested a review from a team October 1, 2026 19:47
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

Coverage report for commit: e3c040d
File: coverage.xml

Cover ┌─────────────────────────┐ Freq.
   0% │ ███████████████████████ │ 100.0%
  10% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  20% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  30% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  40% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  50% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  60% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  70% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  80% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  90% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
 100% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
      └─────────────────────────┘
 *Legend:* █ = Current Distribution 
Summary - Lines: 0.27% | Methods: 0.71%
FilesLinesMethodsBranches
src
   ACF.php--100.00%
   Admin.php--100.00%
   Authorization.php--100.00%
   BlockComponents.php--100.00%
   Config.php--100.00%
   DuplicatePost.php--100.00%
   Elasticsearch.php--100.00%
   FacetWP.php--100.00%
   GravityForms.php--100.00%
   Gutenberg.php--100.00%
   HookServiceProvider.php--100.00%
   Imagify.php--100.00%
   OneloginSSO.php--100.00%
   OpenIDConnect.php--100.00%
   PageGuard.php--100.00%
   Plugin.php--100.00%
   SEOPress.php--100.00%
   SearchWP.php--100.00%
   Security.php3.77%12.50%100.00%
   SimpleHistory.php--100.00%
   SimpleWPCrosspost.php--100.00%
   Theme.php--100.00%
   User.php--100.00%
   Warden.php--100.00%
src/Components
   BlockComponent.php--100.00%
src/Traits
   ParentPage.php--100.00%

🤖 comment via lucassabreu/comment-coverage-clover

@YvetteNikolov
YvetteNikolov requested review from FreakyWizard, JasperS20, WybeBosch, Yannicvanveen and laravdiemen and removed request for a team October 1, 2026 19:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Static blocks, alias collisions, unavailable-block fallback, and nested block context require correction.

Review effort: Balanced
Findings: 4 Medium severity

Open (4)
What changed in this PR

Adds Blade components for rendering registered WordPress blocks.

Changes:

  • Registers block aliases during WordPress initialization.
  • Converts Blade attributes and slots into render_block() input.
  • Applies default block-variation attributes.
File Description
src/​Components/​BlockComponent.php Implements block rendering.
src/​BlockComponents.php Registers Blade aliases.
config/​hooks.php Enables the new hook.
src/​Theme.php Removes whitespace.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/BlockComponents.php Resolved
Comment thread src/BlockComponents.php Resolved
Comment thread src/Components/BlockComponent.php Resolved
Comment thread src/Components/BlockComponent.php Resolved
laravdiemen
laravdiemen previously approved these changes Oct 5, 2026

@laravdiemen laravdiemen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Eigenlijk vind ik het meer een backend PR voor de review maar ik ben wel een voorstander van de functionaliteit

Yannicvanveen
Yannicvanveen previously approved these changes Oct 5, 2026
@YvetteNikolov
YvetteNikolov merged commit 8c07c72 into main Oct 5, 2026
@YvetteNikolov
YvetteNikolov deleted the feat/block-components branch October 5, 2026 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants