Skip to content

Commit

Permalink
Merge pull request #263 from Workiva/greglittlefield-wf-patch-1
Browse files Browse the repository at this point in the history
FED-1855 Update instructions for dart2_upgrade codemod
  • Loading branch information
rmconsole4-wk authored Aug 12, 2024
2 parents d76eaa2 + 84685b9 commit 60bfa72
Showing 1 changed file with 8 additions and 24 deletions.
32 changes: 8 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,15 @@ For more information, please see the [INTL Message Codemod Readme](docs/intl_mes

## Dart 1 to Dart 2 Codemod

This package provides a `dart2_upgrade` codemod that will modify existing
over_react component code to be compatible with Dart 2 and the over_react
builder.
The `dart2_upgrade` codemod that used to be provided by this package is no longer available.

Depending on your needs, you may be able to upgrade directly from Dart 1 to
Dart 2, or you may need to take an intermediary step and provide a version of
your codebase that is both forwards- and backwards-compatible. Both of these
options are supported by this codemod.

- `dart pub global run over_react_codemod:dart2_upgrade --backwards-compat`

Use this codemod to migrate your over_react code to a format that is both
forwards-compatible with Dart 2 and backwards-compatible with Dart 1.

- `dart pub global run over_react_codemod:dart2_upgrade`

Use this codemod if you want to migrate to Dart 2 compatible code and do not
need to maintain backwards-compatability with Dart 1. You can run this to
immediately upgrade from Dart 1 to Dart 2, or you can run this on code that
has already been run through this codemod with the `--backwards-compat`
flag once you're ready to drop Dart 1 support.

For more information on the transition from Dart 1 to Dart 2 and how it affects
over_react, check out the [over_react Dart 2 migration guide][over_react_dart2].
It includes sample diffs of the changes that these codemods will introduce.
To use it, you'll need over_react_codemod 1.1.0 instead of the latest, which also must be used with Dart 2.1.0:
```sh
asdf install dart 2.1.0
asdf shell dart 2.1.0
pub global activate over_react_codemod 1.1.0
```
Once that's set up, see the `dart2_upgrade` documentation here: https://github.com/Workiva/over_react_codemod/tree/1.1.0#dart-1-to-dart-2-codemod

## Checking for Regressions

Expand Down

0 comments on commit 60bfa72

Please sign in to comment.