Delete babel display name plugin, delete explicit deps on babel, use SWC in dev #1769
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The icon export stuff and Ladle were the other big things using Babel, and they're gone in #1765 and #1768. The display name plugin is useful, but it seems like the React dev tools can tell you the path to a component if you click the view source button (see video). As far as I can tell that's basically what the plugin was doing for us. I've never noticed that before, but it looks like it's been in there since at least 2019. Weird. By getting rid of the plugin, Vite can use esbuild (or SWC if we use the plugin) in dev.
The second commit switches to the SWC-based React plugin. I didn't test too scientifically, but timings shown with the
--debug
flag on the dev server suggest it might be around twice as fast to rebuild on file changes, and it does feel a bit faster to my eye. It's a small difference in absolute terms, though — both are under half a second.2023-10-04-react-dev-tools.mp4