Repository navigation
Description
Shortcode has been stable since its first release. I treated every 0.x minor as a major version, but never tagged 1.0, mostly because there was always one more idea to finish first. This plan makes the version numbers reflect what the code has been for years. Below is an outline of the gradual release plan for versions 0.x, 1.x and 2.x. Where possible, changes will be backported or reimplemented on the older branches on a best-effort basis. From now on the library will follow SemVer fully.
| version | branch | PHP |
|---|---|---|
| 0.8 | master |
>=5.3 |
| 1.x | 1.x |
^7.2|^8.0 |
| 2.x | 2.x |
^8.2 |
0.8
The 0.x line will keep using master and support PHP 5.3 and above. PHP 5.3 to 7.1 is only ~0.5% of installs over the past year, so I expect that virtually all projects will move to 1.x.
- tagged on current
master, includingHybridParser, - I propose to rename
HybridParsertoStackParserbefore tagging,- it finds shortcode tags and resolves their structure with a stack in a single pass,
- internal classes marked
@internal,finalevent classes, - other improvements that do not require a newer PHP version.
1.x
This line branches off master and raises the minimum version to PHP 7.2. PHP 7.2 to 8.1 is ~7% of installs over the past three months. The goals of this version include using the newer PHP features and tagging the official 1.0, while acting as a bridge towards the 2.x line.
- native parameter and return types,
- removal of methods deprecated in
0.x, - CI and tooling for PHP 7.2 or newer,
- after
1.0, I propose to rename the other parsers to properly reflect their mechanisms:RegexParserbecomesPatternParser, it matches whole shortcodes with one regex,RegularParserbecomesGrammarParser, it tokenizes the input, then uses a recursive descent parser with grammar rules,
- the old parser names will work and stay deprecated until
2.x, which removes their aliases.
2.x
It branches off 1.x shortly after 1.0 is ready. It raises the minimum version to PHP 8.2, uses the new features and continues development.
Suggestions and comments are welcome below.
Activity
thunderer commentedon Nov 9, 2026
Hello @rhukster, you may remember that I asked you to rename
TarsParsertoHybridParser. I finally worked out the plan above, including the proposed names for the parsers. I wanted to ask you about renaming yours before tagging0.8.Per the plan above, would renaming
HybridParsertoStackParserbe okay for you? I would like to do this before the release, so that the name describes how it works. It was never part of a tagged release, so I would rename it without a deprecated alias. I see that Grav uses your fork, so switching to the official0.8(and1.0) would mean updating that constraint and the class reference.Also,
1.xwould require PHP 7.2, so it fits Grav 1.7 (^7.3.6) as well as Grav 2.x.2.xwould require PHP 8.2.Please let me know if you have anything on the Grav side that I should take into account. Thank you again for your contributions.
rhukster commentedon Nov 9, 2026
@thunderer no problem with the name change to
StackParser... if you could leave an alias forHybridParserto stack parser that would help with any weird situations in Grav where people are playing with the composer requirements and update to 1.0 stable while Grav is still configured withHybridParser. I'll switch back to your 1.0 stable when it's released and set the default going forward to StackParser. Thanks for reaching out.thunderer commentedon Nov 9, 2026
@rhukster will do!