You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnfileInfo.source; // Writes original untouched file
73
+
returnfile.source; // Writes original untouched file
78
74
}
79
75
```
80
76
81
77
## Motions
82
78
83
-
A motion is what we call specific actions performed within a codemod. For example, `updateBorderWidth` or `removeDeprecatedProps`.
79
+
A motion (aka migration) is what we call specific actions performed within a codemod. For example, `updateBorderWidth` or `removeDeprecatedProps`.
84
80
They can be simply thought of a functions that are responsible for a single action within a codemod. This is not required but can help to isolate more complicated parts of your codemod into a single place.
Copy file name to clipboardExpand all lines: website/docs/guiding-principles.mdx
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ slug: /guiding-principles
6
6
7
7
There are several guiding principles we follow in this project.
8
8
9
-
## Target a package & version
9
+
## Codemod should target a version of package
10
10
11
11
- APIs are always changing
12
12
- Codemods written at a specific point of time aren't always going to work into the future
@@ -18,6 +18,8 @@ This gives us a lot of benefits,
18
18
2. Codemods can be 'playable in a sequence', for example migrating from an older version of `@atlaskit/button` to the latest is possible for example `v14 -> v15 -> v16`.
19
19
3. TODO`
20
20
21
+
## Codemods should be playable in sequence
22
+
21
23
## Everyone should ship codemods
22
24
23
25
Codemods aren't complicated, anyone who has writtin anything in jQuery should be able to write a codemod with relative ease.
Moving between different types of React composition strategies, like for example, from component props to [render props](https://reactjs.org/docs/render-props.html#using-props-other-than-render) is could be something you want to do between major versions.
253
+
This might seem difficult on the surface, but think about it like every other codemod. First we need to find the component, replace it with a modified copy of itself and finally insert a function as children.
0 commit comments