-
Notifications
You must be signed in to change notification settings - Fork 402
feat(e2e): Use Turbopack in Next.js app router e2e #5784
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
Conversation
🦋 Changeset detectedLatest commit: c360901 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
| .setEnvFormatter('public', key => `NEXT_PUBLIC_${key}`) | ||
| .addScript('setup', constants.E2E_NPM_FORCE ? 'pnpm install --force' : 'pnpm install') | ||
| .addScript('dev', 'pnpm dev') | ||
| .addScript('dev', constants.E2E_NEXTJS_VERSION === '13' ? 'pnpm dev:webpack' : 'pnpm dev') |
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.
Next.js v13 does not support next dev --turbo.
| experimental: { | ||
| serverActions: true, | ||
| }, | ||
| outputFileTracingRoot: '/', |
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.
By default, Turbopack doesn't resolve files outside of the project root. We use pnpm link to install dependencies, which exist outside of the root. We set the outputFileTracingRoot to the root / directory to allow Turbopack to resolve dependency files from anywhere on disk.
Description
This PR updates our Next.js App Router template to use Turbopack by default. While this doesn't dramatically decrease the execution time, it does make them slightly faster to run locally.
The improved performance of Turbopack versus Webpack surfaced an issue with how we use
signInWithEmailAndInstantPasswordin the billing tests. Since we performed a navigation immediately after calling the signIn method, the page was reloaded before the sign-in could be completed. This is because Turbopack was able to response with the HTML for the document request faster than Webpack. This was fixed by adding a new parameter to the method,waitForSession(defaults totrue) that will wait forwindow.Clerk.sessionto the truthy before resolving the promise.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change