-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove MobX-State-Tree flag for non-demo projects #2647
base: v10
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First pass, it's taking shape nice work!
// TODO: full dryRun support | ||
|
||
p() | ||
p(`Removing MobX-State-Tree code from '${TARGET_DIR}'${dryRun ? " (dry run)" : ""}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about a try/catch here and if running into any issues, let's warn the user the automated removal could not be completed and refer them to the recipe to do so manually?
* feat: cng ftw * fix(babel-config): simplify plugins with SDK 50 * fix(boilerplate): remove unused eslint pkgs * fix(cli): reword workflow question * fix(cli): remove unnecessary warning
@Jpoliachik can you target this against |
* feat(boilerplate): mmkv in over async storage * fix(cli): remove async storage new arch specifics * test(boilerplate): mmkv clean up * fix(boilerplate): storage.load with just a string * test(boilerplate): storage test types
@frankcalise sure thing, I'll work on this early next week 👍 |
# Conflicts: # boilerplate/app/devtools/ReactotronConfig.ts # src/commands/new.ts
@@ -63,6 +63,7 @@ export const useInitialRootStore = (callback?: () => void | Promise<void>) => { | |||
|
|||
// reactotron integration with the MST root store (DEV only) | |||
if (__DEV__) { | |||
// @ts-ignore | |||
console.tron.trackMstNode(rootStore) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure why this wasn't needed before, but I was getting typescript errors without.
result = sanitize(result) | ||
} else { | ||
result = updateFile(result, markupPrefix) | ||
result = sanitize(result) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if this extra sanitize()
was happening before - what behavior do we want here, I assumed we'd always want to get rid of all the markup regardless
This PR adds support for removing MobX-State-Tree code from a non-demo project.
Retargeted to v10 branch.
Changes:
// @mst
inline comments, similar to how demo code removal worksdemo.ts
removal logic into more genericmarkup.ts
to be shared with@mst
comment types too, and make it easy to add additional other types in the future too.replace-next-line
markup command type, to help swap out lines of code easily without hot patching in scripts (keeps code replacements inline next to other code)TODOs:
(I'll also add some additional screenshots & videos for testing proof soon)