Skip to content

Different way for updating flex projects #9962

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
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup/_update_dep_errors.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ other Symfony dependencies too. In that case, try the following command:

.. code-block:: terminal

$ composer update symfony/symfony --with-dependencies
$ composer update "symfony/*" --with-dependencies
Copy link
Member

Choose a reason for hiding this comment

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

In Composer 1.6, apparently there is a --with-all-dependencies. This looks like what we want.

But then, because this new flag works the way we want it to, the user should never have version constraint problems anymore. So, we can add this flag to the other commands, then probably remove this section.


This updates ``symfony/symfony`` and *all* packages that it depends on, which will
include several other packages. By using tight version constraints in
Expand Down
24 changes: 17 additions & 7 deletions setup/upgrade_minor.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. index::
single: Upgrading; Minor Version

Upgrading a Minor Version (e.g. 3.3.3 to 3.4.0)
Upgrading a Minor Version (e.g. 4.0.0 to 4.1.0)
===============================================

If you're upgrading a minor version (where the middle number changes), then
Expand All @@ -21,16 +21,26 @@ There are two steps to upgrading a minor version:
1) Update the Symfony Library via Composer
------------------------------------------

First, you need to update Symfony by modifying your ``composer.json`` file
to use the new version:
First, you need to update all Symfony packages by modifying your ``composer.json`` file
to use the new version (the list of packages may vary depending on what you've installed):

.. code-block:: json

{
"...": "...",

"require": {
"symfony/symfony": "3.4.*",
"symfony/asset": "^4.1",
"symfony/console": "^4.1",
"symfony/expression-language": "^4.1",
"symfony/form": "^4.1",
"symfony/framework-bundle": "^4.1",
"symfony/process": "^4.1",
"symfony/security-bundle": "^4.1",
"symfony/twig-bundle": "^4.1",
"symfony/validator": "^4.1",
"symfony/web-link": "^4.1",
"symfony/yaml": "^4.1"
Copy link
Member

Choose a reason for hiding this comment

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

Because all dependencies will now use the ^4.0 format, the user actually should not need to update anything in their composer.json file (as ^4.0 will allow them to upgrade to 4.1). So, let's remove this. We could instead add a quick note to about this at the bottom:

Your composer.json file should already be configured to allow your Symfony packages to be upgraded minor versions. But, if a package was not upgraded that should have been, check your composer.json

},
"...": "...",
}
Expand All @@ -39,7 +49,7 @@ Next, use Composer to download new versions of the libraries:

.. code-block:: terminal

$ composer update symfony/symfony
$ composer update "symfony/*"
Copy link
Member

Choose a reason for hiding this comment

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

Add --with-all-dependencies


.. include:: /setup/_update_dep_errors.rst.inc

Expand All @@ -55,12 +65,12 @@ to your code to get everything working. Additionally, some features you're
using might still work, but might now be deprecated. While that's just fine,
if you know about these deprecations, you can start to fix them over time.

Every version of Symfony comes with an UPGRADE file (e.g. `UPGRADE-3.4.md`_)
Every version of Symfony comes with an UPGRADE file (e.g. `UPGRADE-4.1.md`_)
included in the Symfony directory that describes these changes. If you follow
the instructions in the document and update your code accordingly, it should be
safe to update in the future.

These documents can also be found in the `Symfony Repository`_.

.. _`Symfony Repository`: https://github.com/symfony/symfony
.. _`UPGRADE-3.4.md`: https://github.com/symfony/symfony/blob/3.4/UPGRADE-3.4.md
.. _`UPGRADE-4.1.md`: https://github.com/symfony/symfony/blob/4.1/UPGRADE-4.1.md
6 changes: 3 additions & 3 deletions setup/upgrade_patch.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. index::
single: Upgrading; Patch Version

Upgrading a Patch Version (e.g. 3.3.2 to 3.3.3)
Upgrading a Patch Version (e.g. 4.1.0 to 4.1.1)
===============================================

When a new patch version is released (only the last number changed), it is a
Expand All @@ -10,12 +10,12 @@ version is *really* easy:

.. code-block:: terminal

$ composer update symfony/symfony
$ composer update "symfony/*"
Copy link
Member

Choose a reason for hiding this comment

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

Add --with-all-dependencies


That's it! You should not encounter any backwards-compatibility breaks or
need to change anything else in your code. That's because when you started
your project, your ``composer.json`` included Symfony using a constraint
like ``3.3.*``, where only the *last* version number will change when you
like ``^4.1``, where only the *last* version number will change when you
update.

.. tip::
Expand Down