Skip to content

Preserve runtime DOM targets in php transformer#385

Merged
chubes4 merged 1 commit into
trunkfrom
fix-liquid-bonsai-runtime-targets
Jun 30, 2026
Merged

Preserve runtime DOM targets in php transformer#385
chubes4 merged 1 commit into
trunkfrom
fix-liquid-bonsai-runtime-targets

Conversation

@chubes4

@chubes4 chubes4 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Preserve runtime-targeted inline DOM nodes as bounded raw HTML instead of lossy empty group shells.
  • Preserve runtime-targeted canvas elements in serialized block output while keeping runtime-island metadata.
  • Add artifact parity coverage for first-party canvas scripts and empty inline runtime targets like loading/status spans.

Why

Static Site Importer imports that carry first-party runtime scripts can break when the transformer reports runtime targets as metadata but omits the actual DOM nodes from generated markup. Liquid Bonsai exposed two generic cases:

  • document.getElementById('canvas').getContext('2d') needs a real <canvas id="canvas">.
  • Dynamic status/loading spans like <span id="sync-dots"></span> need the exact runtime target to survive conversion.

Testing

  • php php-transformer/tests/contract/run.php
  • php php-transformer/tests/contract/finding-contract.php
  • php php-transformer/tests/parity/run.php

AI assistance

  • AI assistance: Yes
  • Tool(s): openai/gpt-5.5 via OpenCode
  • Used for: Diagnosing the runtime target preservation gap, drafting the transformer patch, adding regression fixtures, and running targeted verification.

@chubes4 chubes4 merged commit 24757a5 into trunk Jun 30, 2026
1 check passed
@chubes4 chubes4 deleted the fix-liquid-bonsai-runtime-targets branch June 30, 2026 11:51
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.

1 participant