|
1 | 1 | ## 2.0 |
2 | 2 |
|
3 | | -Tempest comes with automated upgrades for most of our breaking changes, powered by [Rector](https://getrector.com/). If you prefer to manually upgrade your project, you can review the list of all breaking changes further down this document. |
4 | | - |
5 | | -**If you don't have Rector installed in your project, please do so:** |
6 | | - |
7 | | -1. `composer require rector/rector --dev` to require rector as a dev dependency |
8 | | -2. Run `vendor/bin/rector` to create a default rector config file |
9 | | - |
10 | | -Next, update Tempest; it's important to add the `--no-scripts` flag to prevent any errors from being thrown while updating Tempest. |
11 | | - |
12 | | -```sh |
13 | | -composer require tempest/framework:^2.0 --no-scripts |
14 | | -``` |
15 | | - |
16 | | -Then you should add the `tempest2.php` set to your Rector config file: |
17 | | - |
18 | | -```php |
19 | | -return RectorConfig::configure() |
20 | | - // … |
21 | | - ->withSets([__DIR__ . '/vendor/tempest/framework/packages/upgrade/src/tempest2.php']); |
22 | | -``` |
23 | | - |
24 | | -Then run `vendor/bin/rector` to update all your project files. After that, run `tempest discovery:clear` and `tempest key:generate`. The `tempest key:generate` command must only be done once per environment. |
25 | | - |
26 | | -Finally, carefully review and test your project, and make sure to read through the list of breaking changes below: |
27 | | - |
28 | | -### Breaking changes |
29 | | - |
30 | | -- **`Tempest\Database\Id` is now called `Tempest\Database\PrimaryKey`** (https://github.com/tempestphp/tempest-framework/pull/1458) |
31 | | -- **The value property of `Tempest\Database\PrimaryKey` has been renamed from `id` to `value`** (https://github.com/tempestphp/tempest-framework/pull/1458) |
32 | | -- **`Tempest\CommandBus\AsyncCommand` is now called `Tempest\CommandBus\Async`** (https://github.com/tempestphp/tempest-framework/pull/1507) |
33 | | -- **You cannot longer declare view components via the `<x-component name="x-my-component">` tag. All files using this syntax must remove the wrapping `<x-component` tag and instead rename the filename to `x-my-component.view.php` (https://github.com/tempestphp/tempest-framework/pull/1439)** |
34 | | -- **Validation rule names were updated** (https://github.com/tempestphp/tempest-framework/pull/1444) |
35 | | -- **The `DatabaseMigration` interface was split into two** (https://github.com/tempestphp/tempest-framework/pull/1513) |
36 | | -- **`\Tempest\uri` and `\Tempest\is_current_uri` are both moved to the `\Tempest\Router` namespace** |
37 | | -- Cookies are now encrypted by default (https://github.com/tempestphp/tempest-framework/pull/1447) and developers must run `tempest key:generate` once per environment |
38 | | -- Changes in view component variable scoping rules might affect view files (https://github.com/tempestphp/tempest-framework/pull/1435) |
39 | | -- The validator now requires the translator, and should always be injected instead of manually created (https://github.com/tempestphp/tempest-framework/pull/1444) |
40 | | - |
41 | | -The changes in **bold** are automated when you use Rector. |
| 3 | +Read the 2.0 upgrade guide here: [https://tempestphp.com/blog/tempest-2](https://tempestphp.com/blog/tempest-2). |
0 commit comments