Skip to content

Bugfix: DI is compiling#204

Merged
wpoortman merged 2 commits intomagewirephp:upgrade/hcfrom
JeroenBoersma:bugfix/di-compiling
Mar 26, 2026
Merged

Bugfix: DI is compiling#204
wpoortman merged 2 commits intomagewirephp:upgrade/hcfrom
JeroenBoersma:bugfix/di-compiling

Conversation

@JeroenBoersma
Copy link
Copy Markdown
Contributor

Worked on the bin/magento setup:di:compile and it is working now

Process

  • Created a clean Magento installation
  • Installed magewirephp/magewire:dev-main locally
  • Ran bin/magento setup:di:compile
  • Started debugging

Fixes

Several hurdles needed to be taken before we could speak of success.

Adding Missing Dependency

  • "illuminate/routing" is required for a functional magewirephp installation (maybe in other installations this was already shipped, but with a clean Magento it is required)

Loosely Couple HyvaThemes

In a world I cannot remember but that sometimes exists in the wild, HyvaThemes could not be installed. So, we need to create a loose dependency for the SvgIcons class.

Remove a Wrong Class Reference

Found a reference on a naming convention class which was added by accident, removed it.

Composer Autoloading

Composer autoloading with multiple psr-4 rules is working correctly. For Magento, every path that could be used for di.xml in compilation must be registered via registration.php

  • src/registration.php only references as module and adds the ../dist directory for generated code.
  • lib/Magewire and lib/MagewireBc where not part as library registration.
    • For clarity I've added registration.php for a library for both directories.

Result

Compilation works correctly!

Anything Else

No, not per se, have fun with it!

@wpoortman wpoortman changed the base branch from main to upgrade/hc March 25, 2026 19:08
@JeroenBoersma
Copy link
Copy Markdown
Contributor Author

Checked the rebase on upgrade/hc

Loosely Couple HyvaThemes

In a world I cannot remember but that sometimes exists in the wild, HyvaThemes could not be installed. So, we need to create a loose dependency for the SvgIcons class.

This is obsolete as it doesn't exist anymore in the new branch, removed the commit.

@JeroenBoersma
Copy link
Copy Markdown
Contributor Author

JeroenBoersma commented Mar 26, 2026

New errors arise in the new branch!

Not found: 
- \Magewirephp\Magewire\Model\View\Element\DataArray
- \Magewirephp\Magewire\Model\Component\Resolver\Layout
- \Magewirephp\Magewire\Model\Cache\Type\Magewire

@JeroenBoersma
Copy link
Copy Markdown
Contributor Author

Adding Missing Dependency

"illuminate/routing" is required for a functional magewirephp installation (maybe in other installations this was already shipped, but with a clean Magento it is required)

This is also not needed anymore today!

Which leaves us with one change, adding the registration.php

+ this way they are registered as seperate libraries and are allowed in
  di.xml
@JeroenBoersma
Copy link
Copy Markdown
Contributor Author

It is even simpler, I register the whole library for Magento!

@wpoortman wpoortman merged commit cacd21c into magewirephp:upgrade/hc Mar 26, 2026
1 check passed
wpoortman added a commit that referenced this pull request Apr 23, 2026
* Feature/notifier styling (#199)

* Remove redundent view instructions feature

* Feature/notifier styling (#202)

* Magewire Notification Component updates

* Remove Redundant class

* Improved notifiers

* Remove close button

* List theme support

* Move the notifier back to the left (#203)

* First intent on Claude skills for Magewire

* Removed install instructions

* Bugfix: DI is compiling (#204)

* Update Request.php for php 8.4 (#205)

* Update MagewireCommand.php to add static return type (#206)

* Update MagewireUpdateRoute.php (#209)

* Notifier Template + Styling updates (#211)

* Update README to remove styles installation section

* Removed code section about styles and installation steps from README.

* Updated supported themes section in README.

---------

Co-authored-by: Willem Poortman <wp@hyva.io>
Co-authored-by: Ryan Hissey <ryan@hyva.io>
Co-authored-by: Jeroen Boersma <JeroenBoersma@users.noreply.github.com>
Co-authored-by: Ryan Hissey <ryan@hissey.dev>
Co-authored-by: Willem Poortman <git@wpoortman.nl>
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