Modify createClassDefinition to include application mode#40567
Conversation
Updated createClassDefinition method to accept an application mode parameter and conditionally register the autoloader based on the mode.
|
Hi @Genaker. Thank you for your contribution!
Allowed build names are:
You can find more information about the builds here For more details, review the Code Contributions documentation. |
|
The security team has been informed about this pull request due to the presence of risky security keywords. For security vulnerability reports, please visit Adobe's vulnerability disclosure program on HackerOne or email psirt@adobe.com. |
|
@magento create issue |
|
The security team has been informed about this pull request due to the presence of risky security keywords. For security vulnerability reports, please visit Adobe's vulnerability disclosure program on HackerOne or email psirt@adobe.com. |
ihor-sviziev
left a comment
There was a problem hiding this comment.
@engcom-Hotel is there a chance that Product Owner can accept this change?
I think it is good feature especially for read-only environments.
For my perspective, it can be made configurable by some config flag, and disabled by default in order to make it backward compatible
|
Hi Ihor,
I agree that this is a valuable feature, especially for read-only
environments. There are many similar issues where writable env files,
config files, and cache poisoning—caused by old data during deployment from
the maintenance page, cron, or message queues—create significant challenges.
Making this configurable with a flag and disabled by default seems like a
solid approach to maintain backward compatibility while addressing these
risks.
Best regards,
Yegor Shytikov
…On Tue, Mar 3, 2026 at 1:26 PM Ihor Sviziev ***@***.***> wrote:
***@***.**** commented on this pull request.
@engcom-Hotel <https://github.com/engcom-Hotel> is there a chance that
Product Owner can accept this change?
I think it is good feature especially for read-only environments.
For my perspective, it can be made configurable by some config flag, and
disabled by default in order to make it backward compatible
—
Reply to this email directly, view it on GitHub
<#40567 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACGJNZQFUECZOWGLWT2URL34O5EZLAVCNFSM6AAAAACWES3SNGVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTQOBVGEZDQMJWGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
I agree with your point. Since the PR is already marked as a feature request, we will send an email to the PO for approval whenever we pick this up. Thank you |
|
@Genaker I believe this change can improve performance. Did you notice any improvements after your changes? If it does, I guess it can be a good point to accept this change for PO |
Disable runtime code generation in production mode
Description
This patch stops Magento from generating Interceptors, Factories, and Proxies at runtime when running in production mode.
In production, all generated classes must be created beforehand by
bin/magento setup:di:compile. If they are missing (for example aftergenerated/codeis cleared during deployment), Magento should fail with a clear error instead of generating them on the fly.Changes
production.createClassDefinition().Behaviour
Requirements
bin/magento setup:di:compileduring deployment before serving traffic.generated/codeis populated before going live.Resolved issues: