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

Update CNA build target in tsconfig #25780

Merged

Conversation

matamatanot
Copy link
Contributor

Feature

  • Telemetry added. In case of a feature if it's used or not.

Change compilerOptions.target "es2015" to "es2019"

You can update the target as Next.js is now only supported in Node 12 or later. This is expected to reduce the build size and improve performance.

The official TypeScript wiki is as follows.
https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping#node-12

@ijjk ijjk added the create-next-app Related to our CLI tool for quickly starting a new Next.js application. label Jun 4, 2021
@ijjk

This comment has been minimized.

@ijjk
Copy link
Member

ijjk commented Jun 4, 2021

Failing test suites

Commit: fcac8f0

test/integration/rewrite-with-browser-history/test/index.test.js

  • rewrites persist with browser history actions > dev mode > back-button should go back to rewritten path successfully
Expand output

● rewrites persist with browser history actions › dev mode › back-button should go back to rewritten path successfully

NoSuchElementError: no such element: Unable to locate element: {"method":"css selector","selector":"#another"}
  (Session info: headless chrome=91.0.4472.77)

  33 |     await browser.back()
  34 |
> 35 |     expect(await browser.elementByCss('#another').text()).toBe('another page')
     |            ^
  36 |
  37 |     expect(await browser.eval('window.beforeNav')).toBe(1)
  38 |   })

  at Object.throwDecodedError (../node_modules/selenium-webdriver/lib/error.js:550:15)
  at parseHttpResponse (../node_modules/selenium-webdriver/lib/http.js:565:13)
  at Executor.execute (../node_modules/selenium-webdriver/lib/http.js:491:26)
  at thenableWebDriverProxy.execute (../node_modules/selenium-webdriver/lib/webdriver.js:700:17)
  at Object.<anonymous> (integration/rewrite-with-browser-history/test/index.test.js:35:12)

Copy link
Member

@timneutkens timneutkens left a comment

Choose a reason for hiding this comment

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

This is es2015 because Next.js outputs JS compatible with IE11 currently. It can be changed in the near future but it'll require more work than just changing this target. The target is not used by Next.js btw, it's only there to ensure your editor knows what the output is like.

@matamatanot
Copy link
Contributor Author

@timneutkens
It is create-next-app, not next, and it seems that the build target of the cli tool does not need to cover IE11.

@ijjk
Copy link
Member

ijjk commented Jun 7, 2021

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General
vercel/next.js canary matamatanot/next.js update-CNA-tsconfig-build-target Change
buildDuration 14s 14.1s ⚠️ +28ms
buildDurationCached 3.6s 3.3s -323ms
nodeModulesSize 46.7 MB 46.7 MB
Page Load Tests Overall increase ✓
vercel/next.js canary matamatanot/next.js update-CNA-tsconfig-build-target Change
/ failed reqs 0 0
/ total time (seconds) 2.995 2.844 -0.15
/ avg req/sec 834.76 879.05 +44.29
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.703 1.648 -0.06
/error-in-render avg req/sec 1467.7 1516.76 +49.06
Client Bundles (main, webpack, commons)
vercel/next.js canary matamatanot/next.js update-CNA-tsconfig-build-target Change
framework-HASH.js gzip 39.3 kB 39.3 kB
main-HASH.js gzip 20.2 kB 20.2 kB
webpack-HASH.js gzip 804 B 804 B
Overall change 60.3 kB 60.3 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary matamatanot/next.js update-CNA-tsconfig-build-target Change
polyfills-HASH.js gzip 31.1 kB 31.1 kB
Overall change 31.1 kB 31.1 kB
Client Pages
vercel/next.js canary matamatanot/next.js update-CNA-tsconfig-build-target Change
_app-HASH.js gzip 801 B 801 B
_error-HASH.js gzip 3.07 kB 3.07 kB
amp-HASH.js gzip 527 B 527 B
css-HASH.js gzip 334 B 334 B
hooks-HASH.js gzip 890 B 890 B
index-HASH.js gzip 263 B 263 B
link-HASH.js gzip 1.64 kB 1.64 kB
routerDirect..HASH.js gzip 333 B 333 B
withRouter-HASH.js gzip 330 B 330 B
bb14e60e810b..30f.css gzip 125 B 125 B
Overall change 8.31 kB 8.31 kB
Client Build Manifests
vercel/next.js canary matamatanot/next.js update-CNA-tsconfig-build-target Change
_buildManifest.js gzip 391 B 391 B
Overall change 391 B 391 B
Rendered Page Sizes
vercel/next.js canary matamatanot/next.js update-CNA-tsconfig-build-target Change
index.html gzip 572 B 572 B
link.html gzip 579 B 579 B
withRouter.html gzip 567 B 567 B
Overall change 1.72 kB 1.72 kB

