Skip to content

v4.4.1

Choose a tag to compare

@58bits 58bits released this 19 Jul 12:38

Bug Fixes

  • @byline/adminform field paths are now identity-stable across a reorder. Editor field paths addressed array and block items by position (content[0].alt), while a drag reorder updated the rendered list without reordering the form store. Between the reorder and the save the two disagreed, so an edit made in that window was written against whichever item still occupied that index — a different item than the one on screen. Conditions evaluated against the wrong item's values, and a deferred upload could attach its file to the wrong item. Paths now carry the item's stable _id (content[id=…].alt) wherever one exists, so an item keeps its identity through any structural change; positional addressing remains as a fallback for items that have no id yet. Pending uploads and repeating-item state were moved onto the same identity, and are now discarded correctly when their item is removed.

  • @byline/corebracket characters are rejected in field, block, and collection names at boot, alongside the existing rule for dots. [ and ] delimit item selectors in instance paths, so a name containing one could not survive a parse round trip; it is now refused where it is declared rather than corrupting a path later. The check also reports an empty segment distinctly from one carrying grammar punctuation.

  • @byline/corea stray closing bracket in a declaration path is reported as malformed rather than as a wrong-dialect item index. The previous message steered authors from instance notation toward declaration notation, which is unhelpful advice for what is simply a typo.

Migrations

  • @byline/coreFieldHookContext.path and the paths passed to setFieldValue now use [id=…] selectors instead of positional indices. A field hook receives files[id=01924f…].filesGroup.generateThumbnail where it previously received files[2].filesGroup.generateThumbnail. The type is unchanged and nothing fails to compile, so a hook that parses or pattern-matches on path will stop matching silently.

    Action: review any hook that inspects path rather than passing it through. The pattern to look for is a positional regex, for example path.match(/^files\[(\d+)\]/) used to identify the current item among its siblings. Match the item's id instead — path.match(/^files\[id=([^\]]+)\]/) compared against each item's _id — or accept both forms during a transition. Hooks that only forward path to setFieldValue need no change, and setFieldValue still accepts positional paths.

Chores

  • monorepo — the Path Grammar architecture reference was reconciled against the current implementation and is now the authoritative account of every path notation Byline uses. A regression test pins the one case that distinguishes correct relative-scope arithmetic: an upload.context entry of ../ declared on a field directly on a block must climb out of the block and resolve at the document root.

All other @byline/* packages bumped to 4.4.1 in lockstep with no behavioural changes this cycle.