wp-php-toolkit/bytestream
ByteStream component for WordPress.
v0.9.0
298K downloads/mo
#2990 most downloaded on Packagist
wp-php-toolkit/bytestream
What this package is like to depend on
Last release 3 months ago
14 May 2026
Release timing varies
gaps range from 2 weeks to 7 months
Rarely documented
notes for 9 of 40 stable releases
Nothing withdrawn
no release was ever pulled
1 years old
49 releases · first in 2025
13 releases in the last 12 months
see the full history below
Release timeline
15 releases · May 2025 to May 2026Releases
latest 49-
v0.9.014 May 2026 -
v0.8.1no date -
v0.8.0no date -
v0.7.9no date -
v0.7.8no date -
v0.7.7no date -
v0.7.6no date -
v0.7.503 May 2026Release notes
Open source →Summary
The toolkit now documents itself using only its own runtime and its
own structured-data parsers. No Python in CI; no hand-rolled regex over
markdown or HTML.What changed
Was Now bin/_docs_components.py(200 lines, dead-code dicts)deleted bin/_load_catalog.py(370 lines: hand-rolled YAML-subset parser,regex section splitter, regex snippet extractor) replaced with proper parsers bin/build-reference.py(220 lines)bin/build-reference.phpbin/run-snippets.py(230 lines)bin/run-snippets.phpbin/serve-docs.py(50 lines)bin/serve-docs.php(usesphp -Swith router) Parsers
Surface Parser README YAML frontmatter ( slug,title,install,credit_*,see_also)Webuni\FrontMatter\FrontMatter::parse()— alreadyvendored under components/Markdown/vendor-patched/for the Markdowncomponent. Single-line, multi-line `key: `, and YAML lists all behave correctly. The same parser GitHub uses for the README's frontmatter table. Markdown body → AST League\CommonMark\Parser\MarkdownParser+walking the document. Section boundaries = Headingnodes at level 2.Snippets = HtmlBlock(<!-- snippet: -->) →FencedCode(info=php)tuples. Expected-output = HtmlBlock(<!-- expected-output -->) →FencedCodepair. Body content rendered viaHtmlRenderer::renderNodes()so raw HTML round-trips verbatim.Pitfall callouts (HtmlBlocks of the form <p>Footgun: …</p>)WP_HTML_Tag_Processor— walks tokens, confirms a<p>opener,finds the first inner #textnode, classifies, strips theFootgun:/Gotcha:prefix viaset_modifiable_text(), then slices off the outer<p>...</p>by length (no regex).Lede paragraph → inline HTML (no outer <p>)Render the lede Paragraphnode's inline children directly viaHtmlRenderer::renderNodes()instead of slicing afterward.Snippet metadata comment (`<!-- snippet: filename: x.php\nrunnable: true\n-->`) String slicing of literal <!--/-->delimiters — noregex. --updatewriting captured stdout back into a README**CommonMark AST** locates the snippet's exact line range; line-by-line splice. No regex over the README. Behavioural parity
- 87/87 snippets match their captured stdout. The PHP normalizer
mirrors the Python regex set 1:1, so existing expected-output blocks
stay valid. docs/reference/*.htmlrender correctly: 9<php-snippet>+ 9
fallback + 9 expected-output triples onhtml.html, 4 pitfall callouts
(the bold-lead pattern is preserved), see-also list intact.--updateverified end-to-end:- When an expected-output block has drifted, the rewritten content is
byte-for-byte the original. - When no expected-output exists for a snippet,
--updateinserts a
fresh block in the right place; resulting README is byte-identical to
one with the block authored manually.
Frontmatter format change:
see_alsois a proper YAML list# Before (repeated keys — not standard YAML) see_also: a | A | reason see_also: b | B | reason # After see_also: - a | A | reason - b | B | reason
Webuni\FrontMatter\FrontMattercorrectly types it as a sequence; any
frontmatter-aware tool reading the README sees the same shape. All 18
component READMEs migrated.Workflows simplified
snippet-tests.ymldrops theactions/setup-pythonstep.docs.ymlswapspython3 bin/build-reference.pyforphp bin/build-reference.php.
Remaining
preg_*calls (all on plain text, not HTML)slugify()— heading text → URL-safe slug.normalize()— scrubs noise from snippet stdout (tempfile paths, git
hashes, timestamps).- One pattern in run-snippets that matches the
require '...autoload.php';line in the snippet's PHP source to inject the
local-prelude polyfill.
These operate on plain strings, not HTML, so they're not what the "no
regex over HTML" rule was about.Test plan
-
Verify docs snippetsworkflow passes (87/87). -
Deploy docs to GitHub Pagesruns cleanly on push to trunk. - Local preview:
bash bin/build-docs-bundle.sh && php bin/serve-docs.php— http://localhost:8787 renders all reference pages
with snippets. -
php bin/run-snippets.php --update(no-op, no drift) leaves all
READMEs untouched.
- 87/87 snippets match their captured stdout. The PHP normalizer
-
v0.7.4no dateRelease notes
Open source →Summary
The toolkit now documents itself using only its own runtime and its
own structured-data parsers. No Python in CI; no hand-rolled regex over
markdown or HTML.What changed
Was Now bin/_docs_components.py(200 lines, dead-code dicts)deleted bin/_load_catalog.py(370 lines: hand-rolled YAML-subset parser,regex section splitter, regex snippet extractor) replaced with proper parsers bin/build-reference.py(220 lines)bin/build-reference.phpbin/run-snippets.py(230 lines)bin/run-snippets.phpbin/serve-docs.py(50 lines)bin/serve-docs.php(usesphp -Swith router) Parsers
Surface Parser README YAML frontmatter ( slug,title,install,credit_*,see_also)Webuni\FrontMatter\FrontMatter::parse()— alreadyvendored under components/Markdown/vendor-patched/for the Markdowncomponent. Single-line, multi-line `key: `, and YAML lists all behave correctly. The same parser GitHub uses for the README's frontmatter table. Markdown body → AST League\CommonMark\Parser\MarkdownParser+walking the document. Section boundaries = Headingnodes at level 2.Snippets = HtmlBlock(<!-- snippet: -->) →FencedCode(info=php)tuples. Expected-output = HtmlBlock(<!-- expected-output -->) →FencedCodepair. Body content rendered viaHtmlRenderer::renderNodes()so raw HTML round-trips verbatim.Pitfall callouts (HtmlBlocks of the form <p>Footgun: …</p>)WP_HTML_Tag_Processor— walks tokens, confirms a<p>opener,finds the first inner #textnode, classifies, strips theFootgun:/Gotcha:prefix viaset_modifiable_text(), then slices off the outer<p>...</p>by length (no regex).Lede paragraph → inline HTML (no outer <p>)Render the lede Paragraphnode's inline children directly viaHtmlRenderer::renderNodes()instead of slicing afterward.Snippet metadata comment (`<!-- snippet: filename: x.php\nrunnable: true\n-->`) String slicing of literal <!--/-->delimiters — noregex. --updatewriting captured stdout back into a README**CommonMark AST** locates the snippet's exact line range; line-by-line splice. No regex over the README. Behavioural parity
- 87/87 snippets match their captured stdout. The PHP normalizer
mirrors the Python regex set 1:1, so existing expected-output blocks
stay valid. docs/reference/*.htmlrender correctly: 9<php-snippet>+ 9
fallback + 9 expected-output triples onhtml.html, 4 pitfall callouts
(the bold-lead pattern is preserved), see-also list intact.--updateverified end-to-end:- When an expected-output block has drifted, the rewritten content is
byte-for-byte the original. - When no expected-output exists for a snippet,
--updateinserts a
fresh block in the right place; resulting README is byte-identical to
one with the block authored manually.
Frontmatter format change:
see_alsois a proper YAML list# Before (repeated keys — not standard YAML) see_also: a | A | reason see_also: b | B | reason # After see_also: - a | A | reason - b | B | reason
Webuni\FrontMatter\FrontMattercorrectly types it as a sequence; any
frontmatter-aware tool reading the README sees the same shape. All 18
component READMEs migrated.Workflows simplified
snippet-tests.ymldrops theactions/setup-pythonstep.docs.ymlswapspython3 bin/build-reference.pyforphp bin/build-reference.php.
Remaining
preg_*calls (all on plain text, not HTML)slugify()— heading text → URL-safe slug.normalize()— scrubs noise from snippet stdout (tempfile paths, git
hashes, timestamps).- One pattern in run-snippets that matches the
require '...autoload.php';line in the snippet's PHP source to inject the
local-prelude polyfill.
These operate on plain strings, not HTML, so they're not what the "no
regex over HTML" rule was about.Test plan
-
Verify docs snippetsworkflow passes (87/87). -
Deploy docs to GitHub Pagesruns cleanly on push to trunk. - Local preview:
bash bin/build-docs-bundle.sh && php bin/serve-docs.php— http://localhost:8787 renders all reference pages
with snippets. -
php bin/run-snippets.php --update(no-op, no drift) leaves all
READMEs untouched.
- 87/87 snippets match their captured stdout. The PHP normalizer
-
v0.7.3no dateNothing published for this version
-
v0.7.229 Apr 2026Nothing published for this version
-
v0.7.1no dateNothing published for this version
-
v0.7.0no dateNothing published for this version
-
v0.6.210 Apr 2026Nothing published for this version
-
v0.6.1no dateNothing published for this version
-
v0.6.0no dateNothing published for this version
-
v0.5.111 Sep 2025Nothing published for this version
-
v0.5.0no dateNothing published for this version
-
v0.4.1no dateNothing published for this version
-
v0.4.0no dateNothing published for this version
-
v0.3.1no dateNothing published for this version
-
v0.3.0no dateNothing published for this version
-
v0.2.0no dateNothing published for this version
-
v0.1.5no dateNothing published for this version
-
v0.1.4no dateNothing published for this version
-
v0.1.308 Sep 2025Nothing published for this version
-
v0.1.208 Sep 2025Nothing published for this version
-
v0.1.1no dateNothing published for this version
-
v0.1.0no dateNothing published for this version
-
0.0.19no dateNothing published for this version
-
0.0.18no dateNothing published for this version
-
0.0.17no dateNothing published for this version
-
0.0.16no dateNothing published for this version
-
0.0.15no dateNothing published for this version
-
v0.0.15-alphano date pre-releaseNothing published for this version
-
0.0.14no dateNothing published for this version
-
0.0.13no dateNothing published for this version
-
0.0.12no dateNothing published for this version
-
0.0.1106 Sep 2025Nothing published for this version
-
v0.0.8-alpha08 Sep 2025 pre-releaseNothing published for this version
-
0.0.706 Sep 2025Nothing published for this version
-
v0.0.7-alpha08 Sep 2025 pre-releaseNothing published for this version
-
0.0.606 Sep 2025Nothing published for this version
-
v0.0.6-alpha08 Sep 2025 pre-releaseNothing published for this version
-
v0.0.5-alpha04 Jun 2025 pre-releaseNothing published for this version
-
v0.0.4-alphano date pre-releaseNothing published for this version
-
v0.0.3-alphano date pre-releaseNothing published for this version
-
v0.0.2-alpha20 May 2025 pre-releaseNothing published for this version
-
v0.0.1-alphano date pre-releaseNothing published for this version