-
-
Notifications
You must be signed in to change notification settings - Fork 457
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
Experimental Next.js 12 Output File Tracing #2169
Experimental Next.js 12 Output File Tracing #2169
Conversation
Handler Size Report
Base Handler Sizes (kB) (commit e492064){
"Lambda": {
"Default Lambda": {
"Standard": 1524,
"Minified": 668
},
"Image Lambda": {
"Standard": 1488,
"Minified": 800
}
},
"Lambda@Edge": {
"Default Lambda": {
"Standard": 1534,
"Minified": 673
},
"Default Lambda V2": {
"Standard": 1526,
"Minified": 670
},
"API Lambda": {
"Standard": 634,
"Minified": 318
},
"Image Lambda": {
"Standard": 1496,
"Minified": 805
},
"Regeneration Lambda": {
"Standard": 1187,
"Minified": 546
},
"Regeneration Lambda V2": {
"Standard": 1253,
"Minified": 573
}
}
} New Handler Sizes (kB) (commit a0b9240){
"Lambda": {
"Default Lambda": {
"Standard": 1524,
"Minified": 668
},
"Image Lambda": {
"Standard": 1488,
"Minified": 800
}
},
"Lambda@Edge": {
"Default Lambda": {
"Standard": 1534,
"Minified": 673
},
"Default Lambda V2": {
"Standard": 1526,
"Minified": 670
},
"API Lambda": {
"Standard": 634,
"Minified": 318
},
"Image Lambda": {
"Standard": 1496,
"Minified": 805
},
"Regeneration Lambda": {
"Standard": 1187,
"Minified": 546
},
"Regeneration Lambda V2": {
"Standard": 1253,
"Minified": 573
}
}
} |
Codecov Report
@@ Coverage Diff @@
## master #2169 +/- ##
==========================================
- Coverage 83.54% 83.48% -0.07%
==========================================
Files 102 104 +2
Lines 3671 3711 +40
Branches 1169 1189 +20
==========================================
+ Hits 3067 3098 +31
- Misses 592 601 +9
Partials 12 12
Continue to review full report at Codecov.
|
Is this a no-go? I'd really love to use the new output format |
@jonahallibone I haven't had time to write really exhaustive tests... In the meantime, it seems Next.js is already working on a way to do the output themselves: https://nextjs.org/docs/advanced-features/output-file-tracing#automatically-copying-traced-files-experimental |
Awesome! We absolutely need this feature to include localization files. |
@Purii I do want to write more tests because otherwise the codecoverage check doesn't pass, but it does seem to work at least for my small site! |
const outputFileTracing = | ||
typeof inputs.build !== "boolean" && | ||
typeof inputs.build !== "undefined" && | ||
!!inputs.build.outputFileTracing; |
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.
probably can cover it in custom inputs test? or if it's not too convenient, we could modify the existing e2e tests to cover this
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.
I added a custom inputs test and also updated the next-app-experimental
to use this flag.
thanks! I think it looks fine for the most part, codecov drop is just 0.08%, I gave a minor comment, I can probably add a new app to test this later so we get coverage there |
@dphang I'm not familiar with the e2e test setup; would it make sense to run those before merging? |
Ran it here https://github.com/serverless-nextjs/serverless-next.js/actions/runs/1744128397 (there are some issues with the experimental app which I will fix later but if it passes on the other apps it should be fine) |
@dphang seems like another e2e app failed, how to debug? I'll try to run this branch locally against my own site if it catches any errors. |
Ya that app is because somehow the IAM policy got corrupted, I need to manually fix it. But it should be fine since actually your changes is primarily build-time (the apps tests are to sanity check it doesn't break existing things) and experimental now so we can add more e2e tests later. |
@dphang did the tests fail because of this branch? Any way I can help debug them? https://github.com/serverless-nextjs/serverless-next.js/actions/runs/1755195463 |
Hm I think a new minor version of nextjs yesterday is causing failures since we pick the latest one, need to look into logs and fix it but your changes hadn't failed earlier when I ran tests. I will check why it is failing, they may have introduced some new required files. |
This PR implements the Next.js 12 Output File Tracing, meaning that
@sls-next/serverless-component
will no longer set anytarget
while building Next.js, and will instead use the generated*.nft.json
files to copy required files into the Lambda@Edge deployment.To use the new feature, one should:
target
in the Next.js configuration (it's now deprecated)build.outputFileTracing: true
in theserverless.yml
inputs for@sls-next/serverless-component