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

next-upgrade: Ensure highest versions are used not latest #73566

Conversation

eps1lon
Copy link
Member

@eps1lon eps1lon commented Dec 5, 2024

npm view <package>@<query> returns packages in publish order. But we want the highest.

@ijjk ijjk added created-by: Next.js team PRs by the Next.js team. type: next labels Dec 5, 2024
Copy link
Member Author

eps1lon commented Dec 5, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

@@ -53,6 +53,8 @@ async function loadHighestNPMVersionMatching(query: string) {
// npm-view returns an array if there are multiple versions matching the query.
if (Array.isArray(versionOrVersions)) {
// The last entry will be the latest version published.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I even spelled out the bug.

@eps1lon eps1lon force-pushed the sebbie/12-05-next-upgrade_ensure_highest_versions_are_used_not_latest branch from c89f496 to 0cdf8f9 Compare December 5, 2024 21:35
@eps1lon eps1lon requested a review from huozhi December 5, 2024 21:35
@eps1lon eps1lon marked this pull request as ready for review December 5, 2024 21:35
@ijjk
Copy link
Member

ijjk commented Dec 5, 2024

Stats from current PR

Default Build (Increase detected ⚠️)
General
vercel/next.js canary vercel/next.js sebbie/12-05-next-upgrade_ensure_highest_versions_are_used_not_latest Change
buildDuration 21.1s 19.4s N/A
buildDurationCached 18.5s 16s N/A
nodeModulesSize 409 MB 409 MB N/A
nextStartRea..uration (ms) 491ms 475ms N/A
Client Bundles (main, webpack)
vercel/next.js canary vercel/next.js sebbie/12-05-next-upgrade_ensure_highest_versions_are_used_not_latest Change
1187-HASH.js gzip 49.2 kB 49.2 kB N/A
8276.HASH.js gzip 169 B 168 B N/A
8377-HASH.js gzip 5.3 kB 5.3 kB N/A
bccd1874-HASH.js gzip 53 kB 53 kB N/A
framework-HASH.js gzip 57.5 kB 57.5 kB N/A
main-app-HASH.js gzip 232 B 236 B N/A
main-HASH.js gzip 33.7 kB 33.7 kB N/A
webpack-HASH.js gzip 1.71 kB 1.71 kB N/A
Overall change 0 B 0 B
Legacy Client Bundles (polyfills)
vercel/next.js canary vercel/next.js sebbie/12-05-next-upgrade_ensure_highest_versions_are_used_not_latest Change
polyfills-HASH.js gzip 39.4 kB 39.4 kB
Overall change 39.4 kB 39.4 kB
Client Pages
vercel/next.js canary vercel/next.js sebbie/12-05-next-upgrade_ensure_highest_versions_are_used_not_latest Change
_app-HASH.js gzip 193 B 193 B
_error-HASH.js gzip 193 B 193 B
amp-HASH.js gzip 513 B 511 B N/A
css-HASH.js gzip 343 B 342 B N/A
dynamic-HASH.js gzip 1.84 kB 1.84 kB N/A
edge-ssr-HASH.js gzip 265 B 265 B
head-HASH.js gzip 363 B 362 B N/A
hooks-HASH.js gzip 393 B 392 B N/A
image-HASH.js gzip 4.44 kB 4.43 kB N/A
index-HASH.js gzip 268 B 268 B
link-HASH.js gzip 2.35 kB 2.34 kB N/A
routerDirect..HASH.js gzip 328 B 328 B
script-HASH.js gzip 397 B 397 B
withRouter-HASH.js gzip 323 B 326 B N/A
1afbb74e6ecf..834.css gzip 106 B 106 B
Overall change 1.75 kB 1.75 kB
Client Build Manifests
vercel/next.js canary vercel/next.js sebbie/12-05-next-upgrade_ensure_highest_versions_are_used_not_latest Change
_buildManifest.js gzip 746 B 747 B N/A
Overall change 0 B 0 B
Rendered Page Sizes
vercel/next.js canary vercel/next.js sebbie/12-05-next-upgrade_ensure_highest_versions_are_used_not_latest Change
index.html gzip 524 B 524 B
link.html gzip 538 B 536 B N/A
withRouter.html gzip 520 B 521 B N/A
Overall change 524 B 524 B
Edge SSR bundle Size
vercel/next.js canary vercel/next.js sebbie/12-05-next-upgrade_ensure_highest_versions_are_used_not_latest Change
edge-ssr.js gzip 128 kB 128 kB N/A
page.js gzip 200 kB 200 kB N/A
Overall change 0 B 0 B
Middleware size
vercel/next.js canary vercel/next.js sebbie/12-05-next-upgrade_ensure_highest_versions_are_used_not_latest Change
middleware-b..fest.js gzip 667 B 664 B N/A
middleware-r..fest.js gzip 155 B 156 B N/A
middleware.js gzip 31.1 kB 31.1 kB N/A
edge-runtime..pack.js gzip 844 B 844 B
Overall change 844 B 844 B
Next Runtimes
vercel/next.js canary vercel/next.js sebbie/12-05-next-upgrade_ensure_highest_versions_are_used_not_latest Change
797-experime...dev.js gzip 322 B 322 B
797.runtime.dev.js gzip 314 B 314 B
app-page-exp...dev.js gzip 321 kB 321 kB
app-page-exp..prod.js gzip 126 kB 126 kB
app-page-tur..prod.js gzip 139 kB 139 kB
app-page-tur..prod.js gzip 134 kB 134 kB
app-page.run...dev.js gzip 311 kB 311 kB
app-page.run..prod.js gzip 122 kB 122 kB
app-route-ex...dev.js gzip 36.8 kB 36.8 kB
app-route-ex..prod.js gzip 25 kB 25 kB
app-route-tu..prod.js gzip 25 kB 25 kB
app-route-tu..prod.js gzip 24.8 kB 24.8 kB
app-route.ru...dev.js gzip 38.5 kB 38.5 kB
app-route.ru..prod.js gzip 24.8 kB 24.8 kB
pages-api-tu..prod.js gzip 9.56 kB 9.56 kB
pages-api.ru...dev.js gzip 11.4 kB 11.4 kB
pages-api.ru..prod.js gzip 9.56 kB 9.56 kB
pages-turbo...prod.js gzip 21.3 kB 21.3 kB
pages.runtim...dev.js gzip 27 kB 27 kB
pages.runtim..prod.js gzip 21.3 kB 21.3 kB
server.runti..prod.js gzip 916 kB 916 kB
Overall change 2.34 MB 2.34 MB
build cache Overall increase ⚠️
vercel/next.js canary vercel/next.js sebbie/12-05-next-upgrade_ensure_highest_versions_are_used_not_latest Change
0.pack gzip 2.04 MB 2.04 MB ⚠️ +1.29 kB
index.pack gzip 144 kB 145 kB ⚠️ +1.49 kB
Overall change 2.18 MB 2.18 MB ⚠️ +2.79 kB
Diff details
Diff for main-HASH.js

Diff too large to display

Commit: 5bd64d5

@ijjk
Copy link
Member

ijjk commented Dec 5, 2024

Failing test suites

Commit: 5bd64d5

pnpm test test/integration/next-image-legacy/default/test/index.test.ts

  • Image Component Tests > development mode > should emit image for next/dynamic with non ssr case
Expand output

● Image Component Tests › development mode › should emit image for next/dynamic with non ssr case

thrown: "Exceeded timeout of 60000 ms for a test.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."

  1168 |   })
  1169 |
