Skip to content

Towards 1.0 and beyond #135

Open
Open

Description

@thunderer

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, including HybridParser,
  • I propose to rename HybridParser to StackParser before tagging,
    • it finds shortcode tags and resolves their structure with a stack in a single pass,
  • internal classes marked @internal, final event 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:
    • RegexParser becomes PatternParser, it matches whole shortcodes with one regex,
    • RegularParser becomes GrammarParser, 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

  1. added this to the 1.0 milestone on Nov 9, 2026
  2. self-assigned this
    on Nov 9, 2026
  3. thunderer commented on Nov 9, 2026

    @thunderer
    OwnerAuthor

    Hello @rhukster, you may remember that I asked you to rename TarsParser to HybridParser. I finally worked out the plan above, including the proposed names for the parsers. I wanted to ask you about renaming yours before tagging 0.8.

    Per the plan above, would renaming HybridParser to StackParser be 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 official 0.8 (and 1.0) would mean updating that constraint and the class reference.

    Also, 1.x would require PHP 7.2, so it fits Grav 1.7 (^7.3.6) as well as Grav 2.x. 2.x would 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.

  4. rhukster commented on Nov 9, 2026

    @rhukster
    Contributor

    @thunderer no problem with the name change to StackParser ... if you could leave an alias for HybridParser to 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 with HybridParser. 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.

  5. thunderer commented on Nov 9, 2026

    @thunderer
    OwnerAuthor

    @rhukster will do!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions