Skip to content

Document the BC-change attributes and per-change compatibility guides#2374

Draft
Jonas Elfering (keulinho) wants to merge 2 commits into
mainfrom
feat/bcchange-attribute-guide
Draft

Document the BC-change attributes and per-change compatibility guides#2374
Jonas Elfering (keulinho) wants to merge 2 commits into
mainfrom
feat/bcchange-attribute-guide

Conversation

@keulinho

Copy link
Copy Markdown
Contributor

Summary

The backward-compatibility guidelines still describe planned API changes (return type changes, new parameters, becoming final, …) as @deprecated annotations with reason:* notes. Since shopware/shopware#17798, such changes on symbols that stay are announced with dedicated PHP attributes from Shopware\Core\Framework\Deprecation\BCChange instead, and a PHPStan rule forbids new reason:* markers.

This updates the page accordingly:

  • @deprecated section: clarifies it is only for symbols that actually go away; planned changes use the attributes.
  • New "BC-change attributes" annotation section: the attribute family, the CallSiteCompatibilityChange / ExtenderCompatibilityChange audience interfaces, and the PHPStan validation behind it.
  • New "Announced API changes" section: an overview table of all 14 attributes with a "safe opt-in today" column, plus a quick guide per change type showing extension code that is compatible with the current and the next major version at the same time (leaning on PHP variance rules: covariant return narrowing and contravariant parameter widening can always be anticipated; positional args survive renames; multi-catch covers exception changes; overrides may pre-declare announced parameters).
  • Compatibility sheet: rows for return type, final, visibility, and added parameters now reference the attributes; return type changes become PARTIAL (announceable narrowing/widening).
  • "Add an argument" example: updated from the old @deprecated/Feature::isActive style to the current #[NewRequiredParameter] + conditional runtime deprecation pattern, including the note that framework-invoked #[Route] methods must not trigger it.

Related links

Checklist

  • I reviewed affected links, code samples, and cross-references, including PageRef references where relevant.
  • I added or updated redirects in .gitbook.yaml if pages were moved, renamed, or deleted. (no pages moved)
  • I updated .wordlist.txt (and sorted it) if spellcheck flags new legitimate terms.
  • Any required dependent changes in downstream modules have already been merged and published. (the platform PR stack above is still in review — this PR should merge together with or after it)
  • This pull request is ready for review.

Notes

Draft until the platform PR stack (17979 → 17985 → 17992 → 18011) is merged, since the page documents behavior those PRs introduce. Attribute names, constructor signatures, and validation semantics were taken directly from the implementation.

🤖 Generated with Claude Code

…guides

Planned changes to symbols that stay are no longer marked with
@deprecated reason:* notes but announced via the BCChange attribute
family. Document every attribute, who is affected (call sites vs
extending classes), which changes can safely be opted into today, and
how to write extension code that is compatible with the current and the
next major version at the same time.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@shopware-dev-docs-connector

shopware-dev-docs-connector Bot commented Jul 7, 2026

Copy link
Copy Markdown

Developer Docs healthcheck

Status: Completed with success.
Repository: shopware/docs
Commit: 3ec0aa0
Preview: https://developer-documentation-8xxbwtjix-shopware-frontends.vercel.app
Workflow run: #4387

…bute

Restructure the quick guides from two audience-grouped lists into one
guide per attribute, each stating explicitly what call sites and what
extending classes need to do — including the "nothing to do" cases with
the variance reasoning, so both audiences can check every announcement
against their code.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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