Skip to content

feat(editor): harden updateBlocks + expose editor primitives (toe-ed-… - #52

Merged
weepaho3 merged 1 commit into
mainfrom
fix/editor-dx
Jul 8, 2026
Merged

feat(editor): harden updateBlocks + expose editor primitives (toe-ed-…#52
weepaho3 merged 1 commit into
mainfrom
fix/editor-dx

Conversation

@weepaho3

@weepaho3 weepaho3 commented Jul 8, 2026

Copy link
Copy Markdown
Owner

No description provided.

…01…13)

Editor-DX pass: make the visual-editor write path safe and stop consumers
re-implementing package internals.

- toe-ed-01: updateBlocks now enforces the same structural validation as the
  single-block routes (root blockId guard, block-type existence, per-type
  property validation, placement), diff-scoped so created blocks validate
  strictly, updated/root use patch semantics, and unchanged blocks are skipped
  (a stale sibling can't brick an unrelated save).
- toe-ed-02: normalize an incoming root node type 'root' -> collection type so a
  getBlockTree->updateBlocks round-trip is lossless (mirrors merges.ts).
- toe-ed-09: apply property defaultValue to created blocks (defaults < template <
  caller) + export defaultPropertiesFor(); the field was declared + CLI-scaffolded
  but previously dead.
- toe-ed-10: link targets require .min(1) so a required link with an empty target
  is rejected instead of silently passing.
- toe-ed-04/06/07/11: export buildPlacementIndex + non-throwing isPlacementAllowed
  + allowedChildTypes + PlacementIndex; move isResolvedReference to a pure module
  exported from root (+toStoredReference); export RefMode; BlocksMap getCollection/
  getComponents accessors; parameterize BlockComponentProps by RefMode.
- toe-ed-05/08/12/13 docs: updateBlocks reference section + editor-guide notes
  (getTemplateDefaults prefill, blk_ id minting, runtime placement helpers).

Adversarial review caught 2 real defects in the initial toe-ed-01 (root props
bypassed validation; strict re-validation of untouched blocks could brick saves);
fixed via diff-driven scoping + 3 regression tests. 1100 tests + tsc + lint +
docs build + turbo build green.
@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
createcms-docs Building Building Preview, Comment Jul 8, 2026 10:55pm

@weepaho3
weepaho3 merged commit 6b5212c into main Jul 8, 2026
2 of 3 checks passed
@weepaho3
weepaho3 deleted the fix/editor-dx branch July 8, 2026 22:55
@github-actions github-actions Bot mentioned this pull request Jul 8, 2026
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