Closed Schrank closed 2 months ago
Make sense. Let’s add it before v7 release.
Wanted to leave my vote for making option 2/A (authoritative class maps) the default :hand:
When this is implemented, the respective option should also be added to the dump-autoload
calls in the Magento 2 recipe:
Any volunteers to implement?
@peterjaap @sprankhub If you have time, feel free. I'm currently drowning and don't see light.
When this is implemented, the respective option should also be added to the
--dump-autoload
calls in the Magento 2 recipe:
Checked the rest of the codebase, Magento 2 is the only recipe we need to edit!
Checked the rest of the codebase, Magento 2 is the only recipe we need to edit!
You only checked for composer dump-autoload
calls, right? However, this would also need to be added to composer install
calls (and theoretically to composer update
commands, but they should not be present here ^^).
Any volunteers to implement?
I could have a look when I have some time, but I will need some help with testing. Plus, it should be clear how exactly this should be implemented before we start: Will we make --classmap-authoritative
the new default? Should it be possible to disable it? Or should it be the other way round, so that you need to enable it if you want to use it?
Users already can override composer_options. Let’s just add it as new default.
You only checked for composer dump-autoload calls, right? However, this would also need to be added to composer install calls (and theoretically to composer update commands, but they should not be present here ^^).
Nope, I searched for {{bin/composer}} ^^
https://twitter.com/IvanChepurnyi/status/1481279298057162755?s=20
Can we check wether apcu is installed? If it is, we better use it 🙈 And if not we use classmaps?
Yeah the question is how willing @antonmedv is to potentially break other peoples' systems :stuck_out_tongue: --classmap-authoritative
can indeed break systems. The issue with this is that it cannot be detected during the deployment, but only on the (potentially live) system after the deployment. Hence, maybe the solution suggested by @Schrank makes sense? If APCu is enabled, use it and if it is not, we use --classmap-authoritative
(or nothing). What do you think, @antonmedv?
By the way, many in the Magento community used a deployer-based recipe by @jalogut before and there, --apcu
is used:
+1 for making --classmap-authoritative the default.
This issue has been automatically closed. Please, open a discussion for bug reports and feature requests.
Read more: [https://github.com/deployphp/deployer/discussions/3888]
We had a recent discussion on Twitter, read the complete thread, it is interesting for non-Magento folks as well: https://twitter.com/PeterJaap/status/1481166381332807680?s=20
https://getcomposer.org/doc/articles/autoloader-optimization.md#optimization-level-2-a-authoritative-class-maps
I think "generating classes on runtime" is an edge case, were (as @peterjaap wrote on Twitter) "typos or wrong casing in class names vs file names." is not an edge case.
So what I think we should implement at least is an option to use optimization level 2/A or 2/B as per composer documentation and/or even set it as default.
Upvote & Fund