Code migration as-a-service
Presenter: OTIS
Backstage
React 17
Shell
Starhome
Module
UI
React 18
const Button = ({ size, color }) => {
return <button style={{ color, fontSize: size }}>Click me</button>;
}
Button.defaultProps = {
size: '16px',
color: 'blue'
}
const Button = ({ size = '16px', color = 'blue' }) => {
return <button style={{ color, fontSize: size }}>Click me</button>;
}Bot...
Codemod
Let me
A script used to automate codebase changes, especially during large refactors or migrations
An end-to-end platform for code migrations at scale
Learn from locally changes
2
1. Manually write your own codemod
2. Turn an existing codemod into a Codemod-compatible package.
3
1
Online studio
Make a change
Run `codemod learn`
Building the codemod
Export/publish the generated codemod
Dependency on git diff
Inconvenient to debug
Poor learning (only 1 example)
Sensitive data can be scanned
Add before/after code examples
Add natural language descriptions
Build codemod with AI
Test codemod (and iterate)
Exporting codemod
Can cost money to use AI assistant (PRO version)
Need to describe in detail by writing comments
Can not handle complex cases/ edge cases
Verify codemod engine compatibility
Initialize codemod package
Update transform file content
Update package configuration file
Publish the codemod
Need knowledge about AST, jscodeshift, codemod scaffold
A centralized hub for discovering and sharing Codemods
My
Codemod
user 1
Codemod Registry
user 1
user 2
user 3
Can be shared and reused across projects
Time-saving and free
Change behavior to use AI
Migrating to a new framework or library
Reorganizing a large codebase
Applying new coding standards at scale
Faster migrations and refactoring
Consistency across the codebase
Requires testing to ensure accuracy
Not suitable for minor changes or one-off updates