magewire-backwards-compatibility

Enable backwards compatibility for Magewire v1 components migrating to v3.

262|47|Updated Oct 8, 2021
One-click install
npx skills add https://github.com/magewirephp/magewire --skill magewire-backwards-compatibility
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: magewire-backwards-compatibility
Source: https://github.com/magewirephp/magewire/tree/main/.claude/skills/magewire-backwards-compatibility
Command: npx skills add https://github.com/magewirephp/magewire --skill magewire-backwards-compatibility

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Reference for Magewire's framework-level backwards compatibility system. Use when migrating Magewire v1 (Livewire v2) code to v3, enabling BC on components, understanding wire:model / entangle / hook behavioral changes between v2 and v3, or working with the BC memo flag, deprecated v1 component APIs, and the #[HandleBackwardsCompatibility] attribute. Theme-agnostic — BC applies to any Magewire component in any Magento theme. For theme-specific BC JS implementations (e.g. Hyvä Checkout), see the matching theme's BC skill.

Core Features & Use Cases

  • Core BC layer: lib/MagewireBc/ handles compatibility via Traits and PHP attributes to expose legacy APIs and property aliases.
  • Theme-specific BC layers: per-theme BC rules controlled by memo.bc.enabled and optional JS rewrites.
  • Migration guidance: supports opt-in via #[HandleBackwardsCompatibility] or data-store flags to progressively migrate components.
  • Use Case: migrate a large Magento store with many Magewire components without rewriting every component at once.

Quick Start

Annotate your Magewire component with #[HandleBackwardsCompatibility] to enable BC and begin migrating to v3 without breaking existing v1 behavior.

Frequently Asked Questions about magewire-backwards-compatibility

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate Magewire v1 components to v3 without breaking existing behavior?▼

To migrate Magewire v1 components to v3 without breaking behavior, annotate your component with the #[HandleBackwardsCompatibility] attribute to enable the backwards compatibility layer and preserve legacy APIs.

What changed with wire:model and entangle when upgrading Magewire to v3?▼

Wire:model and entangle behavior changed between Magewire v2 and v3, requiring the core backwards compatibility layer to expose property aliases and legacy hooks for seamless migration.

Can I use Magewire backwards compatibility with any Magento theme?▼

Yes, the core Magewire backwards compatibility layer is theme-agnostic and applies to any Magewire component in any Magento theme, while theme-specific BC JS implementations require their matching theme skill.

What's the best way to progressively migrate a large Magento store with many Magewire components?▼

The best way to progressively migrate a large Magento store is to use opt-in BC features via the #[HandleBackwardsCompatibility] attribute or data-store flags, allowing you to migrate components individually without rewriting them all at once.

Why does my Magewire component behave differently after upgrading to v3?▼

Magewire v3 introduces behavioral changes to wire:model, entangle, and hooks compared to v1, which requires activating the backwards compatibility layer via memo.bc.enabled or PHP attributes to restore expected behavior.

Do I need to rewrite all my Magewire components at once when moving to v3?▼

No, you do not need to rewrite all Magewire components at once because the backwards compatibility system supports opt-in per-component migration using the #[HandleBackwardsCompatibility] attribute or data-store flags.