Skip to content
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

[pull] canary from vercel:canary #556

Merged
merged 56 commits into from
Jan 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
d61b076
Use sequentialRead while encoding images with sharp (#44881)
Brooooooklyn Jan 14, 2023
c35aec8
Removes title warning from cms example (#44894)
rajavijayach Jan 15, 2023
196957f
Next/Script documentation beforeInteractive inconsistency (#44898)
rortan134 Jan 16, 2023
969cca8
Move server-external-packages to JSON (#44910)
ijjk Jan 16, 2023
869aab3
fix standalone wrong url being logged (#44887)
IgnisDa Jan 16, 2023
8613297
Fix prepublish compiled handling (#44914)
ijjk Jan 16, 2023
dba9e2a
fix(docs): update broken link for preset.ts (#44916)
okinawaa Jan 16, 2023
d5a188d
Update test env variable passing (#44912)
ijjk Jan 16, 2023
d45d0f9
Custom RSC compiler error message in pages/ (#44865)
hanneslund Jan 16, 2023
71efc03
Support Prefer Offline for testing (#44935)
wyattjoh Jan 16, 2023
68db406
Fix Node.js version to 14.6.0 in Upgrading guide. (#44939)
leerob Jan 16, 2023
28bf703
Update test env for E2E deploy mode (#44937)
ijjk Jan 16, 2023
e78c6ec
Replace eslint rule for `no-shadow` with `typescript-eslint/no-shadow…
wyattjoh Jan 17, 2023
8a8a70e
v13.1.3-canary.1
ijjk Jan 17, 2023
66094ef
Ensure rootLayoutIncluded is set on partial render (#44958)
timneutkens Jan 17, 2023
4f410e4
v13.1.3-canary.2
timneutkens Jan 17, 2023
8739e61
Update build env for test timings (#44970)
ijjk Jan 17, 2023
5b5cc33
Fix force-static description in next-typescript (#44951)
hanneslund Jan 17, 2023
a443bb9
Update to skip test timings on docs change (#44971)
ijjk Jan 17, 2023
1e0b5bf
Fix `with-stencil` example (#44964)
Jan 17, 2023
b04fc99
update redirects.md (#44960)
deli-ght Jan 17, 2023
3a9bfe6
Fix CSS imports being tracked multiple times (#44938)
shuding Jan 17, 2023
aeef38e
Use withoutEnlargement instead of sharp.metadata() (#44890)
ITJesse Jan 17, 2023
0983050
Add AsyncLocalStorage to edge-runtime APIs (#44975)
ijjk Jan 17, 2023
2bc8e74
Update res.revalidate to pass through headers (#44981)
ijjk Jan 17, 2023
f741b88
v13.1.3-canary.3
ijjk Jan 17, 2023
034ee8a
Update some flakey acceptance tests (#44984)
ijjk Jan 17, 2023
6d09f0b
Add experimental.allowedRevalidateHeaderKeys config (#44985)
ijjk Jan 17, 2023
8f0acdf
Gracefully handle telemetry not being available (#44986)
ijjk Jan 18, 2023
c72ebf7
v13.1.3-canary.4
ijjk Jan 18, 2023
a54e43a
Optimize to skip upload for non-publish swc builds (#44987)
ijjk Jan 18, 2023
cefb30b
Update codesandbox link in issue template (#44995)
jankaifer Jan 18, 2023
6b7c69f
Add proper error when app path switches static to dynamic (#44989)
ijjk Jan 18, 2023
04f2646
Update test timings token env (#45014)
ijjk Jan 18, 2023
ad48202
Ensure force-dynamic is honored during build (#45015)
ijjk Jan 18, 2023
d7307cf
Fix turbo usage in tests (#44715)
jankaifer Jan 18, 2023
4dfe831
Add project directory rename/remove handling (#44911)
ijjk Jan 18, 2023
27b95ff
chore: open dev overlay error links in new tab (#45018)
dunklesToast Jan 18, 2023
c50641f
Remove next-app-loader from import trace (#44996)
hanneslund Jan 18, 2023
57fb41b
Ensure additional windows are not created on Windows OS (#45022)
ijjk Jan 19, 2023
9b97461
v13.1.3-canary.5
ijjk Jan 19, 2023
a4d9373
Remove useless ts-ignores (#45025)
therealrinku Jan 19, 2023
98a2448
Fix release stats (#45027)
ijjk Jan 19, 2023
06ed494
refactor: Latest Tigris sdk and example using decorators (#44256)
adilansari Jan 19, 2023
d363e6f
Don't dispaly "Error: " twice when router isn't mounted (#45038)
hanneslund Jan 19, 2023
9b39c79
Display the reason of hydration error in error overlay (#44857)
hanneslund Jan 19, 2023
3d56dcf
Remove legacy safari test (#45055)
ijjk Jan 19, 2023
72d35d0
Fix typescript plugin (#44128)
reiss-d Jan 19, 2023
0a5097c
Add shiki and vscode-oniguruma to default server-external packages (#…
selenecodes Jan 19, 2023
0faedd9
Fix error when CSS @import fails to resolve (#45010)
hanneslund Jan 19, 2023
c648f9d
Fix next/dynamic non ssr in pages when appDir is enabled (#45066)
huozhi Jan 19, 2023
bd23ad3
v13.1.3-canary.6
ijjk Jan 19, 2023
919a711
v13.1.3
ijjk Jan 20, 2023
55f3a6d
Fix broken argument for rewrites on link reference docs (#45073)
guitheengineer Jan 20, 2023
d1f6a42
Initial support for metadata (#44729)
shuding Jan 20, 2023
c254b74
v13.1.4-canary.0
timneutkens Jan 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ examples/with-flow/**
examples/with-jest/**
examples/with-mobx-state-tree/**
examples/with-mobx/**
examples/with-tigris/db/models/todoItems.ts
packages/next/src/bundles/webpack/packages/*.runtime.js
packages/next/src/bundles/webpack/packages/lazy-compilation-*.js
packages/next/src/compiled/**/*
Expand All @@ -36,4 +37,4 @@ bench/nested-deps/pages/**
bench/nested-deps/components/**
packages/next-bundle-analyzer/index.d.ts
examples/with-typescript-graphql/lib/gql/
test/development/basic/hmr/components/parse-error.js
test/development/basic/hmr/components/parse-error.js
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@
{
"files": ["packages/**/*.tsx", "packages/**/*.ts"],
"rules": {
// Note: you must disable the base rule as it can report incorrect errors
"no-shadow": "off",
"@typescript-eslint/no-shadow": ["warn", { "builtinGlobals": false }],
"@typescript-eslint/no-unused-vars": [
"warn",
{
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/1.bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ body:
- type: input
attributes:
label: Link to the code that reproduces this issue
description: A link to a GitHub repository, a [StackBlitz](https://stackblitz.com/fork/github/vercel/next.js/tree/canary/examples/reproduction-template), or a [CodeSandbox](https://codesandbox.io/s/github/vercel/next.js/tree/canary/examples/reproduction-template) minimal reproduction. Minimal reproductions should be created from our [bug report template with `npx create-next-app -e reproduction-template`](https://github.com/vercel/next.js/tree/canary/examples/reproduction-template) and should include only changes that contribute to the issue.
description: A link to a GitHub repository, a [StackBlitz](https://stackblitz.com/fork/github/vercel/next.js/tree/canary/examples/reproduction-template), or a [CodeSandbox](https://codesandbox.io/p/sandbox/github/vercel/next.js/tree/canary/examples/reproduction-template) minimal reproduction. Minimal reproductions should be created from our [bug report template with `npx create-next-app -e reproduction-template`](https://github.com/vercel/next.js/tree/canary/examples/reproduction-template) and should include only changes that contribute to the issue.
validations:
required: true
- type: textarea
Expand Down
1 change: 1 addition & 0 deletions .github/actions/next-stats-action/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"main": "src/index.js",
"dependencies": {
"async-sema": "^3.1.0",
"execa": "2.0.3",
"fs-extra": "^8.1.0",
"get-port": "^5.0.0",
"glob": "^7.1.4",
Expand Down
6 changes: 2 additions & 4 deletions .github/actions/next-stats-action/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ if (!allowedActions.has(actionInfo.actionName) && !actionInfo.isRelease) {
if (actionInfo.isRelease) {
logger('Release detected, resetting mainRepo to last stable tag')
const lastStableTag = await getLastStable(mainRepoDir, actionInfo.prRef)
mainNextSwcVersion = {
'@next/swc-linux-x64-gnu': lastStableTag,
}
mainNextSwcVersion = lastStableTag
if (!lastStableTag) throw new Error('failed to get last stable tag')
console.log('using latestStable', lastStableTag)
await checkoutRef(lastStableTag, mainRepoDir)
Expand Down Expand Up @@ -140,7 +138,7 @@ if (!allowedActions.has(actionInfo.actionName) && !actionInfo.isRelease) {
const isMainRepo = dir === mainRepoDir
const pkgPaths = await linkPackages({
repoDir: dir,
nextSwcPkg: isMainRepo ? mainNextSwcVersion : undefined,
nextSwcVersion: isMainRepo ? mainNextSwcVersion : undefined,
})

if (isMainRepo) mainRepoPkgPaths = pkgPaths
Expand Down
194 changes: 106 additions & 88 deletions .github/actions/next-stats-action/src/prepare/repo-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ const exec = require('../util/exec')
const { remove } = require('fs-extra')
const logger = require('../util/logger')
const semver = require('semver')

const mockTrace = () => ({
traceAsyncFn: (fn) => fn(mockTrace()),
traceChild: () => mockTrace(),
})
const execa = require('execa')

module.exports = (actionInfo) => {
return {
Expand Down Expand Up @@ -58,12 +54,47 @@ module.exports = (actionInfo) => {
}
}
},
async linkPackages({ repoDir = '', nextSwcPkg, parentSpan }) {
const rootSpan = parentSpan
? parentSpan.traceChild('linkPackages')
: mockTrace()
async linkPackages({ repoDir, nextSwcVersion }) {
let hasTestPack = false

try {
hasTestPack = Boolean(
((await fs.readJSON(path.join(repoDir, 'package.json'))).scripts ||
{})['test-pack']
)
} catch (err) {
console.error(err)
}

if (hasTestPack) {
execa.sync('pnpm', ['turbo', 'run', 'test-pack'], {
cwd: repoDir,
env: { NEXT_SWC_VERSION: nextSwcVersion },
})

return await rootSpan.traceAsyncFn(async () => {
const pkgPaths = new Map()
const pkgs = await fs.readdir(path.join(repoDir, 'packages'))

pkgs.forEach((pkgDirname) => {
const { name } = require(path.join(
repoDir,
'packages',
pkgDirname,
'package.json'
))
pkgPaths.set(
name,
path.join(
repoDir,
'packages',
pkgDirname,
`packed-${pkgDirname}.tgz`
)
)
})
return pkgPaths
} else {
// TODO: remove after next stable release (current v13.1.2)
const pkgPaths = new Map()
const pkgDatas = new Map()
let pkgs
Expand All @@ -78,97 +109,84 @@ module.exports = (actionInfo) => {
throw err
}

await rootSpan
.traceChild('prepare packages for packing')
.traceAsyncFn(async () => {
for (const pkg of pkgs) {
const pkgPath = path.join(repoDir, 'packages', pkg)
const packedPkgPath = path.join(pkgPath, `${pkg}-packed.tgz`)

const pkgDataPath = path.join(pkgPath, 'package.json')
if (!fs.existsSync(pkgDataPath)) {
require('console').log(`Skipping ${pkgDataPath}`)
continue
}
const pkgData = require(pkgDataPath)
const { name } = pkgData
pkgDatas.set(name, {
pkgDataPath,
pkg,
pkgPath,
pkgData,
packedPkgPath,
})
pkgPaths.set(name, packedPkgPath)
}
for (const pkg of pkgs) {
const pkgPath = path.join(repoDir, 'packages', pkg)
const packedPkgPath = path.join(pkgPath, `${pkg}-packed.tgz`)

for (const pkg of pkgDatas.keys()) {
const { pkgDataPath, pkgData } = pkgDatas.get(pkg)
const pkgDataPath = path.join(pkgPath, 'package.json')
if (!fs.existsSync(pkgDataPath)) {
require('console').log(`Skipping ${pkgDataPath}`)
continue
}
const pkgData = require(pkgDataPath)
const { name } = pkgData
pkgDatas.set(name, {
pkgDataPath,
pkg,
pkgPath,
pkgData,
packedPkgPath,
})
pkgPaths.set(name, packedPkgPath)
}

for (const pkg of pkgDatas.keys()) {
const { packedPkgPath } = pkgDatas.get(pkg)
if (!pkgData.dependencies || !pkgData.dependencies[pkg])
continue
pkgData.dependencies[pkg] = packedPkgPath
}
for (const pkg of pkgDatas.keys()) {
const { pkgDataPath, pkgData } = pkgDatas.get(pkg)

// make sure native binaries are included in local linking
if (pkg === '@next/swc') {
if (!pkgData.files) {
pkgData.files = []
}
pkgData.files.push('native')
require('console').log(
'using swc binaries: ',
await exec(
`ls ${path.join(path.dirname(pkgDataPath), 'native')}`
)
)
}
for (const pkg of pkgDatas.keys()) {
const { packedPkgPath } = pkgDatas.get(pkg)
if (!pkgData.dependencies || !pkgData.dependencies[pkg]) continue
pkgData.dependencies[pkg] = packedPkgPath
}

if (pkg === 'next') {
if (nextSwcPkg) {
Object.assign(pkgData.dependencies, nextSwcPkg)
} else {
if (pkgDatas.get('@next/swc')) {
pkgData.dependencies['@next/swc'] =
pkgDatas.get('@next/swc').packedPkgPath
} else {
pkgData.files.push('native')
}
}
}
// make sure native binaries are included in local linking
if (pkg === '@next/swc') {
if (!pkgData.files) {
pkgData.files = []
}
pkgData.files.push('native')
require('console').log(
'using swc binaries: ',
await exec(`ls ${path.join(path.dirname(pkgDataPath), 'native')}`)
)
}

await fs.writeFile(
pkgDataPath,
JSON.stringify(pkgData, null, 2),
'utf8'
)
if (pkg === 'next') {
if (nextSwcVersion) {
Object.assign(pkgData.dependencies, {
'@next/swc-linux-x64-gnu': nextSwcVersion,
})
} else {
if (pkgDatas.get('@next/swc')) {
pkgData.dependencies['@next/swc'] =
pkgDatas.get('@next/swc').packedPkgPath
} else {
pkgData.files.push('native')
}
}
})
}

await fs.writeFile(
pkgDataPath,
JSON.stringify(pkgData, null, 2),
'utf8'
)
}

// wait to pack packages until after dependency paths have been updated
// to the correct versions
await rootSpan
.traceChild('packing packages')
.traceAsyncFn(async (packingSpan) => {
await Promise.all(
Array.from(pkgDatas.keys()).map(async (pkgName) => {
await packingSpan
.traceChild(`pack ${pkgName}`)
.traceAsyncFn(async () => {
const { pkg, pkgPath } = pkgDatas.get(pkgName)
await exec(
`cd ${pkgPath} && yarn pack -f '${pkg}-packed.tgz'`,
true
)
})
})
await Promise.all(
Array.from(pkgDatas.keys()).map(async (pkgName) => {
const { pkg, pkgPath } = pkgDatas.get(pkgName)
await exec(
`cd ${pkgPath} && yarn pack -f '${pkg}-packed.tgz'`,
true
)
})
)

return pkgPaths
})
}
},
}
}
Loading