-
-
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
fix(@astrojs/vercel): slowness and symbolic link #8348
Conversation
🦋 Changeset detectedLatest commit: c66907c The changes in this PR will be included in the next version bump. 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 |
!preview vercel-symbolic-link |
bfceeb1
to
c66907c
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.
Code looks good! Let’s get user confirmation that this fixes the issue before releasing
// NOTE: when building function per route, dependencies are linked at the first run, then there's no need anymore to do that once more. | ||
// So we check if the destination already exists. If it does, move on. |
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.
But doesn't every function get its own node_modules
?
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.
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.
Full disclosure, it's still something a bit foggy to me, especially that part of the code. It's possible my comment is wrong
|
Changes
Closes #8312
This PR addresses two issues:
/
orC:\
). On big projects (monorepos), this could cause a lot of overhead. Fortunately,@vercel/nft
allows us to pass acache
object to reuse when bundling the functions. The first function to bundle will always be slow, but the next ones are way faster.pnpm
. Essentially, our adapter carries over the symbolic link of our inlined (external, not bundled) dependencies. After the first run, we have the source of the symbolic link in thepnpm
store, so we don't need to create a new one again. Hopefully, this should fix the issue.Testing
Create a preview release and ask users to try it, and make sure to check if the deployed function works.
Docs
N/A