Skip to content

Commit 1581f3c

Browse files
adriendupuismnocon
andauthored
Apply suggestions from code review
Co-authored-by: Marek Nocoń <[email protected]>
1 parent a0ac8af commit 1581f3c

File tree

3 files changed

+55
-53
lines changed

3 files changed

+55
-53
lines changed

docs/update_and_migration/from_4.6/update_to_5.0.md

Lines changed: 51 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Before you update to v5.0, you need to [update to the latest maintenance release
1111

1212
### Move from old to new Commerce
1313

14-
If circa v4.3 you kept [deprecated old Commerce packages](update_from_4.3_old_commerce.md),
14+
If you've chosen to use the [deprecated Commerce packages](update_from_4.3_old_commerce.md) during the update to 4.4,
1515
you have to move to [new Commerce ones](update_from_4.3_new_commerce.md).
1616

1717
## Update from v4.6.latest to v5.0.0
@@ -35,12 +35,14 @@ Install [`ibexa/rector`](https://github.com/ibexa/rector) which contains rules t
3535
composer require --dev ibexa/rector
3636
```
3737

38-
Customize the `rector.php` config file.
39-
Make it match your directory structure (for example, you may have to remove the `tests` directory).
40-
You can add rules [for PHP with `withPhpSets`](https://getrector.com/documentation/set-lists#content-php-sets)
41-
or [for Symfony with `withComposerBased`](https://getrector.com/blog/introducing-composer-version-based-sets).
42-
It's recommended to activate one rule set at a time, run a first time with the `--dry-run` option,
43-
check the output, and decide if kept right now, or discarded for another time.
38+
Customize the `rector.php` config file by:
39+
40+
- making it match your directory structure (for example, you may not have the `tests` directory)
41+
- adding project-specific rules:
42+
- specify [PHP rules by using `withPhpSets`](https://getrector.com/documentation/set-lists#content-php-sets)
43+
- specify [Symfony, Twig, or Doctrine rules by using `withComposerBased`](https://getrector.com/documentation/composer-based-sets).
44+
45+
It's recommended to activate one rule set at a time and preview the output by running Rector with the `--dry-run` option to decide which rulesets should be used and in which order.
4446

4547
Your configuration could look like the following example:
4648

@@ -60,7 +62,7 @@ return RectorConfig::configure()
6062
->withComposerBased(symfony: true)
6163
;
6264
```
63-
65+
Run the following command to preview the changes done by Rector:
6466
```bash
6567
php vendor/bin/rector --dry-run
6668
```
@@ -71,9 +73,9 @@ Delete [`config/routes/annotations.yaml`](https://github.com/symfony/recipes/blo
7173
if you haven't customized it.
7274

7375
If you have customized it,
74-
you have to move from `type: annotation` to `type: attribute`.
76+
change all occurrences of `type: annotation` to `type: attribute`.
7577

76-
The `config/routes.yaml` file should start with the following declaration from [its recipe](https://github.com/symfony/recipes/blob/main/symfony/routing/7.0/config/routes.yaml):
78+
The `config/routes.yaml` file should start with the following declaration from the [Symfony recipe](https://github.com/symfony/recipes/blob/main/symfony/routing/7.0/config/routes.yaml):
7779

7880
```yaml
7981
controllers:
@@ -83,13 +85,12 @@ controllers:
8385
type: attribute
8486
```
8587
86-
- You can delete the file and let the recipe recreate it.
87-
Then, if you have eventually customized it, merge with your previous version from your version system.
88-
- Or edit the file and copy-paste the new declaration on top of it.
88+
You can add the new declaration to the top of the file manually, or recreate the file by running `composer sync-recipes symfony/routing --force --reset`
8989

9090
### Remove GraphQL schema
9191

92-
4.6 GraphQL schema isn't compatible with 5.0 so delete it, for example, with the following command:
92+
The GraphQL schema used in 4.6 isn't compatible with version 5.0 and must be deleted.
93+
You can do it, for example, with the following command:
9394

9495
```bash
9596
rm -r config/graphql
@@ -101,8 +102,9 @@ rm -r config/graphql
101102

102103
[[= product_name =]] 5.0 is based on Symfony 7.3 and both must be updated.
103104
Your development package must be updated as well.
104-
The process example below considers [`symfony/debug-pack`](https://symfony.com/packages/Debug%20Pack) and `ibexa/rector` as installed.
105-
Notice that it uses the `--no-update` option to only edit the composer.json, to not run package installation, and to not run scripts until all necessary changes are made.
105+
The example below assumes that [`symfony/debug-pack`](https://symfony.com/packages/Debug%20Pack) and `ibexa/rector` are installed.
106+
Adjust the list based on your project requirements.
107+
Notice the use of the `--no-update` option to only edit the `composer.json` entries and avoid triggering the package update and Composer scripts.
106108

107109
=== "[[= product_name_headless =]]"
108110

@@ -182,16 +184,16 @@ Notice that it uses the `--no-update` option to only edit the composer.json, to
182184
#### Remove 4.6 LTS Updates constraints
183185

184186
4.6 LTS Update packages are included by default in 5.0.
185-
You can now remove them from your composer.json
186-
so you don't have to maintain which of their versions your composer.json is referring to.
187+
Remove them from your composer.json to avoid updating their version manually with each update.
187188

188-
For example, the following command removes several formerly LTS Update packages from `composer.json:
189+
For example, the following command removes all of the released LTS Updates for 4.6 from `composer.json`:
189190

190191
```bash
191192
composer remove --no-update \
192193
ibexa/connector-ai \
193-
ibexa/collaboration \
194-
ibexa/share \
194+
ibexa/connector-openai \
195+
ibexa/product-catalog-date-time-attribute \
196+
ibexa/product-catalog-symbol-attribute/
195197
ibexa/discounts \
196198
ibexa/discounts-codes \
197199
;
@@ -200,7 +202,7 @@ composer remove --no-update \
200202
#### Remove PHP 8.2 error handler
201203

202204
If you were using the [`Php82HideDeprecationsErrorHandler`](update_from_4.6.md#v468) to avoid deprecation messages,
203-
you can remove it:
205+
you must remove it:
204206

205207
```bash
206208
composer config --unset extra.runtime.error_handler
@@ -247,8 +249,8 @@ composer recipes:install symfony/webpack-encore-bundle --reset --force --yes
247249

248250
#### Sort commands
249251

250-
Recipe appends a command to `composer.json`'s `auto-scripts`.
251-
You have to manually resort the commands so the `tsconfig.json` file
252+
Executing the recipes appends a new command at the end`composer.json`'s `auto-scripts` section, resulting in incorrect script order.
253+
You have to manually sort the commands so the `tsconfig.json` file
252254
is created by `yarn ibexa-generate-tsconfig`
253255
before being used by `ibexa:encore:compile`.
254256
Your `auto-scripts` entry should look like this:
@@ -292,7 +294,7 @@ The main schema has changed and the provided SQL file `ibexa-4.6.latest-to-5.0.0
292294
psql <database_name> < vendor/ibexa/installer/upgrade/db/postgresql/ibexa-4.6.latest-to-5.0.0.sql
293295
```
294296

295-
As this is made for all the editions at once, you may encounter unimportant errors on other editions which can be ignored.
297+
As this script targets all editions, on editions lower than Commerce you may encounter errors about missing tables which can safely be ignored.
296298

297299
Many tables and columns are renamed.
298300
If you have custom code directly querying those, you will need to update them.
@@ -385,7 +387,7 @@ You can track the renaming in the `ibexa-4.6.latest-to-5.0.0.sql` file or below.
385387
??? note "DFS (Distributed File System)"
386388

387389
If [DFS IO handler](clustering.md#dfs-io-handler) is used and, as recommended, its table is on its own database, you'll have to rename table and columns there.
388-
Here are the DFS renamming queries (extracted from `ibexa-4.6.latest-to-5.0.0.sql`):
390+
Here are the DFS renaming queries (extracted from `ibexa-4.6.latest-to-5.0.0.sql`):
389391

390392
```sql
391393
ALTER TABLE ezdfsfile RENAME TO ibexa_dfs_file;
@@ -401,7 +403,7 @@ Features which were optional 4.6 LTS Updates are now part of 5.0.0.
401403

402404
* If you have already installed the feature, its schema has been updated by the previous step.
403405
* If you haven't installed the feature, you need to add its schema to your database.
404-
* If you mistakenly reinstall a schema, no worries, you encounter "Table already exists" errors which can be ignored.
406+
* If you mistakenly reinstall a schema, you might encounter "Table already exists" errors which can be ignored.
405407

406408
#### Install AI actions schema
407409

@@ -482,16 +484,16 @@ php bin/console ibexa:migrations:migrate --file=2025_07_08_09_27_set_container_t
482484

483485
### Generate GraphQL schema
484486

485-
4.6's back office uses GraphQL while 5.0's one doesn't.
486-
But, optionally, if you are using GraphQL in your project, generate its schema:
487+
GraphQL usage is no longer required for the Ibexa DXP back office.
488+
If you are using GraphQL in your project, you can generate its schema by running:
487489

488490
```bash
489491
php bin/console ibexa:graphql:generate-schema
490492
```
491493

492494
### Update search indexes
493495

494-
Ensure your index are up to date with the following command:
496+
Ensure your search index is up to date with the following command:
495497

496498
```bash
497499
php bin/console ibexa:reindex
@@ -512,11 +514,11 @@ If you didn't edit it the first time, you can run its recipe:
512514
composer recipe:install ibexa/rector --force --reset --yes
513515
```
514516

515-
You can add some other rule sets (like, for example, the Symfony ones) to match newer standards.
517+
You can adjust the other rule sets (for example, the Symfony ones) to match higher versions.
516518

517-
Again, it's recommended to activate one set at a time, run a first time with the `--dry-run` option,
518-
check the output, and decide if kept right now, or discarded for another time.
519-
As the gap is larger, many rules can be considered, see a selection in the example below.
519+
Again, it's recommended to activate one rule set at a time and preview the output by running Rector with the `--dry-run` option to decide which rulesets should be used and in which order.
520+
521+
As this update spans across a broad range of versions, multiple rules can be considered as in the example below.
520522

521523
```php
522524
//…
@@ -586,19 +588,20 @@ In the following example, you can see optimization thanks to the following featu
586588

587589
#### Update JavaScript
588590

589-
If you haven't renamed your Webpack file since 3.3,
590-
you have to do it as 5.0 doesn't support the old names like 4.6 does.
591+
If you haven't renamed your Webpack file since 3.3, do it now as v5.0 no longer supports the old names.
591592

592593
| Old name | New name |
593594
|:----------------------------|:-------------------------------|
594595
| ez.config.js | ibexa.config.js |
595596
| ez.config.manager.js | ibexa.config.manager.js |
596597
| ez.webpack.custom.config.js | ibexa.webpack.custom.config.js |
597598

598-
`ibexa/rector` 5.0 also come with the [JavaScript Transform module](https://github.com/ibexa/rector/blob/v5.0.0/js/README.md) to help you maintain your JS.
599+
`ibexa/rector` 5.0 also comes with the [JavaScript Transform module](https://github.com/ibexa/rector/blob/v5.0.0/js/README.md) to help you maintain your JavaScript code.
600+
601+
Customize the `rector.config.js` config file by:
599602

600-
Customize the `rector.config.js` config file.
601-
Make it match your directory structure. Eventually modify the enabled plugin list.
603+
- making it match your directory structure
604+
- modifying the list of enabled plugins and their configuration
602605

603606
The example below is made to fix in place the JS files from `asset/js/` directory,
604607
and is ready to enable plugin rule sets one at a time (plugin path is relative to `vendor/ibexa/rector/` directory).
@@ -644,8 +647,7 @@ yarn --cwd ./vendor/ibexa/rector/js transform
644647
#### Update field type identifiers
645648

646649
Several field type identifiers have changed.
647-
Old identifiers are still supported, but it's recommended to migrate as soon as possible
648-
and to include this action to the current version update task list.
650+
The old identifiers are still supported, but it's recommended to migrate as soon as possible.
649651

650652
You can list existing field type services with the command `php bin/console debug:container --tag=ibexa.field_type`.
651653
The output as an `alias` column with new identifiers and a `legacy_alias` column with the old identifiers.
@@ -690,16 +692,17 @@ The output as an `alias` column with new identifiers and a `legacy_alias` column
690692
| ezurl | ibexa_url |
691693
| ezuser | ibexa_user |
692694

693-
You may have to update them in several places.
695+
```suggestion
696+
You may have to update them in several places, for example:
694697
695-
- Update in templates to display or edit fields or their definition. For example, in a `@IbexaCore/content_fields.html.twig` extension, `{% block ezstring_field %)` must be changed for `{% block ibexa_string_field %}`
696-
- Update in migration files
698+
- Update the field identifiers in templates to display or edit fields or their definition. For example, in a `@IbexaCore/content_fields.html.twig` extension, `{% block ezstring_field %)` must be changed for `{% block ibexa_string_field %}`
699+
- Update the field identifiers in migration files
697700

698701
#### Update icons
699702

700-
The names of the icons provided in `all-icons.svg` have changed.
701-
`ibexa/rector` JavaScript Transform module's plugin `ibexa-rename-icons.js` deals with those changes in JavaScript.
702-
You may have to update them in other contexts like, for example, config files associating icons to content types or Page Builder blocks.
703+
The provided built-it icon set has been changed.
704+
The `ibexa/rector` JavaScript Transform module's plugin `ibexa-rename-icons.js` refactors the icon usage in JavaScript files.
705+
You may have to update them in other contexts, for example, in configuration files associating icons to content types or Page Builder blocks.
703706

704707
You can find an [`ibexa-rename-icons` map in `vendor/ibexa/rector/js/rules.config.json` (`"old-name": "new-name"`)](https://github.com/ibexa/rector/blob/v5.0.0/js/rules.config.json#L63).
705708
@@ -957,5 +960,5 @@ The following example illustrates the update of a custom page block's icon:
957960
name: About Block
958961
category: Custom
959962
- thumbnail: /bundles/ibexaicons/img/all-icons.svg#about
960-
+ thumbnail: /bundles/ibexaicons/img/all-icons.svg#info-square
963+
+ thumbnail: /bundles/ibexaadminuiassets/vendors/ids-assets/dist/img/all-icons.svg#info-square
961964
```

docs/update_and_migration/from_5.0/update_from_5.0.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ month_change: true
55

66
# Update from v5.0.x to v5.0.latest
77

8-
[[= product_name =]] v5.0.0 is the latest version for now. If you have it, you're update-to-date.
9-
Come back to this page later to discover if some patch has been released and how to install it.
8+
[[= product_name =]] v5.0.0 is the latest version.
9+
Revisit this page when a new bugfix release is available to stay up to date.
1010

1111
To update from v4.6.x, see [Update from v4.6 to v5.0](update_to_5.0.md).
12-
From an older version, explore [this section](update_ibexa_dxp.md).
12+
To update from an older version, visit [the update page](update_ibexa_dxp.md) and choose the applicable path.

docs/update_and_migration/update_ibexa_dxp.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,4 @@ To update [[= product_name =]] to a newer version, select the version you're cur
3838

3939
=== "I am using v5.0"
4040

41-
If you're using [[= latest_tag_5_0 =]], You're update-to-date.
42-
Monitor [this v5.0 update page](from_5.0/update_from_5.0.md) for futur patches.
41+
Refer to the [v5.0 update page](from_5.0/update_from_5.0.md) to make sure you're staying up to date.

0 commit comments

Comments
 (0)