Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nette/php-generator should be in require-dev #82

Open
randomsymbols opened this issue Feb 1, 2023 · 6 comments
Open

nette/php-generator should be in require-dev #82

randomsymbols opened this issue Feb 1, 2023 · 6 comments
Labels
discussion Requires further evaluation

Comments

@randomsymbols
Copy link

randomsymbols commented Feb 1, 2023

Generating PHP code should not be used in prod, only in dev. The same is for symfony/console. Maybe other libs that are in required are used for code gen only, they need to go to dev too.

@spawnia
Copy link
Owner

spawnia commented Feb 2, 2023

Any dependency we put in require-dev would not be installed as subdependencies when installing this package. We would have to suggest installing them separately, for example in the docs about installing this package:

composer require spawnia/sailor
composer require --dev symfony/console nette/php-generator

I am not sure if the advantage gained by not installing the deps in prod is worth the extra hassle and source of frustration. Can you provide an objective measurement of the cost of installing those extranuous dependencies (disk usage?)?

@spawnia spawnia added the discussion Requires further evaluation label Feb 2, 2023
@morloderex
Copy link

@spawnia Coming back to this would it make sense to add the code generation stuff to suggests?
And then add it to our require-dev blocks.

So that we make it a peer dependency instead sense it get the point that when using this package in production you should already have done the code generation.

@spawnia
Copy link
Owner

spawnia commented Mar 31, 2023

@morloderex You just reiterated what I already said. Again, in order to judge if making this change is worth it I need more information.

I am not sure if the advantage gained by not installing the deps in prod is worth the extra hassle and source of frustration. Can you provide an objective measurement of the cost of installing those extranuous dependencies (disk usage?)?

@morloderex
Copy link

@spawnia well personally sense I am using laravel in my projects i would already have symfony/console installed.

I do however believe it's not a question of disk usage but more preferable to not include it in production as code is never generated on the fly in this situation

@spawnia
Copy link
Owner

spawnia commented Mar 31, 2023

As I have already said and repeated twice now:

I am not sure if the advantage gained by not installing the deps in prod is worth the extra hassle and source of frustration.

Simplicity of installation has value. There is a tradeoff involved here. I can judge the disadvantage of having extra installation steps, but can not judge the disadvantage of having unnecessary dependencies in production - that is why I need more information to make a decision.

more preferable to not include it in production

Why?

@randomsymbols
Copy link
Author

@spawnia any extra package is adding security risk: the more code, the more probability of security vulnerabilities originating from the package. Compromising prod security is definetelly not worth saving an extra step when installing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Requires further evaluation
Projects
None yet
Development

No branches or pull requests

3 participants