Skip to content

[Cookbook] Add warning about Composer dev deps on Heroku #5078

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

Merged
merged 1 commit into from
Apr 15, 2015
Merged

[Cookbook] Add warning about Composer dev deps on Heroku #5078

merged 1 commit into from
Apr 15, 2015

Conversation

bicpi
Copy link
Contributor

@bicpi bicpi commented Mar 12, 2015

Q A
Doc fix? no
New docs? no
Applies to all
Fixed tickets #4217 (partly)

Be aware that dependencies from ``composer.json`` listed in ``require-dev``
are never installed during a deploy on Heroku. This may cause problems if your
Symfony environment relies on such packages. For instance, the ``dev``
environment of the Symfony Standard Edition loads the SensioGeneratorBundle
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there actually any use case where you run a Symfony application in dev mode on Heroku?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. I was running into this when I first tried to deploy Symfony to Heroku as there was no best practice to set SYMFONY_ENV=prod and the solution for solving this issue was to move the SensioGeneratorBundle to Composer's require list. No wondering if it makes sense to deploy dev ;-) So this caution note may clarifies why things do not work in dev if someone forgets to set SYMFONY_ENV=prod.

On the other hand, if you need some node packages for the prod build (e.g. to compile assets) you have to move them to the dependencies list of packages.json because devDependencies are not installed. Weird.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is usefull to have a caution about this, but I think we have to make it a bit shorter. What do you think about:

.. caution::

    Be aware that dependencies from ``composer.json`` listed in the ``require-dev``
    section are never installed during a deploy on Heroku. This may cause problems if
    your Symfony environment relies on such packages. The solution is to move this
    packages from ``require-dev`` to the ``require`` section.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the short version, no need for details 👍


Be aware that dependencies from ``composer.json`` listed in the ``require-dev``
section are never installed during a deploy on Heroku. This may cause problems
if your Symfony environment relies on such packages. The solution is to move this
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[...] move these packages [...]

@xabbuh
Copy link
Member

xabbuh commented Mar 26, 2015

@bicpi I just left a final minor comment. Can you please also rebase your changes?

@bicpi
Copy link
Contributor Author

bicpi commented Mar 27, 2015

@xabbuh Typo fixed, rebase done.

@weaverryan
Copy link
Member

Great note - thanks Philipp!

@weaverryan weaverryan merged commit 3320b46 into symfony:2.3 Apr 15, 2015
weaverryan added a commit that referenced this pull request Apr 15, 2015
…u (bicpi)

This PR was merged into the 2.3 branch.

Discussion
----------

[Cookbook] Add warning about Composer dev deps on Heroku

 Q             | A
| ------------- | ---
| Doc fix?      | no
| New docs?     | no
| Applies to    | all
| Fixed tickets | #4217 (partly)

Commits
-------

3320b46 [Cookbook] Add warning about Composer dev deps on Heroku
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants