Skip to content

Use Statamic's own fast YAML parser where it has one - #2

Merged
DanielDarrenJones merged 7 commits into
mainfrom
use-core-yaml-parser
Nov 10, 2026
Merged

DanielDarrenJones merged 7 commits into
mainfrom
use-core-yaml-parser

Conversation

@DanielDarrenJones

@DanielDarrenJones DanielDarrenJones commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Statamic now has the same fast YAML parser in core (Statamic\Yaml\FastParser, statamic/cms#15838, merged into 6.x and due in the release after 6.40). On a Statamic version that has it, Flatpack parses with Statamic's and leaves its own copy unused. Older versions, Statamic 5 included, keep using Flatpack's, so the supported versions don't change.

  • Flatpack::statamicHasFastParser() checks once whether Statamic\Yaml\FastParser::parse() exists.
  • Flatpack::parseFrontMatter() (fields read on demand) uses Statamic's parser when it does.
  • The Yaml binding wraps Symfony's plain Yaml instead of SymfonyFast in that case, since Statamic's Yaml::parse() calls its own parser.

Checks

  • bin/parity '6.x-dev' passes locally against statamic/cms 5b605541f, with the core parser detected and in use.
  • CI passes on Statamic 5.11, latest 5 and latest 6, where Flatpack's own copy is used.
  • The merged core parser fuzzed clean against symfony/yaml 7.0.3 to 8.1 (3.36 million cases).

Statamic is getting the same parser in core. On versions that have it,
Flatpack parses with Statamic's and leaves its own copy unused; older
versions keep using Flatpack's.
@DanielDarrenJones
DanielDarrenJones changed the base branch from fast-yaml-hybrid to main November 10, 2026 14:26
@DanielDarrenJones
DanielDarrenJones marked this pull request as ready for review November 10, 2026 17:14
@DanielDarrenJones
DanielDarrenJones merged commit 0ae97b5 into main Nov 10, 2026
3 of 4 checks passed
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