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

feat(telemetry): report swc target triple to telemetry #35420

Merged
merged 1 commit into from
Mar 22, 2022

Conversation

kwonoj
Copy link
Contributor

@kwonoj kwonoj commented Mar 17, 2022

This PR requires #35416 as prerequisite.

Context: https://github.com/vercel/next-telemetry/pull/72

As next-swc exposes way to access its target triple, this PR attempts to include it into telemetry if we can access those metadata in swc's binary. One of missing piece in here is wasm target - however, main purpose of this tracking is usage distribution of native binary which is fine to skip it for now.

Bug

  • Related issues linked using fixes #number
  • Integration tests added
  • Errors have helpful link attached, see contributing.md

Feature

  • Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
  • Related issues linked using fixes #number
  • Integration tests added
  • Documentation added
  • Telemetry added. In case of a feature if it's used or not.
  • Errors have helpful link attached, see contributing.md

Documentation / Examples

  • Make sure the linting passes by running yarn lint

@kwonoj kwonoj force-pushed the feat-report-target-triple branch 2 times, most recently from f032220 to cd4d7f8 Compare March 20, 2022 09:17
@ijjk

This comment has been minimized.

@ijjk

This comment has been minimized.

@ijjk

This comment has been minimized.

@ijjk

This comment has been minimized.

@ijjk

This comment has been minimized.

@ijjk

This comment has been minimized.

@kwonoj kwonoj force-pushed the feat-report-target-triple branch 2 times, most recently from dc870c9 to 24e3d0d Compare March 21, 2022 20:33
@ijjk

This comment has been minimized.

@ijjk

This comment has been minimized.

@ijjk
Copy link
Member

ijjk commented Mar 21, 2022

Failing test suites

Commit: d769f45

yarn testheadless test/integration/telemetry/test/index.test.js

  • Telemetry CLI > emits telemery for usage of image, script & dynamic
  • Telemetry CLI > emits telemetry for usage of swc
Expand output

● Telemetry CLI › emits telemery for usage of image, script & dynamic

expect(received).toContain(expected) // indexOf

Expected substring: "\"featureName\": \"next/image\""
Received string:    "
    \"featureName\": \"swc/target/x86_64-apple-darwin\",
    \"invocationCount\": 0
  "

  634 |     regex.exec(stderr).pop() // swcEmotion
  635 |     const image = regex.exec(stderr).pop()
> 636 |     expect(image).toContain(`"featureName": "next/image"`)
      |                   ^
  637 |     expect(image).toContain(`"invocationCount": 1`)
  638 |     const script = regex.exec(stderr).pop()
  639 |     expect(script).toContain(`"featureName": "next/script"`)

  at Object.<anonymous> (integration/telemetry/test/index.test.js:636:19)
      at runMicrotasks (<anonymous>)

● Telemetry CLI › emits telemetry for usage of swc

ENOENT: no such file or directory, rename '/home/runner/work/next.js/next.js/test/integration/telemetry/next.config.swc' -> '/home/runner/work/next.js/next.js/test/integration/telemetry/next.config.js'

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

@ijjk

This comment has been minimized.

@ijjk

This comment has been minimized.

@kwonoj kwonoj force-pushed the feat-report-target-triple branch 2 times, most recently from 4184ac9 to b915607 Compare March 21, 2022 22:36
@ijjk

This comment has been minimized.

@ijjk

This comment has been minimized.

@ijjk
Copy link
Member

ijjk commented Mar 21, 2022

Stats from current PR

