SPECIAL OFFER: ENJOY 3 MONTHS OF SHOPIFY FOR $1/MONTH SPECIAL OFFER: ENJOY 3 MONTHS OF SHOPIFY FOR $1/MONTH SPECIAL OFFER: ENJOY 3 MONTHS OF SHOPIFY FOR $1/MONTH SPECIAL OFFER: ENJOY 3 MONTHS OF SHOPIFY FOR $1/MONTH SPECIAL OFFER: ENJOY 3 MONTHS OF SHOPIFY FOR $1/MONTH SPECIAL OFFER: ENJOY 3 MONTHS OF SHOPIFY FOR $1/MONTH SPECIAL OFFER: ENJOY 3 MONTHS OF SHOPIFY FOR $1/MONTH SPECIAL OFFER: ENJOY 3 MONTHS OF SHOPIFY FOR $1/MONTH SPECIAL OFFER: ENJOY 3 MONTHS OF SHOPIFY FOR $1/MONTH SPECIAL OFFER: ENJOY 3 MONTHS OF SHOPIFY FOR $1/MONTH
Pros and cons of installing modules via app/code and composer
Pros and cons of installing modules via app/code and composer

Pros and cons of installing modules via app/code and composer

Hi everyone. Today I will show the pros and cons of installing modules through app/code and composer.

1. Install the module through app/code

Advantages

The first is easy for newbies, but I do not recommend this, even if you are a novice you should learn what a composer is then code.

The second is that you will easily find the code in app / code. The fact that there are so many modules in the vendor can be shocking to newcomers.

The third is familiar to magento developers 1. Magento has only 1 way of writing code in app / code.

Disadvantages

You will break the update strategy if you write the code in app / code.

Installing or developing the code in app / code will ignore version or libs dependencies.

Maintenance is difficult if your modules are from different developers.

The inconsistency in the project will appear if the module is installed in the app / code.

I saw also many times projects where 3rd party modules were added here manually – imagine what happens here if a change is needed. If that module is not versioned, it’s very difficult to tell whether the native code was altered manually.

2. Install the module through composer

Advantages

Would go 100% with this approach in both development and production. Approach should be the same, regardless of the environment using the code – so no inconsistencies.

Dependencies are respected and this is a major plus – it’s very easy to see that you have incompatibilities, missing stuff, BEFORE something breaks.

You can require as many custom modules as you need and still be able to update them from just running a single command.

Seamless code updates in any environment, no need to write lists of commands for defining update procedures for different modules, etc…

If ‘accidental’ manual changes are added to the native code of a module, it’s easy to remove the module and reinstall it from CLI, no need to unpack, jump through hoops and whatnot.

Ease in using different module versions on different envs/ projects.

Everything is in one place.

Disadvantages

Can’t really come up with any TBH.