GMOD / jbrowse-components

Source code for JBrowse 2, a modern React-based genome browser
https://jbrowse.org/jb2
Apache License 2.0
208 stars 62 forks source link

Convert webpack to rspack #4543

Closed cmdcolin closed 2 months ago

cmdcolin commented 2 months ago

This PR proposes using rspack, a "webpack-compatible" js bundler, for dev and production builds of jbrowse2

The rsbuild ecosystem was relatively easy to swap out for our codebase

why change at all

why rspack?

speed

app before time after time speedup
jbrowse-web yarn start 19s 1s ~19x
jbrowse-web yarn build 27s 3s ~9x
@jbrowse/react-app yarn storybook 100s 1s ~100x**
full repo CI 18minutes 10minutes ~1.8x

**note: this included disabling react-docgen which was slow and seemed unused (?)

why would we maybe not rspack/rsbuild

why not vite?

vite is arguably the most popular bundler, however we have trouble with it

Screenshot of vite giving an error:

![Screenshot from 2024-09-03 00-01-51](https://github.com/user-attachments/assets/00049b92-f880-47c7-a313-06125adcb4bc)

vite branch of jbrowse-web https://github.com/GMOD/jbrowse-components/tree/vite_web2