Skip to content
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

feat: base RN upgrades experience #36

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

okwasniewski
Copy link
Collaborator

This PR implements base React Native upgrades experience.

I was hitting token limits so it's not working perfectly.

Things to fix:

  • The diffs were sometimes not applied due to RNDiffApp being shown in the path of diff
  • We should clear out messages so that they don't hit the limit especially if we have instructions with large patches

project,
platforms,
} = await loadReactNativeConfig()
const { root, reactNativePath: path, project, platforms } = await loadReactNativeConfig()
Copy link
Collaborator Author

@okwasniewski okwasniewski Nov 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out React Native CLI is lying with versions (I was on 0.76.3 and it returns 0.76), it's better for AI to figure it out based on package.json

image

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know why? That is weird

action: dedent`
Go over user file tree and apply diffs to the project.
`,
diff,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

save diff into file in os.tmp() and return path here.

action: dedent`
Go over user file tree and apply diffs to the project.
`,
diff,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: in the future, we will need to unify our response formats. I think since AIs are conversational ,we can safely return Go over diff at path ${path} instead of returning it as an extra property

Upgrade React Native diff tool, returns a diff between two versions of React Native.

Parameters:
- "from" - source version, (Read the exact version from package.json using "readFile" tool). Example: "0.75.0"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I typically use this format just for Returns, because there's no validation. For parameters, I would just put this on the schema with zod.describe

success: true,
action: dedent`
Ask user to select a version from the list.
`,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: no need for decent if single line.

Also, we can try Ask user to select a version from the list: ${mappedList} if it works .

This is all serialized to string anyway at the end of the day

Copy link
Collaborator

@grabbou grabbou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is step towards right direction! Excited to land this and release it! I think this might be part of bigger upgrade release that we're working on! Left some feedback, I think we're good to go here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants