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

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

Open
diasbruno opened this issue Feb 8, 2024 · 6 comments · May be fixed by #1043
Open

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

diasbruno opened this issue Feb 8, 2024 · 6 comments · May be fixed by #1043

Comments

@diasbruno
Copy link
Collaborator

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 diasbruno changed the title Moving to a better build system (hardcore level) Moving to a "modern" build system (hardcore level) Feb 8, 2024
@diasbruno
Copy link
Collaborator Author

karma has been deprecated.

@doeg
Copy link

doeg commented Feb 9, 2024

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.) :)

@diasbruno
Copy link
Collaborator Author

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?

@doeg
Copy link

doeg commented Feb 10, 2024

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
Copy link

doeg commented Feb 10, 2024

I opened a separate issue to discuss replacing Karma here: #1038

@diasbruno
Copy link
Collaborator Author

diasbruno commented Feb 10, 2024

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 diasbruno linked a pull request Feb 27, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants