3 ms·
I’m happy to see this. After a breaking change in a Parcel (v1) update caused us some trouble a little while back, we took the opportunity to start trying out P
by Chris_Newton 5y ago
I’m happy to see this. After a breaking change in a Parcel (v1) update caused us some trouble a little while back, we took the opportunity to start trying out Parcel 2. At the time, source maps were broken and the fix went in just after the beta release we were using, but the pace of development since then has been impressive.
The SWC-based transpilation looks like another big improvement. For anyone else who had a similar configuration to us, with some Babel packages installed to support Jest for running tests regardless of what Parcel was doing with the main build process, this also looks interesting, though we haven’t tried it yet:
https://swc.rs/docs/usage-swc-jest/ https://swc.rs/docs/usage-swc-jest/
Edit: We have now tried it, but sadly several tests broke due to parsing problems. The cause remains a mystery so far, because the offending lines are in our application code and not our test files, and that same code does appear to build OK via Parcel. So it appears that SWC itself, at least as Parcel is using it, can parse everything involved, but for some reason to be determined, installing @swc/* packages directly as devDependencies and configuring the Jest transform for the relevant source files to use @swc/jest is not a drop-in replacement for the Jest+Babel combination we were using before. If anyone else has had more luck getting this working, and similarly getting ESLint to work well without needing Babel packages after moving other tools to use SWC, details would be appreciated! Otherwise, it looks like we’ll still need Babel for now to run the testing and linting tools, even if Parcel is using SWC for its builds.
- devongovett 5y agoI started prototyping a @parcel/jest preset and a @parcel/register package that would help with this. Basically it would use Parcel for builds when using other tools like testing frameworks. Potentially we could do something for ESLint as well. It's probably a post-2.0 feature, but hopefully that could help simplify this a bit.
- Chris_Newton 5y agoI think that would be useful eventually, but unfortunately my experience trying beta 3 this evening has been disastrous, so I’d definitely encourage you to focus on stability and reliability of the main build system first. Right now, it seems the only way to successfully build our code using beta 3 is to have none of the old Babel-related packages and config around any more, but that means we can’t use other essentials like Jest or ESLint that also rely on Babel. So unfortunately it looks like our current choices with Parcel are using Parcel 1 (recently broken in many ways as other comments have noted), Parcel 2 beta 2 (which was mostly working OK for us, though sourcemaps were broken) or Parcel 2 beta 3 (doesn’t look viable at all based on tonight’s experiments). Right now this project is only at prototype-to-MVP stage in a stealth-mode startup, so it’s worth spending some of our time to experiment with different tools and infrastructure if it gets us to a good set-up for the long term, but I hope you get to production-ready before we do! :-)
- mischnic 5y agoWould be great if you could open a Github issue describing the problems you ran into when using your existing Babel config. That should still work just as before