feat: add Agent Skill for S1 to S2 migration#9778
Conversation
…ching import and could miss v3 imports when an @react-spectrum/s2 import appears first
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
|
||
| ## App and Provider setup | ||
|
|
||
| - Full-page apps usually add `import '@react-spectrum/s2/page.css';` at the entrypoint and no longer need a mandatory root Provider just to supply `theme={defaultTheme}`. |
There was a problem hiding this comment.
i thought we changed it so that the S2 Provider was always needed in order to load the font? originally it was optional but i thought it sorta became mandatory
LFDanLu
left a comment
There was a problem hiding this comment.
Still reading through these, but in general how were these guides created? Were they common pitfalls you found when using the codemod/sourced from internal discussions/etc?
Ideas on keeping these up to date as we make other changes that introduce additional complexities to a S1 to S2 migration? Does this work well with version differences/variences (both S1 and S2)?
I started with a base skill, then tried it out in several real repos. I then got an agent to analyze the agent's actions during those migrations. I integrated the feedback from that back into the skill.
I don't anticipate this will need much maintenance. If we keep updating the codemod when needed, that should cover most things, but we can always update these skills and they'll be live in the next docs release. |
This PR adds an Agent Skill that helps users upgrade from v3 to S2. TLDR is that it tells the agent how to effectively run the codemods, then fix everything the codemod couldn't fix automatically.
✅ Pull Request Checklist:
📝 Test Instructions:
Install the skill:
and invoke it when upgrading your project.
Important
The skill mentions running the codemod with "--agent". This has not been released yet, so you may need to manually update the skill to point to a nightly release, which does include it: https://www.npmjs.com/package/@react-spectrum/codemods?activeTab=versions.
Example: Replace
npx @react-spectrum/codemods s1-to-s2 --agentwithnpx @react-spectrum/codemods@3.0.0-nightly-7ba11ce33-260324 s1-to-s2 --agent🧢 Your Project: