-
-
Notifications
You must be signed in to change notification settings - Fork 490
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
Improve compilation speed (and potentially bundle size) #801
Improve compilation speed (and potentially bundle size) #801
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@timneutkens is attempting to deploy a commit to the TypeCell Team on Vercel. A member of the Team first needs to authorize it. |
Bedankt @timneutkens 👋 This is great. We'll make sure this gets merged and shipped as part of next release. Do you have a link to the specific report or is it not on github? |
No worries! The report was on X, more details here: https://x.com/timneutkens/status/1797974591513542785 You can have a look at the trace files shared using |
# Conflicts: # packages/ariakit/src/menu/Menu.tsx # packages/ariakit/src/sideMenu/SideMenu.tsx # packages/mantine/src/menu/Menu.tsx # packages/mantine/src/sideMenu/SideMenu.tsx
Thanks! I made the same changes to the Ariakit and ShadCN packages, likely those suffer from the same compilation speed issues but this wasn't seen in the report as you would ofc only use one out of the three. Additionally I added the "Mantine-" prefix to all Mantine components just to make it a bit more explicit which components are imported and which are defined. |
Awesome, thanks Matthew! 🚀 |
(Off topic: this is a cool project!) |
While investigating a report of slow compilation in Turbopack (with Next.js) I found that BlockNote is causing all of Mantine to be compiled as it uses
import * as Mantine from '@mantine/core'
.@mantine/core
is quite large by itself so even if tree shaking kicks in when building for production it still adds overhead in development when trying to import all components from it.This PR ensures that only the components that are used are imported. It also adds
sideEffects: false
config which ensures bundlers can make more assumptions about the code and optimize it further.Here's a screenshot from our tracing tooling: