react-modal icon indicating copy to clipboard operation
react-modal copied to clipboard

Moving to a "modern" build system (hardcore level)

Open diasbruno opened this issue 1 year ago • 6 comments

react-modal uses an old toolchain system for build and testing (not that the tools aren't great, but because javascript toolchain are pretty messy and not reliable as things changes all the time).

The idea is to move to a "modern" build system (probably vite as it also has compatibility with karma, but suggestions are welcome) as people apparently have move to it.

diasbruno avatar Feb 08 '24 13:02 diasbruno

karma has been deprecated.

diasbruno avatar Feb 08 '24 20:02 diasbruno

Oh, vite is an interesting idea. I've only used it for web front-ends but it makes sense that one could use it for building a library, too. 🤔

Moving away from having to maintain a webpack config seems extremely worth it, though! 😆

With respect to the Karma deprecation, would moving to Jest make sense? I would be happy to help with that if so. (We use Jest and RTL at Slack and I find it to be an effective combination.) :)

doeg avatar Feb 09 '24 17:02 doeg

I thought of moving the test system to jest, but we need to run on the browser as we have a few trick bits to have more reliable tests (to detect hidden node and other things).

I tried to rework the project using vite, but I gave up. Maybe other option like swc or esbuild by hand would be also nice.

Suggestions?

diasbruno avatar Feb 10 '24 00:02 diasbruno

I don't have any hands-on experience with swc or esbuild, to tell you the truth, so I can't really offer an informed suggestion. 😹 That said, we are starting to experiment with swc at Slack.

I started looking into the two and they seem pretty comparable in speed, stability, and features. I expect it will come down to whichever one has better ergonomics...?

One thing worth calling out is that bundling with swc is done via swcpack, which has this caveat:

This feature is still under construction. Also, the main author of SWC works for Turbopack(opens in a new tab) by Vercel, so this feature is not a something that will be actively developed.

doeg avatar Feb 10 '24 16:02 doeg

I opened a separate issue to discuss replacing Karma here: https://github.com/reactjs/react-modal/issues/1038

doeg avatar Feb 10 '24 16:02 doeg

swc has a nice toolchain - it's my favorite for now (but I also have may problems setting up a project with it).

Let me give swc a chance...

diasbruno avatar Feb 10 '24 20:02 diasbruno