Serverless Mode
General
vercel/next.js canary matamatanot/next.js update-CNA-tsconfig-build-target Change
buildDuration 16s 15.4s -680ms
buildDurationCached 4.3s 4.4s ⚠️ +66ms
nodeModulesSize 46.7 MB 46.7 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary matamatanot/next.js update-CNA-tsconfig-build-target Change
framework-HASH.js gzip 39.3 kB 39.3 kB
main-HASH.js gzip 20.2 kB 20.2 kB
webpack-HASH.js gzip 804 B 804 B
Overall change 60.3 kB 60.3 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary matamatanot/next.js update-CNA-tsconfig-build-target Change
polyfills-HASH.js gzip 31.1 kB 31.1 kB
Overall change 31.1 kB 31.1 kB
Client Pages
vercel/next.js canary matamatanot/next.js update-CNA-tsconfig-build-target Change
_app-HASH.js gzip 801 B 801 B
_error-HASH.js gzip 3.07 kB 3.07 kB
amp-HASH.js gzip 527 B 527 B
css-HASH.js gzip 334 B 334 B
hooks-HASH.js gzip 890 B 890 B
index-HASH.js gzip 263 B 263 B
link-HASH.js gzip 1.64 kB 1.64 kB
routerDirect..HASH.js gzip 333 B 333 B
withRouter-HASH.js gzip 330 B 330 B
bb14e60e810b..30f.css gzip 125 B 125 B
Overall change 8.31 kB 8.31 kB
Client Build Manifests
vercel/next.js canary matamatanot/next.js update-CNA-tsconfig-build-target Change
_buildManifest.js gzip 391 B 391 B
Overall change 391 B 391 B
Serverless bundles Overall increase ⚠️
vercel/next.js canary matamatanot/next.js update-CNA-tsconfig-build-target Change
_error.js 16.9 kB 16.9 kB ⚠️ +2 B
404.html 2.44 kB 2.44 kB
500.html 2.43 kB 2.43 kB
amp.amp.html 10.8 kB 10.8 kB
amp.html 1.63 kB 1.63 kB
css.html 1.81 kB 1.81 kB
hooks.html 1.69 kB 1.69 kB
index.js 17.2 kB 17.2 kB ⚠️ +2 B
link.js 17.4 kB 17.4 kB
routerDirect.js 17.4 kB 17.4 kB
withRouter.js 17.4 kB 17.4 kB
Overall change 107 kB 107 kB ⚠️ +4 B

Webpack 4 Mode (Decrease detected ✓)
General
vercel/next.js canary matamatanot/next.js update-CNA-tsconfig-build-target Change
buildDuration 12.5s 12.2s -338ms
buildDurationCached 4.8s 4.7s -108ms
nodeModulesSize 46.7 MB 46.7 MB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary matamatanot/next.js update-CNA-tsconfig-build-target Change
/ failed reqs 0 0
/ total time (seconds) 2.884 2.865 -0.02
/ avg req/sec 866.84 872.5 +5.66
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.619 1.703 ⚠️ +0.08
/error-in-render avg req/sec 1544.13 1467.73 ⚠️ -76.4
Client Bundles (main, webpack, commons)
vercel/next.js canary matamatanot/next.js update-CNA-tsconfig-build-target Change
677f882d2ed8..HASH.js gzip 13.3 kB 13.3 kB
framework.HASH.js gzip 39 kB 39 kB
main-HASH.js gzip 7.99 kB 7.99 kB
webpack-HASH.js gzip 751 B 751 B
Overall change 61.1 kB 61.1 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary matamatanot/next.js update-CNA-tsconfig-build-target Change
polyfills-HASH.js gzip 31.3 kB 31.3 kB
Overall change 31.3 kB 31.3 kB
Client Pages
vercel/next.js canary matamatanot/next.js update-CNA-tsconfig-build-target Change
_app-HASH.js gzip 1.07 kB 1.07 kB
_error-HASH.js gzip 3.74 kB 3.74 kB
amp-HASH.js gzip 536 B 536 B
css-HASH.js gzip 339 B 339 B
hooks-HASH.js gzip 887 B 887 B
index-HASH.js gzip 227 B 227 B
link-HASH.js gzip 1.63 kB 1.63 kB
routerDirect..HASH.js gzip 303 B 303 B
withRouter-HASH.js gzip 302 B 302 B
e025d2764813..52f.css gzip 125 B 125 B
Overall change 9.16 kB 9.16 kB
Client Build Manifests
vercel/next.js canary matamatanot/next.js update-CNA-tsconfig-build-target Change
_buildManifest.js gzip 420 B 420 B
Overall change 420 B 420 B
Rendered Page Sizes
vercel/next.js canary matamatanot/next.js update-CNA-tsconfig-build-target Change
index.html gzip 627 B 627 B
link.html gzip 633 B 633 B
withRouter.html gzip 620 B 620 B
Overall change 1.88 kB 1.88 kB
Commit: 1a0d669

@timneutkens
Copy link
Member

Ah yeah you're right, sorry I missed that it's not the template but the root tsconfig.

@timneutkens timneutkens merged commit ca2921f into vercel:canary Jun 8, 2021
flybayer pushed a commit to blitz-js/next.js that referenced this pull request Jun 16, 2021
@matamatanot matamatanot deleted the update-CNA-tsconfig-build-target branch October 30, 2021 09:54
@vercel vercel locked as resolved and limited conversation to collaborators Jan 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
create-next-app Related to our CLI tool for quickly starting a new Next.js application.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants