-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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 build perf #2697
Improve build perf #2697
Conversation
🦋 Changeset detectedLatest commit: 85140d7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
8ad46dc
to
c806184
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Nice improvements. 👍🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! I'd be curious to see if there's any gains by parallelizing in chunks or with a worker pool, but I'm totally on-board with simplifying this now and looking into optimizations down the road 👍
lgtm, we can also potentially remove ---
import Namespace from 'namespace';
const Div = Namespace.Div;
---
<Div /> But we could support this instead: ---
import Namespace from 'namespace';
---
<Namespace.Div /> Seems like an ok restriction to me. edit: this restriction really only needs to apply to |
Note that there are a couple of (code) changes that would be needed to get rid of the preload step, but that's the only one that would be a breaking change (I think). |
Thinking more about it, using runtime variables as component names for client component is already not going to work, so this restriction already kind of exists just not officially. |
I would be okay with this if there's a really clear error or warning when you break the rule. |
* improve md perf * chore: add changesets Co-authored-by: Nate Moore <nate@skypack.dev>
Changes
While working on the docs repo, I chased down two performance issues related to docs build:
ssrPreload
appears to be mostly serial work, so 142+ pages of of docs inside aPromise.all()
all blocked each other from completing. This hung the build entirely when I switched the docs parser over to Shiki (see next).getHighlighter
is the most expensive part of shiki, and we were calling it once per page. Caching this for later returned improvement to previous Prism-levels.@sarah11918 FYI both of these together were causing the failing builds you were seeing when we enabled that config change.
Testing
Docs