> 1170 |   it('should emit image for next/dynamic with non ssr case', async () => {
       |   ^
  1171 |     let browser = await webdriver(appPort, '/dynamic-static-img')
  1172 |     const img = await browser.elementById('dynamic-loaded-static-jpg')
  1173 |     const src = await img.getAttribute('src')

  at it (integration/next-image-legacy/default/test/index.test.ts:1170:3)
  at runTests (integration/next-image-legacy/default/test/index.test.ts:1497:7)
  at integration/next-image-legacy/default/test/index.test.ts:1486:58
  at Object.describe (integration/next-image-legacy/default/test/index.test.ts:1485:1)

Read more about building and testing Next.js in contributing.md.

pnpm test-dev test/development/middleware-errors/index.test.ts

  • middleware - development errors > when running invalid dynamic code with eval > renders the error correctly and recovers
  • middleware - development errors > when throwing while loading the module > renders the error correctly and recovers
Expand output

● middleware - development errors › when running invalid dynamic code with eval › renders the error correctly and recovers

Expected no Redbox but found one
header: 1 of 1 error
Next.js (15.0.4-canary.43)
Server Error

ReferenceError: test is not defined

This error happened while generating the page. Any console logs will be displayed in the terminal window.
description: ReferenceError: test is not defined
source: middleware.js (4:9) @ eval

  2 |       import { NextResponse } from 'next/server'
  3 |       export default function () {
> 4 |         eval('test')
    |         ^
  5 |         return NextResponse.next()
  6 |       }

  170 |       }, 10000) // middleware rebuild takes a while in CI
  171 |
