-
Notifications
You must be signed in to change notification settings - Fork 4
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: skew protection #1658
fix: skew protection #1658
Conversation
Playwright test resultsDetails 1 test across 1 suite |
📦 Next.js Bundle Analysis for fern-platform-monorepoThis analysis was generated by the Next.js Bundle Analysis action. 🤖 🎉 Global Bundle Size Decreased
DetailsThe global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster. Any third party scripts you have added directly to your app using the If you want further insight into what is behind the changes, give @next/bundle-analyzer a try! New Pages AddedThe following pages were added to the bundle from the code in this PR:
|
Playwright test resultsDetails 81 tests across 3 suites |
Problem 1: when you run
vercel build
thenvercel deploy --prebuilt
, we don't actually get access to any of the vercel-specific environment variables, e.g.VERCEL_DEPLOYMENT_ID
orVERCEL_ENV
at built-time. So, we needed to switch the deployment model such that source files are uploaded to vercel so that vercel build the deployment directly.Problem 2: nextjs (perhaps because we're using a fork of nextjs?) is not correctly setting the x-deployment-id header in the prefetch requests. to circumvent this, we're appending
?dpl=${process.env.NEXT_DEPLOYMENT_ID}
to all prefetch requests from the router. This will force skew protection on prefetching!Problem 3: all other fetch requests to
/api/fern-docs/*
must have thex-deployment-id
header set to leverage skew protection. For some reason, nextjs is stripping away this header, so we are appending?dpl=
instead.Side effect: nextjs bundle analyzer requires that the nextjs bundle is done locally. I've updated the gh action script to handle this.