-
Notifications
You must be signed in to change notification settings - Fork 38
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
Migrate from CRA to Vite #170
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Getting this error after following this tutorial for migrating from CRA testing tool to Vitest. It seems like another "you can't use
|
@franknoirot maybe try the following in class MockRTCPeerConnection {
constructor() {
}
createDataChannel() {
return
}
setRemoteDescription() {
return Promise.resolve()
}
setConfiguration() {
return Promise.resolve()
}
addEventListener() {
return Promise.resolve()
}
get localDescription() {
return Promise.resolve()
}
addTransceiver() {
return Promise.resolve()
}
createOffer() {
return Promise.resolve()
}
setLocalDescription() {
return Promise.resolve()
}
close() {
return Promise.resolve()
}
}
// @ts-ignore
global.RTCPeerConnection = MockRTCPeerConnection And remove I actually don't think we'll have many tests around wrtc, so I'd be open to having a couple of those tests only run in CI and are skipped locally. |
This is looking really good so far, don't let yourself get in too much strife with the tests, I'm happy to take a stab or it, or we can do it together. |
Huh that's super weird that it's working on your M1 just fine. Is that the case even with my Vite branch? Here are my environment versions too, are these wrong at all?
|
Oh right, maybe it's node, I've got |
Some progress but still got some issue, up to you if you want to merge or not. But got rid of wrtc and solved a couple of other test issues. The one I'm stuck on though is this annoying issue with code-mirror
I was focused on the tests, before I put the PR up I tried yarn start and the page never properly loads because of an error, I'm not sure If I introduced it or not. |
Oh interesting, I think it is something about Apple Silicon because I can't even install Node 14 using NVM. This answer is suggesting I open ZSH with Rosetta and mimic the Intel process when I use the command line basically, but I really only want to do that when I'm about to work with Node 14 or lower. Do you have Rosetta enabled for your terminal then? |
Okay I've definitely hit a roadblock with #175 I think there's just an incompatibility with vitest and codemirror, or at least our version of it. I was tempted to get jest working again instead since that's what was running with CRA, but I felt like that was maybe taking the migration away from your direction. topic change, when I run |
|
Going to rebase to fix conflicts |
fwiw, when I was trying to use Vitest, everything went smoothly, it was only the one dependency that seemed to have an incompatibility, getting jest to work was a slog, and nothing was a show stopper, just one thing after the other. Would be happy to migrate to Vitest later if we're able to. |
I think this is probably ready to be merged, I think I'll sleep on it first and do a self-review in the morning as well though. |
Found a few lingering deps that were not needed. Will merge after vercel and tests ✅ |
Okay dope, finally got vercel to be happy again. |
* some test progress * something maybe working * remove local lib * small clean up
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.
Let's go!
I want to be able to add React Router to the app so that we can get normal browser routing behavior. All the examples in the getting started page use Vite, so I decided it might be good to nip this in the bud while I'm at it. Really not as crazy as I thought it would be, but I may need a little bit more context on how testing is set up in the project to finish this.
I followed this tutorial for the basic migration, then followed this one to add back TS support and this one to add back ESLint.