Default Build (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary kwonoj/next.js feat-report-target-triple Change
buildDuration 16.3s 16.3s ⚠️ +8ms
buildDurationCached 6.3s 6.3s ⚠️ +15ms
nodeModulesSize 456 MB 456 MB ⚠️ +3.23 kB
Page Load Tests Overall increase ✓
vercel/next.js canary kwonoj/next.js feat-report-target-triple Change
/ failed reqs 0 0
/ total time (seconds) 3.28 3.24 -0.04
/ avg req/sec 762.29 771.57 +9.28
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.46 1.42 -0.04
/error-in-render avg req/sec 1712.6 1760.83 +48.23
Client Bundles (main, webpack)
vercel/next.js canary kwonoj/next.js feat-report-target-triple Change
925.HASH.js gzip 179 B 179 B
framework-HASH.js gzip 42 kB 42 kB
main-HASH.js gzip 28 kB 28 kB
webpack-HASH.js gzip 1.44 kB 1.44 kB
Overall change 71.6 kB 71.6 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary kwonoj/next.js feat-report-target-triple Change
polyfills-HASH.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary kwonoj/next.js feat-report-target-triple Change
_app-HASH.js gzip 1.36 kB 1.36 kB
_error-HASH.js gzip 192 B 192 B
amp-HASH.js gzip 309 B 309 B
css-HASH.js gzip 327 B 327 B
dynamic-HASH.js gzip 2.57 kB 2.57 kB
head-HASH.js gzip 351 B 351 B
hooks-HASH.js gzip 920 B 920 B
image-HASH.js gzip 5.48 kB 5.48 kB
index-HASH.js gzip 263 B 263 B
link-HASH.js gzip 2.26 kB 2.26 kB
routerDirect..HASH.js gzip 320 B 320 B
script-HASH.js gzip 387 B 387 B
withRouter-HASH.js gzip 319 B 319 B
85e02e95b279..7e3.css gzip 107 B 107 B
Overall change 15.2 kB 15.2 kB
Client Build Manifests
vercel/next.js canary kwonoj/next.js feat-report-target-triple Change
_buildManifest.js gzip 460 B 460 B
Overall change 460 B 460 B
Rendered Page Sizes
vercel/next.js canary kwonoj/next.js feat-report-target-triple Change
index.html gzip 531 B 531 B
link.html gzip 545 B 545 B
withRouter.html gzip 526 B 526 B
Overall change 1.6 kB 1.6 kB

Default Build with SWC (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary kwonoj/next.js feat-report-target-triple Change
buildDuration 20.3s 19.6s -677ms
buildDurationCached 6.3s 6.1s -144ms
nodeModulesSize 456 MB 456 MB ⚠️ +3.23 kB
Page Load Tests Overall increase ✓
vercel/next.js canary kwonoj/next.js feat-report-target-triple Change
/ failed reqs 0 0
/ total time (seconds) 3.305 3.213 -0.09
/ avg req/sec 756.48 777.97 +21.49
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.494 1.447 -0.05
/error-in-render avg req/sec 1673.35 1727.67 +54.32
Client Bundles (main, webpack)
vercel/next.js canary kwonoj/next.js feat-report-target-triple Change
925.HASH.js gzip 178 B 178 B
framework-HASH.js gzip 42.3 kB 42.3 kB
main-HASH.js gzip 28.2 kB 28.2 kB
webpack-HASH.js gzip 1.45 kB 1.45 kB
Overall change 72.1 kB 72.1 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary kwonoj/next.js feat-report-target-triple Change
polyfills-HASH.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary kwonoj/next.js feat-report-target-triple Change
_app-HASH.js gzip 1.35 kB 1.35 kB
_error-HASH.js gzip 179 B 179 B
amp-HASH.js gzip 313 B 313 B
css-HASH.js gzip 324 B 324 B
dynamic-HASH.js gzip 2.56 kB 2.56 kB
head-HASH.js gzip 351 B 351 B
hooks-HASH.js gzip 921 B 921 B
image-HASH.js gzip 5.59 kB 5.59 kB
index-HASH.js gzip 261 B 261 B
link-HASH.js gzip 2.33 kB 2.33 kB
routerDirect..HASH.js gzip 322 B 322 B
script-HASH.js gzip 388 B 388 B
withRouter-HASH.js gzip 317 B 317 B
85e02e95b279..7e3.css gzip 107 B 107 B
Overall change 15.3 kB 15.3 kB
Client Build Manifests
vercel/next.js canary kwonoj/next.js feat-report-target-triple Change
_buildManifest.js gzip 458 B 458 B
Overall change 458 B 458 B
Rendered Page Sizes
vercel/next.js canary kwonoj/next.js feat-report-target-triple Change
index.html gzip 531 B 531 B
link.html gzip 546 B 546 B
withRouter.html gzip 527 B 527 B
Overall change 1.6 kB 1.6 kB
Commit: 69ab6e6

@padmaia padmaia merged commit c261924 into vercel:canary Mar 22, 2022
@kwonoj kwonoj deleted the feat-report-target-triple branch March 22, 2022 06:32
Kikobeats added a commit to Kikobeats/next.js that referenced this pull request Mar 24, 2022
commit f16ee05
Author: hiro <hiroyuki.kikuchi@zozo.com>
Date:   Thu Mar 24 10:02:40 2022 +0900

    Fix typo in docs (vercel#35561)

    The following files have been modified.

    - `docs/api-reference/next.config.js/rewrites.md`
    - `docs/basic-features/script.md`

    ## Documentation / Examples

    - [x] Make sure the linting passes by running `yarn lint`

commit ef7b535
Author: Steven <steven@ceriously.com>
Date:   Wed Mar 23 18:33:47 2022 -0400

    Fix `next info` accidentally printing stderr (vercel#35556)

    I noticed a few issues that had "Output from `next info`" with the first line as

    ```
    /bin/sh: pnpm: command not found
    ```

    This was because `execSync()` was still printing to stderr when a command was not found.

    Changing to `execFileSync()` fixed it so we no longer print to stderr when a command is not found.

commit 59905c1
Author: LongYinan <lynweklm@gmail.com>
Date:   Thu Mar 24 04:47:44 2022 +0800

    Fix styled transform in next-swc/emotion (vercel#35527)

    Fix vercel#35525

    ## Bug

    - [x] Related issues linked using `fixes #number`
    - [ ] Integration tests added
    - [ ] Errors have helpful link attached, see `contributing.md`

    ## Feature

    - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
    - [ ] Related issues linked using `fixes #number`
    - [ ] Integration tests added
    - [ ] Documentation added
    - [ ] Telemetry added. In case of a feature if it's used or not.
    - [ ] Errors have helpful link attached, see `contributing.md`

    ## Documentation / Examples

    - [ ] Make sure the linting passes by running `yarn lint`

commit ebe1b4c
Author: Shu Ding <g@shud.in>
Date:   Wed Mar 23 20:20:36 2022 +0100

    Upgrade react-server-dom-webpack (vercel#35524)

    There're some changes since our last update that we'll need (e.g. server context).

    ## Bug

    - [ ] Related issues linked using `fixes #number`
    - [ ] Integration tests added
    - [ ] Errors have helpful link attached, see `contributing.md`

    ## Feature

    - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
    - [ ] Related issues linked using `fixes #number`
    - [ ] Integration tests added
    - [ ] Documentation added
    - [ ] Telemetry added. In case of a feature if it's used or not.
    - [ ] Errors have helpful link attached, see `contributing.md`

    ## Documentation / Examples

    - [ ] Make sure the linting passes by running `yarn lint`

commit 432261a
Author: JJ Kasper <jj@jjsweb.site>
Date:   Wed Mar 23 13:43:12 2022 -0500

    Add link for revalidate from notFound section (vercel#35553)

commit 2cf6696
Author: Jiachi Liu <inbox@huozhi.im>
Date:   Wed Mar 23 16:19:58 2022 +0100

    Merge rsc queries handling (vercel#35545)

    Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>

commit 9fef0d5
Author: JJ Kasper <jj@jjsweb.site>
Date:   Wed Mar 23 09:28:04 2022 -0500

    Normalize ssgCacheKey for /index with minimalMode de-duping (vercel#35536)

    * Normalize ssgCacheKey for /index

    * apply test changes to i18n suite as well

commit 72478c5
Author: JJ Kasper <jj@jjsweb.site>
Date:   Tue Mar 22 13:58:55 2022 -0500

    Update next/link error when no children are provided (vercel#35453)

    * Update next/link error when no children are provided

    * update manifest

    * Apply suggestions from code review

    Co-authored-by: Balázs Orbán <info@balazsorban.com>

commit 6da7691
Author: Malte Ubl <cramforce@users.noreply.github.com>
Date:   Tue Mar 22 07:54:05 2022 -0700

    Reduce hello-world middleware bundle size from 128k to 88k (vercel#35512)

    Moves two utility functions from `server/router.ts` into their own file. This avoids the middleware pulling in the full Next.js router into its bundle.

    There are probably more opportunities like this, but this is a good start. Middleware should likely be bundled by a non-chunking optimizing compiler.

commit 860c97c
Author: Heyang Zhou <zhy20000919@hotmail.com>
Date:   Tue Mar 22 21:20:57 2022 +0800

    SWC import modularization plugin (vercel#34969)

commit 78831c3
Author: Steven <steven@ceriously.com>
Date:   Tue Mar 22 09:00:31 2022 -0400

    v12.1.1-canary.17

commit a2accb2
Author: JJ Kasper <jj@jjsweb.site>
Date:   Tue Mar 22 00:03:42 2022 -0500

    Update trace ignore check to check reasons correctly (vercel#35511)

commit c261924
Author: OJ Kwon <kwon.ohjoong@gmail.com>
Date:   Mon Mar 21 17:09:03 2022 -0700

    feat(telemetry): report swc target triple to telemetry (vercel#35420)

commit af95b0c
Author: Luka Hartwig <mail@lukahartwig.de>
Date:   Tue Mar 22 00:54:43 2022 +0100

    Server component docs use wrong next version (vercel#35313)

    The docs for the react server components preview refer refer to `next@latest` which doesn't work. The linked demo uses `canary` so I replaced it in the install command.

commit 92da36f
Author: JJ Kasper <jj@jjsweb.site>
Date:   Mon Mar 21 18:33:48 2022 -0500

    v12.1.1-canary.16

commit cd47984
Author: Thiago M <thiagotm@outlook.com>
Date:   Mon Mar 21 14:06:04 2022 -0300

    clarify use of Script (vercel#35491)

    Leave more clear that <Script> component can't be used inside Head. Current it says "without need", which don't implies it can't be used.

    ## Bug

    - [ ] Related issues linked using `fixes #number`
    - [ ] Integration tests added
    - [ ] Errors have helpful link attached, see `contributing.md`

    ## Feature

    - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
    - [ ] Related issues linked using `fixes #number`
    - [ ] Integration tests added
    - [ ] Documentation added
    - [ ] Telemetry added. In case of a feature if it's used or not.
    - [ ] Errors have helpful link attached, see `contributing.md`

    ## Documentation / Examples

    - [x] Make sure the linting passes by running `yarn lint`

commit da3760b
Author: JJ Kasper <jj@jjsweb.site>
Date:   Mon Mar 21 10:00:07 2022 -0500

    Use check on prerender test assertion (vercel#35482)

commit 40a5c94
Author: Nelo <correo@nelo.dev>
Date:   Mon Mar 21 15:24:19 2022 +0100

    Fix typo in getServerSideProps doc page (vercel#35467)

    While reading the documentation, I noticed that this paragraph was not correctly written and was hard to read. I fixed it adding a dot.

    ## Documentation / Examples

    - [ ] Make sure the linting passes by running `yarn lint`
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2022
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.

3 participants