Skip to content

Reduce repeated lock matrix save checks - #192

Merged
noeltock merged 1 commit into
mainfrom
block-theme/trim-lock-matrix
Oct 12, 2026
Merged

noeltock merged 1 commit into
mainfrom
block-theme/trim-lock-matrix

Conversation

@noeltock

@noeltock noeltock commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Problem

The lock-mode matrix repeats the same edit, save, parse and validation sequence four times, although the distinct behavior under test is whether each mode permits insertion, removal and movement.

Solution

Keep the persistence round trip for contentOnly and all structural operation checks for all four modes. Forwarding, rendered layout and regeneration coverage stays in place.

Behavior Read first Proof
Native edited content survives serialization and reopening dev/test/authoring.runtime.test.ts Representative contentOnly round trip
Each lock mode keeps its distinct insert/remove/move policy Same file, lock-mode matrix All four matrix cases retained

Diff

+13 −11 · 1 test file · no application changes

 lock-mode matrix
-  edit → serialize → parse → validate for every mode
+  edit → serialize → parse → validate for contentOnly
   insertion, removal and movement for every mode

Testing & verification

Reviewed revision: 0834cfa9879663baae5dccbc3f084c1668037269 · Node 22.23.1

  • npm test -- dev/test/authoring.runtime.test.ts: 10 passed.
  • npm run typecheck: passed.
  • git diff --check: passed.

Exact-head CI run 38293548692 passed on Node 22.13 and 24, including full verification, package consumers and the WordPress proof job.

Not verified: runtime saving was not measured; the test case count is unchanged.

Risk / rollout

The save round trip no longer covers its cross-product with unlocked, insert and all modes. Their distinct structural checks remain. Detection: retained persistence, forwarding and regeneration assertions. Rollback: revert this test-only commit.

@noeltock
noeltock merged commit 6f066fb into main Oct 12, 2026
8 checks passed
@noeltock
noeltock deleted the block-theme/trim-lock-matrix branch October 12, 2026 19:14
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