Skip to content

Commit

Permalink
telemetry: track usage of 'experimental/nextScriptWorkers'
Browse files Browse the repository at this point in the history
  • Loading branch information
housseindjirdeh committed May 10, 2022
1 parent 342331e commit 6a9eaa9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/next/build/index.ts
Expand Up @@ -1523,6 +1523,10 @@ export default async function build(
featureName: 'experimental/optimizeCss',
invocationCount: config.experimental.optimizeCss ? 1 : 0,
},
{
featureName: 'experimental/nextScriptWorkers',
invocationCount: config.experimental.nextScriptWorkers ? 1 : 0,
},
{
featureName: 'optimizeFonts',
invocationCount: config.optimizeFonts ? 1 : 0,
Expand Down
1 change: 1 addition & 0 deletions packages/next/telemetry/events/build.ts
Expand Up @@ -135,6 +135,7 @@ export type EventBuildFeatureUsage = {
| 'next/script'
| 'next/dynamic'
| 'experimental/optimizeCss'
| 'experimental/nextScriptWorkers'
| 'optimizeFonts'
| 'swcLoader'
| 'swcMinify'
Expand Down
1 change: 1 addition & 0 deletions test/integration/telemetry/test/index.test.js
Expand Up @@ -647,6 +647,7 @@ describe('Telemetry CLI', () => {
})
const regex = /NEXT_BUILD_FEATURE_USAGE[\s\S]+?{([\s\S]+?)}/g
regex.exec(stderr).pop() // optimizeCss
regex.exec(stderr).pop() // nextScriptWorkers
regex.exec(stderr).pop() // build-lint
const optimizeFonts = regex.exec(stderr).pop()
expect(optimizeFonts).toContain(`"featureName": "optimizeFonts"`)
Expand Down

0 comments on commit 6a9eaa9

Please sign in to comment.