Commit graph

68 commits

Author SHA1 Message Date
JJ Kasper
25d064f812
Pre-compile more dependencies (#32742)
This ncc's some remaining dependencies bringing us under 20 install time dependencies (including nested dependencies), this also reduces install size by another `2.75 MB`. A follow-up PR will investigate a custom install script for our swc packages to allow us to remove the `optionalDependencies` which is slowing down install time as well. 

x-ref: https://github.com/vercel/next.js/pull/32679
x-ref: https://github.com/vercel/next.js/pull/32627
x-ref: https://github.com/vercel/next.js/issues/31887
x-ref: https://github.com/vercel/styled-jsx/pull/770
2022-01-17 15:17:22 +00:00
JJ Kasper
3667eba385
Pre-compile more dependencies continued (#32679) 2021-12-21 16:13:45 +01:00
Keen Yee Liau
53e52fefc3
telemetry: collect feature usage for linting during build (#32022)
Currently, we have telemetry to measure how ESLint is invoked,
but we do not have telemetry that tells us how many users have
disabled ESLint during build.

This commit adds a new feature, `build lint` to track this metric.



## Bug

- [ ] Related issues linked using `fixes #number`
- [x] 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`
2021-12-07 02:41:31 +00:00
Keen Yee Liau
9ab1709175
telemetry: track usage of 'optimizeFonts' (#31522)
`optimizeFonts` is enabled by default, but the Aurora team would like
to find out how many users explicitly turn it off.
2021-11-17 13:33:37 -06:00
Tim Neutkens
c4558c913f
Output where preference is saved (#31305)
Fixes #31241



## 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`
2021-11-11 16:48:00 +00:00
Keen Yee Liau
7077bf8c26
add warning to update featureName in FEATURE_USAGE backend (#30283)
`featureName` is restricted to certain values for security reasons.
Before any change is made in the client, backend code has to be updated first.
2021-10-28 11:16:42 -05:00
Maia Teegarden
0ab8c7ada6
Track usage of swc features (#30297)
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2021-10-26 09:37:38 +02:00
JJ Kasper
243175f049
Add middlewareCount info to build optimized (#30185)
This adds info on number of `_middleware` routes being 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

- [ ] Make sure the linting passes by running `yarn lint`
2021-10-22 20:12:12 +00:00
Tim Neutkens
7e370134fb
Use import() to load next.config.js (#29935)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Steven <steven@ceriously.com>
2021-10-16 14:22:42 +02:00
Keen Yee Liau
13f68debfe
Collect feature usage for optimizeCss (#29828)
`optimizeCss` is a feature that inlines critical CSS using critters.
The Aurora team would like to gauge adoption rate for this feature.



## Bug

- [ ] Related issues linked using `fixes #number`
- [x] 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`
- [x] Integration tests added
- [ ] Documentation added
- [x] 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
2021-10-11 21:15:18 +00:00
Keen Yee Liau
53628fba69
Create TelemetryPlugin for collecting feature usage metrics (#29145)
This commit creates a new Webpack `TelemetryPlugin` to gather information
about usage of certain features, for example `next/image` and `next/script`.
2021-10-05 14:31:48 -05:00
Tim Neutkens
c1e5f5b260
Make traces in development reliable (#28990)
Co-authored-by: Jiachi Liu <inbox@huozhi.im>
2021-09-13 15:49:29 +02:00
Tim Neutkens
eaea8cb294
Remove .next/traces directory as it's not used (#28728)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-09-02 13:28:51 +02:00
Tim Neutkens
9316dc0a8e
Add default trace format that is exported automatically (#28461)
Co-authored-by: Steven <steven@ceriously.com>
2021-08-25 10:47:16 +02:00
Tim Neutkens
2b7d4619ed
Improve jaeger traces (#28168)
Co-authored-by: Harsh Karande <harshskarande@gmail.com>
2021-08-17 09:18:47 +02:00
JJ Kasper
5544adc481
Update to latest babel versions (#28174) 2021-08-17 09:18:08 +02:00
Tim Neutkens
76cc01f6b5
Add support for Jaeger trace target (#28129)
Adds support for Jaeger next to Zipkin as a trace target.

## 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
2021-08-15 19:26:02 +00:00
Tim Neutkens
7c33a2179d
Add batching to zipkin reporter (#27082) 2021-07-11 14:19:16 +02:00
Tim Neutkens
5b9ad8da90
Move next-server directory files to server directory (#26756)
* Move next-server directory files to server directory

* Update tests

* Update paths in other places
2021-06-30 13:44:40 +02:00
Tim Neutkens
136b754396
Move code shared between server/client to "shared" folder (#26734) 2021-06-30 11:43:31 +02:00
Tim Neutkens
634de3c45e
Add trace url on bootup (#26594)
* Add trace url on bootup

* Update whitelist -> accesslist

* Add name to webpack-invalidated
2021-06-25 13:55:46 +02:00
JJ Kasper
5a78f59aeb
Add lint checking events (#26089)
* Add lint checking events

* remove extra log

* Update check

* Update version check
2021-06-14 20:31:40 -05:00
Tobias Koppers
3a78ccd43f
Add type checking events (#24595)
Will send events like this:

```
[telemetry] {
  "eventName": "NEXT_TYPE_CHECK_COMPLETED",
  "payload": {
    "durationInSeconds": 2,
    "typescriptVersion": "3.8.3",
    "inputFilesCount": 16,
    "totalFilesCount": 289,
    "incremental": false
  }
}
```

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added

## 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.

## Documentation / Examples

- [ ] Make sure the linting passes
2021-05-04 08:41:01 +00:00
Tim Neutkens
cf4ba8d705
Upgrade eslint to the latest version (#24377)
## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added

## 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.

## Documentation / Examples

- [ ] Make sure the linting passes
2021-04-25 18:34:36 +00:00
Tim Neutkens
8d84b08752
Add event for webpack 5 usage (#24222) 2021-04-20 16:46:40 +02:00
JJ Kasper
75c721c583
Add has route field (#22341)
This adds support for a `has` field to `rewrites`, `redirects`, and `headers` to allow matching against `header`, `cookie`, and `query` values. Documentation and additional tests for the feature is also added in this PR. 

Closes: https://github.com/vercel/next.js/issues/22345
2021-03-24 16:50:16 +00:00
Dale Bustad
ffbb10fa9a
Silence trace debug messages (#22988)
These messages aren't necessary in the normal course of using Next.js.  Hiding behind a flag to reduce the noise.
2021-03-11 19:51:43 +00:00
Dale Bustad
e27b7e996d
Telemetry-compatible tracing (#22713)
A number of changes here.  I recommend viewing the diff with the <a href="?w=1">whitespace flag enabled</a>.

- OpenTelemetry is replaced with a custom and lightweight tracing solution.
- Three trace targets are currently supported: console, Zipkin, and NextJS.
- Tracing is now governed by environment variables rather than `--require instrument.js`.
  + `TRACE_TARGET`: one of `CONSOLE`, `ZIPKIN`, or `TELEMETRY`; defaults to `TELEMETRY` if unset or invalid.
  + `TRACE_ID`: an 8-byte hex-encoded value used as the Zipkin trace ID; if not provided, this value will be randomly generated and passed down to subprocesses.

Other sundry:

- I'm missing something, probably a setup step, with the Zipkin target.  Traces are captured successfully, but you have to manually enter the Trace ID in order to view the trace - it doesn't show up in queries.
- I'm generally unhappy with [this commit](235cedcb3e).  It is... untidy to provide a telemetry object via `setGlobal`, but I don't have a ready alternative.  Is `distDir` strictly required when creating a new Telemetry object?  I didn't dig too deep here.

As noted, there are a lot of changes, so it'd be great if a reviewer could:

- [ ] pull down the branch and try to break it
- [ ] check the Zipkin traces and identify possible regressions in the functionality

Closes #22570
Fixes #22574
2021-03-10 21:00:20 +00:00
Guy Bedford
8221c180a5
ncc 0.25.0 upgrade and fixes (#18873)
This upgrades to ncc@0.25.0 and fixes the previous bugs including:

* ncc not referenced correctly in build
* Babel type errors
* node-fetch, etag, chalk and raw-body dependencies not building with ncc - these have been "un-ncc'd" for now. As they are relatively small dependencies, this doesn't seem too much of an issue and we can follow up in the tracking ncc issue at https://github.com/vercel/ncc/issues/612.
* `yarn dev` issues

Took a lot of bisecting, but the overall diff isn't too bad here in the end.
2020-11-06 02:33:14 +00:00
Guy Bedford
4dbb65d0f1
yarn dev regression fix, ncc revert (#18861)
This fixes the current regression with an ncc revert for now.

I will continue to follow up with the ncc upgrade in https://github.com/vercel/next.js/pull/18860.
2020-11-06 00:47:31 +00:00
Guy Bedford
64850a8348
ncc Babel inlining (#18768)
This adds inlining for Babel and the Babel plugins used in next.

This is based to the PR at https://github.com/vercel/next.js/pull/18823.

The approach is to make one large bundle and then separate out the individual packages from that in order to avoid duplications.

In the first attempt the Babel bundle size was 10MB... using "resolutions" in the Yarn workspace to reduce the duplicated packages this was brought down to a 2.8MB bundle for Babel and all the used plugins which is exactly the expected file size here.

This will thus add a 2.8MB download size to the next package, but save downloading any babel dependencies separately, removing a large number of package dependencies from the overall install.
2020-11-05 14:23:01 +00:00
Joe Haddad
9a13dd3466
Enable i18n feature flag (#18303) 2020-10-27 10:30:34 -05:00
JJ Kasper
26c438b49d
Record leveraged configs (#18175)
This records new configs being leveraged
2020-10-27 13:46:18 +00:00
Joe Haddad
7c7fd3e863
Record presence of reportWebVitals (#13155)
Closes #12897
2020-05-20 18:44:39 +00:00
Tim Neutkens
4ba2b78729
Read process.env after loading .env files (#13087)
Fixes #13067
2020-05-20 03:39:27 +00:00
Joe Haddad
86160a5190
Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
Joe Haddad
adb14c9556
Disable cache warning on supported platforms (#12495) 2020-05-05 11:04:57 -04:00
Joe Haddad
2704387d2e
Add New Provider (#11757) 2020-04-08 16:20:28 -04:00
Guy Bedford
35a6710cdb babel revert 2020-03-30 16:26:25 -04:00
Guy Bedford
9c2e43a382 find-up 2020-03-30 16:26:25 -04:00
Guy Bedford
7ea2ce8c0e conf 2020-03-30 16:26:25 -04:00
Guy Bedford
26dca225d6 node-fetch, ora 2020-03-30 16:26:25 -04:00
Guy Bedford
9831d3b3e2 is-docker, is-wsl 2020-03-30 16:26:25 -04:00
Guy Bedford
af40b5b2f8 chalk, ci-info 2020-03-30 16:26:25 -04:00
Guy Bedford
eb5e962d78 async-retry 2020-03-30 16:26:25 -04:00
Guy Bedford
5619f990cf refactor ncc optimization, babel optimization 2020-03-30 16:26:25 -04:00
Joe Haddad
a5d0cb9d80
Measure getStaticProps, getServerSideProps (#10800)
* Measure `getStaticProps`, `getServerSideProps`

* Test new fields
2020-03-02 19:01:12 -05:00
Joe Haddad
1c247b5cf1
Check next.config.js settings (#10425)
* Check next.config.js settings

* Add tests

* test package.json case too
2020-02-14 15:42:44 -05:00
JJ Kasper
ec39aa46dc
Update optimize event with static 404 status (#10420)
Co-authored-by: Joe Haddad <timer150@gmail.com>
2020-02-04 15:10:40 -05:00
Joe Haddad
bc81379618
Detect Invalid Pages Before Optimize (#10418) 2020-02-04 13:55:43 -05:00