Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Improves MageForge Inspector’s compatibility with Magewire-rendered blocks/templates by introducing configurable exclusion checks to avoid wrapping output that would break Magewire’s post-render wire:* attribute injection.
Changes:
- Added configurable exclusion lists (block class prefixes + template path substrings) to
InspectorHints. - Updated Inspector wrapping logic to skip excluded blocks/templates and to bypass wrapping when Magewire indicators are detected (block data key and/or
wire:*attributes in rendered HTML). - Documented the limitation/behavior in README and wired default Magewire exclusions via frontend DI.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/Model/TemplateEngine/Decorator/InspectorHints.php | Adds exclusion mechanisms and skip logic to prevent Inspector wrapping from breaking Magewire components. |
| src/etc/frontend/di.xml | Configures default frontend exclusions for Magewire block namespace prefix and template path substring. |
| README.md | Documents Inspector’s Magewire incompatibility and automatic exclusion behavior. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request improves compatibility between the Inspector and Magewire components by introducing several exclusion mechanisms to prevent rendering errors. The changes ensure that blocks and templates related to Magewire are automatically skipped by the Inspector, avoiding issues with wire attribute injection.
Inspector exclusion mechanisms for Magewire compatibility
excludedClassPrefixesandexcludedTemplatePathstoInspectorHintsto allow specifying block class prefixes and template path substrings that should be excluded from Inspector wrapping.isExcluded,isExcludedTemplate, andcontainsWireAttributesinInspectorHintsto check if a block class, template path, or rendered HTML should be excluded from Inspector wrapping.rendermethod inInspectorHintsto skip Inspector wrapping for:wire:id,wire:initial-data).Inspector exclusion mechanisms for Magewire compatibility
excludedClassPrefixesandexcludedTemplatePathstoInspectorHintsto allow specifying block class prefixes and template path substrings that should be excluded from Inspector wrapping.isExcluded,isExcludedTemplate, andcontainsWireAttributesinInspectorHintsto check if a block class, template path, or rendered HTML should be excluded from Inspector wrapping.rendermethod inInspectorHintsto skip Inspector wrapping for:wire:id,wire:initial-data).as an excluded block class prefix and
magewire/as an excluded template path in the DI configuration (di.xml).Documentation
README.mdexplaining that the Inspector is not compatible with Magewire components and that Magewire blocks are automatically excluded from inspection.