@@ -18,35 +18,29 @@ pub global activate over_react_codemod
18
18
Once you've activated this package, you should be able to run whichever codemods
19
19
you need via ` pub global run ` .
20
20
21
- ## Dart 1 to Dart 2 Codemods
21
+ ## Dart 1 to Dart 2 Codemod
22
+
23
+ This package provides a ` dart2_upgrade ` codemod that will modify existing
24
+ over_react component code to be compatible with Dart 2 and the over_react
25
+ builder.
22
26
23
27
Depending on your needs, you may be able to upgrade directly from Dart 1 to
24
28
Dart 2, or you may need to take an intermediary step and provide a version of
25
- your codebase that is both forwards- and backwards-compatible.
26
-
27
- This package provides three codemod executables:
28
-
29
- - ` pub global run over_react_codemod:dart1_to_dart2 `
29
+ your codebase that is both forwards- and backwards-compatible. Both of these
30
+ options are supported by this codemod.
30
31
31
- Use this codemod if you want to migrate directly from Dart 1 compatibile
32
- code to Dart 2 compatible code and do not need to provide a version that is
33
- compatible with both.
34
-
35
- _ Still in progress; coming soon._
36
-
37
- - ` pub global run over_react_codemod:dart1_to_dart1_and_dart2 `
32
+ - ` pub global run over_react_codemod:dart2_upgrade --backwards-compat `
38
33
39
34
Use this codemod to migrate your over_react code to a format that is both
40
35
forwards-compatible with Dart 2 and backwards-compatible with Dart 1.
41
36
42
- - ` pub global run over_react_codemod:dart1_and_dart2_to_dart2 `
43
-
44
- Use this codemod to migrate over_react code that has previously been
45
- migrated via the ` dart1_to_dart1_and_dart2 ` codemod to the form that is only
46
- compatible with Dart 2. In other words, use this when you're ready to drop
47
- Dart 1 support.
37
+ - ` pub global run over_react_codemod:dart2_upgrade `
48
38
49
- _ Still in progress; coming soon._
39
+ Use this codemod if you want to migrate to Dart 2 compatible code and do not
40
+ need to maintain backwards-compatability with Dart 1. You can run this to
41
+ immediately upgrade from Dart 1 to Dart 2, or you can run this on code that
42
+ has already been run through this codemod with the ` --backwards-compat `
43
+ flag once you're ready to drop Dart 1 support.
50
44
51
45
For more information on the transition from Dart 1 to Dart 2 and how it affects
52
46
over_react, check out the [ over_react Dart 2 migration guide] ( over_react_dart2 ) .
@@ -69,7 +63,7 @@ checklist will prevent merging code that is not in the form that is compatible
69
63
with both Dart 1 and Dart 2:
70
64
71
65
``` bash
72
- pub global run over_react_codemod:dart1_to_dart1_and_dart2 --fail-on-changes
66
+ pub global run over_react_codemod:dart2_upgrade --fail-on-changes
73
67
```
74
68
75
69
## Ignoring Codemod Suggestions
@@ -87,8 +81,8 @@ of ending with `StateMixin`, but isn't actually an over_react state mixin:
87
81
class Foo extends Object with BarStateMixin {}
88
82
```
89
83
90
- As is, the ` dart1_to_dart1_and_dart2 ` codemod would find this code and attempt
91
- to change it to:
84
+ As is, the ` dart2_upgrade --backwards-compat ` codemod would find this code and
85
+ attempt to change it to:
92
86
93
87
``` dart
94
88
class Foo extends Object
0 commit comments