Skip to content

docs: clarify priority ordering behavior - #1152

Merged
colinodell merged 2 commits into
thephpleague:2.10from
asllanmaciel:docs/1023-priority-ordering
Sep 9, 2026
Merged

docs: clarify priority ordering behavior#1152
colinodell merged 2 commits into
thephpleague:2.10from
asllanmaciel:docs/1023-priority-ordering

Conversation

@asllanmaciel

Copy link
Copy Markdown
Contributor

Clarifies how component priorities should be used when customizing the environment.

The documentation now explains that:

  • higher priorities are attempted first;
  • block start parsers, inline parsers, and renderers should not rely on registration order when priorities tie;
  • explicit, different priorities should be used whenever execution order matters;
  • event listeners retain their documented same-priority registration order;
  • the rendering guide explicitly calls out the renderer tie case that caused the confusion in addRenderer and addExtension inconsistency #1023.

This is documentation-only and does not change runtime behavior.

Verification:

  • git diff --check — pass
  • documentation consistency checks for the #priority links, tie guidance, and event-listener exception — pass
  • branch is 1 commit ahead / 0 behind 2.10

AI assistance was used to help review the relevant priority semantics and prepare the documentation patch; the final diff and source behavior were reviewed directly.

Refs #1023.

@colinodell

Copy link
Copy Markdown
Member

Thank you for the contribution! Overall, these changes look great and will be very helpful to users.

I'm adding a few minor tweaks, but nothing that significantly changes what you've added.

Revises the priority documentation added in the previous commit:

- Removes the claim that event listeners are exempt from same-priority
  ordering surprises. They aren't - a listener added directly still runs
  before one registered by an extension added earlier, since extensions
  don't register until the environment is first used.
- Replaces "the default priority is 0, use a higher number" with the
  ranges the core extension actually uses. Only renderers sit at 0;
  block start parsers and inline parsers span 70..-100 and 200..10.
- Explains why the same component registered directly vs. inside an
  extension behaves differently, which is the confusion behind thephpleague#1023.
- Links the word "priority" in each method description instead of
  appending a separate cross-reference sentence.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GGVgn9d4f4ZXrvga193n6U
@colinodell
colinodell merged commit 276b7ab into thephpleague:2.10 Sep 9, 2026
16 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.

2 participants