Skip to content

Enabling module and public resources #1108

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

Closed
tzyganu opened this issue Mar 19, 2015 · 6 comments
Closed

Enabling module and public resources #1108

tzyganu opened this issue Mar 19, 2015 · 6 comments
Assignees
Labels
Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@tzyganu
Copy link
Contributor

tzyganu commented Mar 19, 2015

Right now when I enable a module (didn't test for disabling) using the cli: php setup/index.php module-enable --modules=Vendor_Module all the files under pub/static are cleared.
To rebuild them again I need to run again php dev/tools/Magento/Tools/View/deploy.php.
I understand the reasons behind this action but I think it should be optional. If I enable a module that does not change anything in the public resources I may not want to rebuild them.

I think an extra parameter is needed for the module-enable action.

@mbrinton01 mbrinton01 self-assigned this Mar 19, 2015
@mbrinton01
Copy link

Thank you Marius, this is a good idea. We should be able to include this along with some changes the team is working on now. Internal story: MAGETWO-34621

@mbrinton01 mbrinton01 added PROD Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development and removed question labels Mar 19, 2015
@mbrinton01
Copy link

@tzyganu Marius we are considering changing the default behavior so that pub/static will not be cleared when a module is enabled, and then creating an optional flag to clear the files there. What are your thoughts on this approach? It is the opposite of what you are asking but would enable you to accomplish the same task.

@tzyganu
Copy link
Contributor Author

tzyganu commented Mar 31, 2015

@mbrinton01 I don't really care what's the default value of 'clear-files' flag as long as I have the option to delete or not the public files. Maybe having it set to false by default it's better. In case someone forgets to set the value he can delete the files later. but if it's true by default there is no way back (except generating them again which takes longer).
Maybe you can make the flag mandatory so the user must fill in true or false so it will be clear what happens next.

@orlangur
Copy link
Contributor

Why need some additional option and not just incremental build?

Pretty naive approach would be "check which resources are bundled within a module and see what's need to be rebuilt" with, probably, some --force-public-resources-flush option for really rare cases.

@mbrinton01
Copy link

Thank you for the feedback. For now we will implement the following:

Files in pub/static will not be cleared by default on module enable/disable. User will have the option to clear files.

We will consider making this feature more sophisticated in the future to automatically detect what actions should be taken based on the module being enabled/disabled. For now our scope is limited to providing an option to the user.

@mbrinton01
Copy link

@tzyganu this has now been released in 0.74.0-beta5. The new console is in \bin. Here is the help for module:enable which shows the static files option:

$ php magento help module:enable
Usage:
 module:enable [-c|--clear-static-content] [-f|--force] [--all] [--magento_init_params="..."] [module1] ... [moduleN]

Arguments:
 module                      Name of the module

Options:
 --clear-static-content (-c) Clear generated static view files. Necessary, if the module(s) have static view files
 --force (-f)                Bypass dependencies check
 --all                       Enable all modules
 --magento_init_params       Add to any command to customize Magento initialization parameters
                             For example: 'MAGE_MODE=developer&MAGE_DIRS[base][path]=/var/www/example.com&MAGE_DIRS[cache][path]=/var/tmp/cache'
 --help (-h)                 Display this help message
 --quiet (-q)                Do not output any message
 --verbose (-v|vv|vvv)       Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
 --version (-V)              Display this application version
 --ansi                      Force ANSI output
 --no-ansi                   Disable ANSI output
 --no-interaction (-n)       Do not ask any interactive question

The default behavior will not clear files, but the user can choose to do so using the -c option. It was great to meet you at Imagine!

magento-team pushed a commit that referenced this issue May 17, 2017
…ptcha-2.2

- MAGETWO-69004: 2.2 Upgrade Testing - composer conflict
VitaliyBoyko pushed a commit to VitaliyBoyko/magento2 that referenced this issue Jun 22, 2018
Move Multi Dimension indexation from Framework to InventoryMultiDimensionIndex modules
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests

4 participants