> 172 |       await assertNoRedbox(browser)
      |       ^
  173 |     })
  174 |   })
  175 |

  at Object.<anonymous> (development/middleware-errors/index.test.ts:172:7)

● middleware - development errors › when throwing while loading the module › renders the error correctly and recovers

Expected no Redbox but found one
header: 1 of 1 error
Next.js (15.0.4-canary.43)
Server Error

Error: booooom!

This error happened while generating the page. Any console logs will be displayed in the terminal window.
description: Error: booooom!
source: middleware.js (3:13) @ eval

  1 |
  2 |       import { NextResponse } from 'next/server'
> 3 |       throw new Error('booooom!')
    |             ^
  4 |       export default function () {
  5 |         return NextResponse.next()
  6 |       }

  217 |       expect(source).not.toContain('//middleware.js')
  218 |       await next.patchFile('middleware.js', `export default function () {}`)
> 219 |       await assertNoRedbox(browser)
      |       ^
  220 |     })
  221 |   })
  222 |

  at Object.<anonymous> (development/middleware-errors/index.test.ts:219:7)

Read more about building and testing Next.js in contributing.md.

pnpm test-dev test/development/acceptance-app/ReactRefreshLogBox.test.ts

  • ReactRefreshLogBox app default > server component can recover from error thrown in the module
Expand output

● ReactRefreshLogBox app default › server component can recover from error thrown in the module

Expected Redbox but found none

  1060 |
  1061 |       await next.patchFile('index.js', "throw new Error('module error')")
> 1062 |       await session.assertHasRedbox()
       |       ^
  1063 |       await next.patchFile(
  1064 |         'index.js',
  1065 |         'export default function Page() {return <p>hello world</p>}'

  at Object.<anonymous> (development/acceptance-app/ReactRefreshLogBox.test.ts:1062:7)

Read more about building and testing Next.js in contributing.md.

pnpm test-dev test/development/acceptance/server-component-compiler-errors-in-pages.test.ts

  • Error Overlay for server components compiler errors in pages > importing unstable_after from 'next/server' in pages
Expand output

● Error Overlay for server components compiler errors in pages › importing unstable_after from 'next/server' in pages

Expected Redbox but found none

  159 |     )
  160 |
> 161 |     await session.assertHasRedbox()
      |     ^
  162 |     await expect(session.getRedboxSource()).resolves.toMatch(
  163 |       /That only works in a Server Component/
  164 |     )

  at Object.<anonymous> (development/acceptance/server-component-compiler-errors-in-pages.test.ts:161:5)

Read more about building and testing Next.js in contributing.md.

@eps1lon eps1lon merged commit 1840942 into canary Dec 5, 2024
105 of 112 checks passed
@eps1lon eps1lon deleted the sebbie/12-05-next-upgrade_ensure_highest_versions_are_used_not_latest branch December 5, 2024 22:33
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants