Overview

Parent issue #3499919: [Meta] Plan for in-browser code components
Blocked by #3498889: ComponentSource plugin for code components

To display the output of code components on a server-side rendered page, we need to create a hydration library, which the component source plugin (created in #3498889: ComponentSource plugin for code components) can attach.

Proposed resolution

  1. Take the Astro island implementation (<astro-island> element) from #3483267: [exploratory] PoC of Preact+Tailwind components editable via CodeMirror and implement it as a Drupal library. Create a solution that bundles the JavaScript code we need from Astro based on comments #18, #19, #21, and #32 in #3483267: [exploratory] PoC of Preact+Tailwind components editable via CodeMirror.
  2. Update the component source plugin (created in #3498889: ComponentSource plugin for code components) to attach the library.
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

balintbrews created an issue. See original summary.

balintbrews’s picture

Issue summary: View changes
balintbrews’s picture

Issue summary: View changes
hooroomoo’s picture

Assigned: Unassigned » hooroomoo
effulgentsia’s picture

Issue tags: +sprint

hooroomoo’s picture

crediting @larowlan for suggesting npm workspaces

hooroomoo’s picture

And @effulgentsia for coming up with the idea

hooroomoo’s picture

hooroomoo’s picture

longwave made their first commit to this issue’s fork.

hooroomoo’s picture

I still need to manually test and add docs to the MR but i think the code can be reviewed if anyone happens to comes across this,

but i will officially mark it needs review after manually testing and docs

hooroomoo’s picture

hooroomoo’s picture

Assigned: hooroomoo » Unassigned
Status: Active » Needs review
longwave’s picture

Fixed the nits.

  • hooroomoo committed b5190d77 on 0.x
    Issue #3500058 by hooroomoo, longwave, balintbrews, effulgentsia,...
hooroomoo’s picture

Status: Needs review » Fixed
effulgentsia’s picture

Issue tags: -sprint

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.