|
1 |
| -# Migrating from v0.1.x |
| 1 | +# Migrating from v0.2.x |
2 | 2 |
|
3 |
| -Perseus v0.2.0 added a *huge* number of features, fixed a number of bugs, improved performance and SEO, and made Perseus significantly easier to use. If you're currently running v0.1.x, here's how to upgrade! |
| 3 | +Perseus v0.3.0 added significant architectural changes to Perseus under the hood, and also made it easier to use for you! Additionally, this update provides inbuilt deployment functionality for moving Perseus to production (though that's not recommended yet)! If you're currently running v0.2.x, here's how to upgrade! |
4 | 4 |
|
5 |
| -*Note: if possible, it's best to start a new project for Perseus v0.2.0 due to the sheer number of changes that have occurred.* |
| 5 | +1. Update your `Cargo.toml` dependencies for `perseus` to `0.3`. |
| 6 | +2. Upgrade the Perseus CLI with `cargo install perseus-cli`. |
| 7 | +3. Run `perseus clean` to remove the old `.perseus/` directory. |
| 8 | +4. Remove any custom config managers you may have, they've been replaced by [mutable and immutable stores](./stores.md). |
| 9 | +5. Update your code for the remaining breaking changes listed in [the CHANGELOG](https://github.com/arctic-hen7/perseus/blob/main/CHANGELOG.md). |
6 | 10 |
|
7 |
| -1. Update your `Cargo.toml` dependencies for `perseus` to `0.2`. |
8 |
| -2. Remove dependencies on `perseus-actix-web` and `sycamore-router` that you might have had before (fully internal now). |
9 |
| -3. Upgrade the Perseus CLI with `cargo install perseus-cli`. |
10 |
| -4. Run `perseus clean` to remove the old `.perseus/` directory. |
11 |
| -5. Change all `Rc`s to `Arc`s. |
12 |
| -6. Change your `lib.rs` to match the [new `define_app!` macro](./define-app.md) and delete routing code (all that is now inferred, with no extra code from you)!. |
13 |
| -7. Update your code for the remaining breaking changes listed in [the CHANGELOG](). |
| 11 | +Perseus v0.3.0 also changed a few common idioms, like breaking out the `.template()` call into a separate function `template_fn()`. This is no longer recommended, though it will still work fine. You can check out the [examples directory](https://github.com/arctic-hen7/perseus/tree/main/examples) to see how things are a bit nicer now in terms of formatting. |
14 | 12 |
|
15 |
| -*Note: if you're running an older machine (pre-2015), it may be worth setting the `PERSEUS_CLI_SEQUENTIAL` environment variable to `true` to disable the CLI's new multi-threading, which may overly burden older systems. You should try it first to make sure though.* |
| 13 | +## If You've Ejected |
16 | 14 |
|
17 |
| -## Upgrading from a Non-CLI Project |
| 15 | +If you were running Perseus v0.2.x and had ejected, here are the steps you should take in addition to the above. |
18 | 16 |
|
19 |
| -If you were running Perseus v0.1.x and not using the CLI, upgrading your existing app will be almost impossible due to significant infrastructural changes, and you should try to migrate your code over to a v0.2.0 CLI project, which will be faster and far easier to work with. |
| 17 | +1. Rename `.perseus/` to `.perseus.old/`. |
| 18 | +2. Run `perseus build` to create a new `.perseus/` directory. |
| 19 | +3. Apply your changes to the new directory. |
| 20 | +4. Delete `.perseus.old/` when you're done. |
| 21 | +5. Confirm everything works with `perseus serve`. |
| 22 | + |
| 23 | +This may seem arduous, but v0.3.0 includes notable updates to the innards in `.perseus/`, and it's typically simpler to re-apply your own changes to the new system than it is to apply Perseus' updates to your existing directory (though you could do this if you really wanted). |
0 commit comments