Commit graph

705 commits

Author SHA1 Message Date
Guy Bedford
b7272995b5
feat: upgrade to ncc@0.26.1 (#20627)
This upgrades to the version of ncc with subbundling support.
2020-12-31 00:50:45 +00:00
Tim Neutkens
5c5108fe0d
Add profiling to webpack loaders (#20392)
Follow-up to #20357 with additional tracers.
2020-12-29 21:21:35 +00:00
Joe Haddad
52270af307
Remove unnecessary unfetch polyfill for dev (#20589)
Fetch is always polyfilled in legacy browsers by `@next/polyfill-nomodule`, so we do not need to import unfetch for IE11 support.

Fixes #20588
2020-12-29 21:01:42 +00:00
Joe Haddad
61e7dea918
deps: upgrade various deps (mainly babel) (#20586)
Fixes #20585
Closes #20406 as it duplicates Babel dependencies
Closes #18926 as it's outdated
2020-12-29 20:10:08 +00:00
Jorrit Schippers
a9c7c9a5f5
Update sharp optional dependency to support NPM 7 (#20432)
Sharp 0.26.3 updates prebuild-install to ^6.0.0 which fixes an incompatibility with NPM 7.

See https://github.com/lovell/sharp/pull/2419 and https://github.com/prebuild/prebuild-install/pull/128
2020-12-29 18:03:53 +00:00
Tim Neutkens
a9f1975738
Update experimental profiling (#20357)
Adds profiling for terser and css-minimizer. Will move the old profiler to this new system as well.
2020-12-21 16:02:41 +00:00
Bogdan Chadkin
36cab257ce
Upgrade webpack-bundle-analyzer (#20232)
Co-authored-by: Tim Neutkens <timneutkens@me.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-12-18 09:47:26 +01:00
Joe Haddad
9661256263
Upgrade http-proxy dependency (#20239) 2020-12-16 17:02:39 -05:00
Tim Neutkens
81e67ce95e
Update terser-webpack-plugin to support webpack 4 (#20089)
Solves some of the cache warnings when using webpack 5
2020-12-12 20:28:53 +00:00
Joe Haddad
1692e931d9
Upgrade Terser (#20063)
Fixes #18056
2020-12-10 16:49:23 +00:00
JJ Kasper
bb1bdbb10f
Update @ampproject/toolbox-optimizer to latest version (#19722)
This updates to the latest version of the `@ampproject/toolbox-optimizer` which contains updates for dependencies to remove the warnings on install from `npm`

x-ref: https://github.com/vercel/next.js/pull/18994
Closes: https://github.com/vercel/next.js/issues/17416
2020-12-02 12:55:43 +00:00
Janicklas Ralph
6e4632efe1
Css optimizations (#16539)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2020-12-01 19:02:07 +01:00
Joe Haddad
ab0e2744ee
Upgrade styled-jsx (#19241)
This fixes compatibility with React 17 and `styled-jsx`.

Fixes #19242
2020-11-17 16:53:35 +00:00
JJ Kasper
00f8297c4d
Fix prefetching in IE11 (#19171)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-11-15 16:18:16 -05:00
Joe Haddad
61c3db7368
Fix minifying inline CSS comments (#19167)
We accidentally regressed back in 9.5 and dropped support for inline CSS comments. PostCSS always parses these as pass-through (and not a syntax error), which can cause problems when minifying.

Browsers do a similar thing and ignore the comments.

To ensure we generate valid CSS, this adds support for stripping the CSS comments from the build.

--- 

Fixes #15589
Closes #17130
2020-11-14 15:03:04 +00:00
Josh Flayhart
5afed07925
Update node-html-parser lib (#19103)
In working with @devknoll on https://github.com/vercel/next.js/pull/17770 we thought it would be a good idea to update to the latest minor version from 1.2.20 -> 1.4.9 based on some bug fixes in these minor releases. I would like to separate this out to simplify the growing changeset in https://github.com/vercel/next.js/pull/17770, where we need to use `node-html-parser` to parse HTML for custom react components.

The linked changeset above will take some time and there are some [useful bug fixes](https://github.com/taoqf/node-html-parser/commits/master) and features in this minor release we could benefit from anyway. Namely:

- add nextSibling, nextElementSibling
- missing node tag
- `<style>` tag is not parsed correctly

Also I think it's a good idea to separate this out for testing.
2020-11-12 15:46:35 +00:00
Ludovico Fischer
ac3fe8e004
Bump node-sass development dep to v5 (#19070) 2020-11-12 01:51:44 -05:00
Joe Haddad
67494bd991
Upgrade use-subscription for React 16/17 bicompat (#19087)
Fixes #18518
2020-11-12 05:53:59 +00:00
JJ Kasper
ae75c6a640
Update chokidar to latest (#18995)
Updates to the latest version of `chokidar`

x-ref: https://github.com/vercel/next.js/issues/17416
2020-11-11 07:35:31 +00:00
iczero
5aa7606ae3
Upgrade sass-loader to 10.0.5 (#18972)
`node-sass` v5 introduced support for Node.js v15, which is not supported by v4. However, Next.js currently errors with
```
Error: Node Sass version 5.0.0 is incompatible with ^4.0.0.
```
when attempting to build with `node-sass` 5.0.0. This error comes from `sass-loader`. They have recently released version 10.0.5 which supports `node-sass` 5.0.0 (PR <https://github.com/webpack-contrib/sass-loader/pull/899>, release <https://github.com/webpack-contrib/sass-loader/releases/tag/v10.0.5>).
2020-11-09 15:14:47 +00:00
JJ Kasper
f02f70478b
Ensure correct target is used for ncc'ing web-vitals (#18905)
This makes sure we don't use es6 syntax when compiling the `web-vitals` package with `ncc` since that breaks IE11 compatibility 

x-ref: https://github.com/vercel/ncc/pull/614
2020-11-06 21:02:28 +00:00
Joe Haddad
6b8903f1b7
Upgrade cssnano (#18879)
Fixes #17066
2020-11-06 00:46:19 -05: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
JJ Kasper
8799bd2b00
Fix chromedriver set-up to test electron separately (#18854)
* Fix chromedriver set-up to test electron separately

* Update workflow

* Update compiled
2020-11-05 14:45:21 -06: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
Bogdan Chadkin
f78ee06f5c
Upgrade browserslist (#17662)
Ref https://github.com/browserslist/browserslist/blob/master/CHANGELOG.md
2020-11-05 12:30:20 +00:00
Guy Bedford
7b66da83e3
Update ncc (#18823)
This updates to the latest ncc@0.24.1 release.

Initially I thought chalk needed to be removed to make this work, but it turns out it was a caching issue.

I've also added a cache clear to the rebuild command to avoid these issues hopefully in future.
2020-11-05 03:30:37 +00:00
Guy Bedford
a1ea352911
Remove @babel/preset-modules (#18759)
This is a prerequisite to being able to ncc inline the Babel dependencies in next.js.

The removal of preset-modules is based on replacing it with preset-env under `targets: { esmodules: true }`, as per the guidance from the package (https://www.npmjs.com/package/@babel/preset-modules):

> Starting from @babel/preset-env 7.9.0, you can enable the bugfixes: true option to get the same behavior as using @babel/preset-modules, but with support for custom targets. If you need to target browsers with native modules support (like this preset does), you can use targets: { esmodules: true }.

From the above, I'm pretty sure this is entirely a backwards compatible change, apart from the change to the runtime plugin list being visible. Perhaps @developit can confirm this as well.
2020-11-04 06:53:39 +00:00
Cowboy Ho
28e12876b8
Fix router not working on some protocol (#16650)
Co-authored-by: Tim Neutkens <timneutkens@me.com>
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2020-11-03 16:18:02 -05:00
Tim Neutkens
9508322381
Update use-subscription to account for React 17 peerDependency (#18199) 2020-10-24 22:31:26 +02:00
JJ Kasper
ebee2bafa9
Ensure 404 with SSG is rendered correctly with notFound (#18205)
This ensures a custom `/404` page with `getStaticProps` works correctly when leveraging the new `unstable_notFound` support in `getStaticProps`

Closes: https://github.com/vercel/next.js/issues/18196
x-ref: https://github.com/vercel/next.js/pull/17755
2020-10-24 19:22:48 +00:00
dependabot[bot]
1925ca039c
Bump node-sass from 4.12.0 to 4.13.1 (#18140)
Bumps [node-sass](https://github.com/sass/node-sass) from 4.12.0 to 4.13.1.
- [Release notes](https://github.com/sass/node-sass/releases)
- [Changelog](https://github.com/sass/node-sass/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sass/node-sass/compare/v4.12.0...v4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-23 09:58:51 +02:00
dependabot[bot]
11d1d6b546
Bump tree-kill from 1.2.1 to 1.2.2 (#18139)
Bumps [tree-kill](https://github.com/pkrumins/node-tree-kill) from 1.2.1 to 1.2.2.
- [Release notes](https://github.com/pkrumins/node-tree-kill/releases)
- [Commits](https://github.com/pkrumins/node-tree-kill/compare/v1.2.1...v1.2.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-10-23 09:52:37 +02:00
Tim Neutkens
ea29bb3e4c
Fix precompiled code (#18093)
Solves the build failure we're seeing on PRs
2020-10-21 18:43:39 +00:00
Tim Neutkens
71f3e8db7b
Upgrade @ampproject/toolbox-optimizer (#18087)
Fixes #18044
Related to #17416
2020-10-21 18:04:31 +02:00
Ludovico Fischer
6212823735
Upgrade to Chokidar 3. (#17558)
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2020-10-21 15:23:20 +02:00
Ludovico Fischer
b89d417b37
Update to PostCSS 8. (#17415)
Co-authored-by: Tim Neutkens <timneutkens@me.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-10-21 12:31:07 +02:00
Felipe Flores
d4f53ec2bc
Update resolve-url-loader to fix vulnerability (#18064)
Bump resolve-url-loader version to fix vulnerability. 

Fixes #18048
Related #18044
2020-10-20 20:26:38 +00:00
Ludovico Fischer
0d3671c2c2
Update to postcss-loader 4.0.2. (#17458)
Co-authored-by: Tim Neutkens <timneutkens@me.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-10-19 17:07:59 +02:00
JJ Kasper
bbdebd4f57
Make sure animated assets aren't de-animated by optimizer (#17974)
This makes sure the image optimizer doesn't de-animate images by transforming them with sharp since sharp doesn't currently handle outputting animated images

x-ref: https://github.com/vercel/next.js/pull/17749
2020-10-17 19:22:10 +00:00
Steven
d3741d5ec5
Add support for Image Optimizer (#17749)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2020-10-16 13:10:01 +02:00
Tommaso De Rossi
5c4d0bded6
Resolve to real path before checking for path inequality (#17279)
Co-authored-by: Luis Alvarez D <luis@vercel.com>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2020-10-14 13:36:59 +02:00
JJ Kasper
b2d1d87e7f
Add initial changes for i18n support (#17370)
This adds the initial changes outlined in the [i18n routing RFC](https://github.com/vercel/next.js/discussions/17078). This currently treats the locale prefix on routes similar to how the basePath is treated in that the config doesn't require any changes to your pages directory and is automatically stripped/added based on the detected locale that should be used. 

Currently redirecting occurs on the `/` route if a locale is detected regardless of if an optional catch-all route would match the `/` route or not we may want to investigate whether we want to disable this redirection automatically if an `/index.js` file isn't present at root of the pages directory. 

TODO: 

- [x] ensure locale detection/populating works in serverless mode correctly
- [x] add tests for locale handling in different modes, fallback/getStaticProps/getServerSideProps

To be continued in fall-up PRs

- [ ] add tests for revalidate, auto-export, basePath + i18n
- [ ] add mapping of domains with locales
- [ ] investigate detecting locale against non-index routes and populating the locale in a cookie

x-ref: https://github.com/vercel/next.js/issues/17110
2020-10-07 21:11:01 +00:00
Joe Haddad
49a59b1ad2
Polyfill missing std lib fns for module browsers (#17083) 2020-09-14 15:25:30 -04:00
Bogdan Chadkin
9959d7ef32
Use babel 7 jsx syntax (#17043)
For some reason babel-plugin-syntax-jsx of babel 6 was used instead of
babel 7 version.
2020-09-13 13:29:23 +00:00
Ole-Martin Bratteng
5f36f4699c
Upgrade web-vitals (#17028)
ref https://github.com/GoogleChrome/web-vitals/pull/68

won't fail the new [`no-unload-listeners`](https://github.com/GoogleChrome/lighthouse/pull/11085) Lighthouse audit.
2020-09-12 04:04:33 +00:00
Bogdan Chadkin
f786ccdbb9
Upgrade cacache of terser-webpack-plugin (#17022)
Ref https://github.com/webpack-contrib/terser-webpack-plugin/blob/v4.1.0/package.json#L44

cacache is a dependency of terser-webpack-plugin. The latest version
depends on cacache 15 while next adds cacache 13. This may give
unexpected results. Better keep it in sync with terser plugin.
2020-09-11 16:19:54 +00:00
Bogdan Chadkin
ddf9ed3b62
Prefer builtin optional chaining and nullish coalescing (#16780)
Babel-preset-env includes includes optional chaining and
nullish-coalescing since [7.8.0](https://github.com/babel/babel/releases/tag/v7.8.0).

In this diff I removed these plugins from next preset to prevent
dependency duplication when their newer versions are out.
2020-09-11 15:20:10 +00:00
Bogdan Chadkin
e5f9fbbcdf
Upgrade sass loader (#16970)
The new version replaced big clone-deep package with dependency-free klona
- https://github.com/webpack-contrib/sass-loader/releases/tag/v10.0.0
- https://github.com/webpack-contrib/sass-loader/releases/tag/v9.0.0

Also deduped some related transitives.
2020-09-11 12:36:48 +00:00
Sakito Mukai
7efa3babb7
Security upgrade node-fetch (#17009)
There was a security update for node-fetch.

> This is an important security release. It is strongly recommended to update as soon as possible.
https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md#v261
2020-09-11 09:01:48 +00:00
Joe Haddad
25cdaab297
Add Support for CSS Module Value Imports (#16973)
Fixes #10142
Fixes #11629
2020-09-09 23:29:37 +00:00
JJ Kasper
fa153bcfac
Only update lookups for dev overlay if mounted (#16776)
Since the error overlay could be dismissed before this is resolved we need to make sure the component is still mounted before updating the state.
2020-09-02 09:25:19 +00:00
Joe Haddad
f921b4f476
Auto enable React's new JSX transform on 17.x (#16603) 2020-09-01 11:29:25 -04:00
Joe Haddad
7c7ecaa636
Do not alias Node modules for webpack 4 (#16452)
Fixes #16259
Caused by #16022
Follow up issue: #16450

This PR skips polyfilling Node modules in webpack 4 which are ignored by the `browsers` key.
2020-08-21 18:50:24 +00:00
Prateek Bhatnagar
6c9dd6c3d4
AMP compatibility for Font optimization (#16208)
- Upgrades cssnano to 1.2.0
- Only removes whitespaces from downloaded font declarations
- Disables Font optimization for AMP pages
2020-08-20 15:10:59 -04:00
Tim Neutkens
dab55b473c
Add serialization for mini-css-plugin webpack 5 caching (#16379) 2020-08-20 12:38:39 +02:00
Joe Haddad
ff33e07afe
Replace broken prop-types-exact package (#15953)
This PR replaces `prop-types-exact` (only used in this location) with manual property checking.

Right now, malformed properties sent to `<Link>` are silently handled and only emit a warning in the console.
This leads to confusing/unexpected errors because we try to read a value that is undefined.

To fix this, we'll now throw a proper error when `<Link>` is misused. **This still isn't optimal, however, because we don't have a component stack trace we can give the user**.
We're not going to be able to give the user actionable instructions until React 16.14 at a minimum.

---

Fixes #13951
Fixes #16107
Closes #13962
2020-08-18 16:36:40 +00:00
Sergey Rubanov
feeb941dc6
Update to Terser 5 (#16194)
Co-authored-by: Tim Neutkens <timneutkens@me.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-08-16 19:32:37 +02:00
Kristoffer K
db40a39f5e
fix: add missing dependency caniuse-lite (#16091)
**What's the problem this PR addresses?**

https://github.com/vercel/next.js/pull/16048 stopped bundling `caniuse-lite` but didn't declare it as a dependency

https://github.com/yarnpkg/berry/runs/972037981?check_suite_focus=true#step:5:75

**How did you fix it?**

Add `caniuse-lite` as a dependency

---
cc @Timer 

As mentioned in https://github.com/vercel/next.js/issues/14157#issuecomment-667328984 I looked into adding a PnP e2e test but the use of the `gist` protocol stopped me from getting it to work since v2 doesn't support that yet. Would it be possible to change this to one of the supported protocols (https://yarnpkg.com/features/protocols)?
6366727550/packages/next/package.json (L208)
2020-08-14 13:52:52 +00:00
Joe Haddad
33176806f3
Remove unused dependency (#16168) 2020-08-13 13:40:08 -04:00
Sebastian Benz
d6ad0d0843
upgrade @ampproject/toolbox-optimizer to 2.6.0 (#16043)
See [release notes](https://github.com/ampproject/amp-toolbox/releases/tag/v2.6.0).

**Highlight:** [hero images can now be server-side rendered](https://github.com/ampproject/amp-toolbox/tree/main/packages/optimizer#preloadheroimage) by annotating then with `data-hero`. This will greatly improves LCP when using large images in the first viewport.

```
<amp-img data-hero src="/hero.jpg" layout="responsive" width="640" height="480"></amp-img>
```

Also fixes #15979
2020-08-10 16:06:00 +00:00
Joe Haddad
e08b633c3a
Do not bundle caniuse-lite (#16048) 2020-08-10 11:27:21 -04:00
Tim Neutkens
d1701091b8
Add cli for @next/codemod (#16039)
Largely based on the code @threepointone wrote for react-codemod.

Co-Authored-By: Sunil Pai <threepointone@gmail.com>

Co-authored-by: Sunil Pai <threepointone@gmail.com>
2020-08-10 14:34:35 +02:00
Tim Neutkens
62031ff24f
Move next-codemod to Next.js monorepo (#15536) 2020-08-10 11:14:53 +02:00
Tim Neutkens
843d58425b
Add browser polyfils for Node.js modules (webpack 5 backwards compat) (#16022)
This adds the following Node.js core polyfills only when the import is used:

- `path`
- `stream`
- `vm`
- `crypto`
- `buffer`

Fixes #15948

We'll have a separate issue about adding warnings for the usage of these modules in the browser, some polyfills like crypto are quite heavy and generally not needed for most applications (included accidentally through node_modules).
2020-08-10 01:26:21 +00:00
Prateek Bhatnagar
d8edb2eaa5
Bug fix: Font optimization (#15984)
Bug fix
- Do not remove spaces as it might mangle font names
2020-08-08 13:14:03 +00:00
Joe Haddad
882288b532
Warn when Fast Refresh is disabled (React <16.10) (#15931) 2020-08-06 10:41:11 -04:00
Tim Neutkens
405e42e41e
Enhance module not found error (#15860)
Adds handling for module not found errors exposed by webpack. This ensures you see the actual stack line and code instead of a short message where you don't know where to go.

### Previous

<img width="794" alt="Screen Shot 2020-08-05 at 18 02 06" src="https://user-images.githubusercontent.com/6324199/89435935-d5542c00-d745-11ea-9ca7-c67f553364f9.png">


### New

<img width="769" alt="Screen Shot 2020-08-05 at 14 20 23" src="https://user-images.githubusercontent.com/6324199/89412212-f6595480-d726-11ea-81a3-398ab7036338.png">


Fixes #14711
2020-08-05 19:11:35 +00:00
Alex Castle
b6060fa4a5
Add experimental image post-processing (#15875)
This PR adds a second experimental post-processing step for the framework introduced by @prateekbh in #14746. The image post-processing step scans the rendered document for the first few images and uses a simple heuristic to determine if the images should be automatically preloaded.

Analysis of quite a few production Next apps has shown that a lot of sites are taking a substantial hit to their [LCP](https://web.dev/lcp/) score because an image that's part of the "hero" element on the page is not preloaded and is getting downloaded with lower priority than the JavaScript bundles. This post-processor should automatically fix that for a lot of sites, without causing any real performance effects in cases where it fails to identify the hero image.

This feature is behind an experimental flag, and will be subject to quite a bit of experimentation and tweaking before it's ready to be made a default setting.
2020-08-05 17:49:44 +00:00
jiangtao
35e4a370d9
fixed issue with runtime-config returning undefined when building or in a development environment (#15777)
fix https://github.com/vercel/next.js/issues/7713#issuecomment-643632270
2020-08-04 16:47:37 +00:00
Prateek Bhatnagar
1ea8bdcdc7
Bug fix: Font optimization (#15644)
- Fixes the serverless build for font optimizations
2020-08-04 07:54:08 +00:00
Kristóf Poduszló
aef6726eb8
Add missing nomodule polyfills and suggest using features only up to ES2019 for browser compatibility (#15772)
These changes aim to resolve most of the concerns raised in #15756. It adds missing polyfills for legacy browsers up until ES2019:

- Number.{parseFloat,parseInt}
- ~Math.{acosh,asinh,atanh,cbrt,clz32,cosh,expm1,fround,hypot,imul,log10p,log1p,log2,sign,sinh,tanh,trunc}~ _[Removed as these are [not widely used](https://github.com/vercel/next.js/pull/15772#discussion_r463957931)]_
  - While these may seem to weigh a lot, they barely add 1 kB to the resulting bundle:
    <img width="492" alt="gzip: 32 kB vs. 30.9 kB, Brotli: 28.8 kB vs. 27.8 kB" src="https://user-images.githubusercontent.com/14854048/89100961-1376e600-d3fc-11ea-90fd-3e6632b70220.png">
- ~Object.fromEntries~ _[Removed as [it's rarely used in user code](https://github.com/vercel/next.js/pull/15772#discussion_r463984612)]_

Also, the following features are now supported with build-time transforms:

- ~`globalThis` (gets transformed into `window` in browser environments)~ _[Removed as it [could break existing applications](https://github.com/vercel/next.js/pull/15772#discussion_r463956269)]_
- `export * as ns from 'module'`

The suggested TypeScript library version has been set to ES2018, so the features below become unavailable in type-checked files (they're not evenly supported by module-compatible browsers, either):

- Object.fromEntries
- String.prototype.matchAll
- String.prototype.replaceAll
- Promise.any + AggregateError
- WeakRef

As for the `import.meta` support, [webpack v5 seems to fix that](https://github.com/webpack/webpack/pull/11075), so it should eventually become an issue of the past.

---

Fixes #15756
2020-08-04 06:03:52 +00:00
Joe Haddad
48ca2f2cc5
Fix CSS grid-column shorthand syntax (#15848) 2020-08-04 00:08:09 -04:00
Tim Neutkens
60f1d58c83
Fix some webpack 5 deprecation warnings (#15797)
- Use latest terser version (still 1 warning in the stable version which is an open PR)
- Add emitOnErrors instead of noEmitOnErrors
- Added trace-deprecations for Next.js core development
2020-08-03 12:57:17 +00:00
Tim Neutkens
bf3b1b56ca
Update release.js and release package to avoid github rate limit (#15575) 2020-07-28 15:05:26 +02:00
Rafael Almeida
c50843f660
Add release hook to format the changelog by labels (#14592)
* Add release hook

* Remove release.js exported config

* Add skip flag to release CLI

* Use full flag name

* Upgrade release

* Update yarn.lock

Co-authored-by: Tim Neutkens <timneutkens@me.com>
2020-07-28 14:07:45 +02:00
Prateek Bhatnagar
fb81ecb2bd
Font optimizations (#14746)
Co-authored-by: atcastle <atcastle@gmail.com>
2020-07-28 12:19:28 +02:00
Tim Neutkens
fdfc508a61
Add polyfill for process and Buffer in webpack 5 (#15499) 2020-07-28 11:33:21 +02:00
Sebastian Benz
5636748708
upgrade @ampproject/toolbox-optimizer to 2.5.14 (#15463) 2020-07-27 18:12:33 +00:00
Joe Haddad
e837c2253d
Upgrade cssnano-simple dependency (#15488) 2020-07-26 23:56:36 -04:00
Jan Potoms
2f50f1f8c9
Stabilize more tests (#15470)
jest retries seem to be masking test failures, like the `auto-export` one (and maybe others). I turned it off for now. The `auto-export` test fails when retries are turned off.
the output of this test failure was a bit unhelpful so I also improved it.
Many tests have anonymous page functions.
2020-07-26 04:57:06 +00:00
Joe Haddad
1509465f25
Update lockfile 2020-07-24 23:07:42 -04:00
Tim Neutkens
c5f29b76ea
Update webpack to land chokidar patch for all Next.js users (#15460)
Forces all Next.js users to have this patch installed: https://twitter.com/timneutkens/status/1282129714627448832

Huge thanks to @paulmillr and @sokra 🙏
2020-07-24 19:23:23 +00:00
Bogdan Chadkin
a26c69d11d
Upgrade browserslist (#15324)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-07-20 10:01:34 -04:00
Joe Haddad
2aca32d740
[internal] Fix Fast Refresh tests on macOS (#15300) 2020-07-19 03:48:58 -04:00
Tim Neutkens
bd9fc12f92
Fix ky-universal-polyfill in webpack 5 (#15227)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-07-17 00:29:34 +02:00
Joe Haddad
9d94d70d1f
Use core-js for URL(SearchParams) Polyfill (#15209)
This replaces the `url-polyfill` package with the `core-js` version which handles more edge cases in legacy browsers.

Closes #11702
Fixes #15194
2020-07-16 14:36:48 +00:00
Tim Neutkens
14babe5b3f
Make type checking compatible with webpack 5 (#15158)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-07-15 13:56:27 -04:00
Joe Haddad
a131909857
Fix Web Workers with Fast Refresh (#15145) 2020-07-14 12:17:10 -04:00
JJ Kasper
fed7e093f5
Make sure additional query values aren't added for auto-export (#15037)
This makes sure we don't add an undefined query value for auto-export pages for auto-export pages unnecessarily 

Fixes #15023
2020-07-10 03:16:02 +00:00
Cristian Dominguez
f4f6fea71f
CNA: replace make-dir with core recursive mkdir (#15006)
Fix #14902 

I created a separated helper that wraps `fs.promises.mkdir` and sets `recursive` option to `true` by default.

I'm not sure if this is the right approach (maybe it should just call `fs.promises.mkdir` from `create-app.ts`?), any thoughts?
2020-07-10 01:29:03 +00:00
Tim Neutkens
ab4a90b0d9
Add filename to error in webpack 5 (#14977)
Co-authored-by: Tobias Koppers <sokra@users.noreply.github.com>
2020-07-09 14:31:06 +02:00
JJ Kasper
38bd1a024c
Re-enable scroll restoration behind flag (#14046)
This updates the scroll position saving to occur as the scroll position changes instead of trying to do it when the navigation is changing since the `popState` event doesn't allow us to update the leaving history state once the `popState` has occurred. 

The order of events that was previously attempted to save scroll position on a `popState` event (back/forward navigation)

1. history.state is already updated with state from `popState`
2. we replace state with the currently rendered page adding scroll info
3. we replace state again with the `popState` event state overriding scroll info

Using this approach the above event order is no longer in conflict since we don't attempt to populate the state with scroll position while it's leaving the state and instead do it while it is still the active state in history

This approach resembles existing solutions:
https://www.npmjs.com/package/scroll-behavior
https://twitter.com/ryanflorence/status/1029121580855488512

Fixes: https://github.com/vercel/next.js/issues/13990
Fixes: #12530
x-ref: https://github.com/vercel/next.js/pull/14075
2020-07-06 14:27:45 +00:00
Tim Neutkens
c5cc6072d0
Use single webpack runtimeChunk for Node.js compilation (#14722)
Webpack 5 supports a single runtimechunk for the Node.js compilation, this solves sharing modules between entrypoints.
2020-07-01 15:34:00 +00:00
Joe Haddad
923afd68d4
Upgrade CSSNano Version (#14638)
Fixes #14632
Fixes #14690
2020-06-29 21:29:53 +00:00
Joe Haddad
ac5b2acd12
Fix dynamic route encoding for NextLinks (#14281) 2020-06-29 16:44:43 -04:00
Tim Neutkens
ae542b8525
Use entry option instead of custom make hook (#14527)
Simplifies on-demand-entries a bit.
2020-06-26 04:26:09 +00:00
Jan Potoms
fdcc24be6d
Fix native-url path parsing bug (#14442)
Test case for https://github.com/GoogleChromeLabs/native-url/pull/28

Fix https://github.com/vercel/next.js/issues/14419
2020-06-25 17:19:12 +00:00
Sebastian Benz
eef40c5948
update AMP Optimizer to v2.5.3 (#14173) 2020-06-15 14:17:59 +02:00
Sebastian Benz
ec90cc83ff
Update AMP Optimizer to v2.5.2 (#14095)
This addresses the problem of the optimizer postinstall hook causing
delayed installs if run behind a proxy. See https://github.com/ampproject/amp-toolbox/issues/832

Fixes #14070
2020-06-11 19:28:56 +00:00
Sebastian Benz
adf1a24ccb
Update AMP Optimizer to 2.5.1 (#13925)
Most notable new feature: automated hero image preloading.

Release notes: https://github.com/ampproject/amp-toolbox/releases/tag/v2.5.1
2020-06-09 09:08:29 +00:00
Tim Neutkens
08e7fa16db
Get rid of autodll (#13669)
Prepares for the upgrade to webpack 5
2020-06-02 19:20:37 +00:00
Jan Potoms
f69757408e
Update browserslist/caniuse-lite (#13605)
Looks like `caniuse-lite` is out of date and causing test failures. 
- I upgraded both `browserslist` and `caniuse-lite` to latest semver compatible version.
- This seemed to cause changes in ncc compiled files, so recompiled.
- `lint-staged` failed on these files even though they should be ignored. As a fix, I applied the advice from https://github.com/okonet/lint-staged#how-can-i-ignore-files-from-eslintignore-
- Updated some test snapshots. 🤔 not sure this is the way to go
2020-05-31 19:37:01 +00:00
Kristoffer K
0199d00671
fix: update ampproject/toolbox-optimizer (#13547) 2020-05-29 15:33:16 +02:00
Joe Haddad
92a12a2e20
Replace fork-ts-checker-webpack-plugin with faster alternative (#13529)
This removes `fork-ts-checker-webpack-plugin` and instead directly calls the TypeScript API.

This is approximately 10x faster.

Base build: 7s (no TypeScript features enabled)

- `fork-ts-checker-webpack-plugin@3.1.1`: 90s, computer sounds like an airplane
- `fork-ts-checker-webpack-plugin@4.1.6`: 84s, computer did **not** sound like an airplane
- `fork-ts-checker-webpack-plugin@5.0.0-alpha.14`: 90s, regressed
- `npx tsc -p tsconfig.json --noEmit`: 12s (time: `18.57s user 0.97s system 169% cpu 11.525 total`)
- **This PR**: 22s, expected to get better when we run this as a side-car

All of these tests were run 3 times and repeat-accurate within +/- 0.5s.
2020-05-29 08:16:22 +00:00
Jan Potoms
44a65a5e91
Update firebase to fix install errors on node 14 (#13493)
Running
```
yarn
```
in the project while on node.js 14 results into errors with the `grpc` dependency of `firebase`. Updating `firebase` fixes that.
2020-05-28 23:23:35 +00:00
Joe Haddad
bee8c31b87
Lint for invalid imports (#13482)
This adds a lint rule to ensure we don't import dev dependencies by accident.
2020-05-28 08:23:10 +00:00
Joe Haddad
37f4353f24
Do not throw away tsconfig.json comments (#13458)
This pull request updates our TypeScript verification process to not wipe out potentially vital user comments.

Introducing a prompt process was mostly a side effect of users wanting to keep comments.
There's no reason we really need this prompt, as answering no would refuse to boot the Next.js server anyway.

---

Fixes #8128
Closes #11440
2020-05-27 18:46:18 +00:00
Marco Moretti
b3e45fab5e
feat(cli): use default template when GH is offline (#12194)
fix #12136 

I add a prompt if there is an error when trying to download example files.
Maybe could be better to add an error class and in create-app.ts on every "console.error" trow a new Exception and manage it in catch. What you think ? 👯
2020-05-26 16:39:18 +00:00
Ayhan
0dd818b79a
Update Amp dependencies (#13354) 2020-05-25 16:05:08 +00:00
Joe Haddad
d6ad201f80
[Fast Refresh] Upgrade react-refresh (#13285)
Closes #13254
2020-05-23 21:37:56 +00:00
Prateek Bhatnagar
75b0bfff9c
bug fixes for Lint routing (#13111)
- bug fixes in `@next/eslint-plugin-next`.
- adds rules to `recommended` config.
2020-05-21 23:42:20 +00:00
JJ Kasper
da5a05dc87
Migrate PR stats action into Next.js repo (#13177)
* Migrate PR stats into Next.js repo

* Update running prettier in local mode
2020-05-21 14:07:27 +02:00
Prateek Bhatnagar
dc826e3d37
adding no html-link lint rule to eslint-plugin (#12969)
* addinng no html-link lint rule

* fixing lint tests

* adding the utils file

* fixing lock file

* prettier fix
2020-05-19 10:54:32 +02:00
Joe Haddad
dbad9db68c
Update Examples for Fast Refresh (#13068) 2020-05-18 17:44:18 -04:00
Joe Haddad
86160a5190
Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
Jan Potoms
714747957a
Add eslint-plugin-jest (#13003) 2020-05-18 13:16:07 -04:00
Jan Potoms
3b382a08d5
Improve jsconfig.json error message (#13053) 2020-05-18 12:07:08 -04:00
Tim Neutkens
57dcdd90b5
Bypass OPTIONS handling for API routes (#12978) 2020-05-16 17:15:12 -04:00
Jan Potoms
32057c849d
Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
JJ Kasper
9df9d4aea5
Fix build stalling with styled-jsx plugins (#12952) 2020-05-15 17:15:15 -04:00
Joe Haddad
0d49f22e11
Remove react-error-overlay (#12942) 2020-05-15 14:14:44 -04:00
JJ Kasper
7f28e8bf9b
Correct multi-match param behavior (#12930) 2020-05-15 12:45:29 -04:00
Alessandro Cifani
615f658da4
chore(deps): upgrade url-polyfill (#12829) 2020-05-13 11:39:41 -04:00
Tim Neutkens
93c81494c6
Make fetch polyfill work with ky-universal (#12804) 2020-05-12 15:58:21 -04:00
Joe Haddad
8b51e003f5
Upgrade deps (#12700) 2020-05-10 20:48:57 -04:00
JJ Kasper
92edfb953d
Cont. Update performance relayer and remove unstable prefix (#12665)
* updates relayer, uses web-vital lib, removes fid polyfill and removes unstable prefix from relayer

* simplify logic, fix null check

* update docs

* Update tests

* Rename relayWebVitals to reportWebVitals

Co-authored-by: housseindjirdeh <houssein@google.com>
2020-05-09 21:48:52 +02:00
Simon Knott
be02fe183f
Allow @babel/preset-typescript to be configured (#11840)
* Allow `@babel/preset-typescript` to be configured

Some usages, e.g. [getting parameter decorators to work properly](https://github.com/WarnerHooh/babel-plugin-parameter-decorator/pull/19), require configuring `@babel/preset-typescript`.

This commit adds that functionality to `next/babel`.

* Add unit test for babel/preset allowing to pass options to @babel/preset-typescript

* Add integration test for onlyRemoveTypeImports

* Update babel dependencies

* Update to compatible typescript version and fix types

* Fix linting and run pre-nccing

* Update size-limit test

* Add additional tests

* Re-Apply delta to be calculated using -262

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2020-05-09 17:12:02 +02:00
Joe Haddad
6627f57b59
[Fast Refresh] Upgrade react-refresh for SC (#12627) 2020-05-08 10:28:51 -04:00
JJ Kasper
d37891a921
Update to latest version of stacktrace-parser (#12597) 2020-05-07 08:26:15 -05:00
Sebastian Benz
5dfb2e40d1
Update AMP dependencies (#12536) 2020-05-06 10:18:18 -04:00
Maël Nison
a7bf8c211d
Adds missing deps (#12519) 2020-05-06 10:33:06 +02:00
Joe Haddad
f024814057
[Fast Refresh] Correctly Trap Focus in Overlay (#12502)
* [Fast Refresh] Correctly Trap Focus in Overlay

* Adjust escape behavior to be more correct

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2020-05-05 11:05:40 -04:00
Joe Haddad
e0449a5b9c
[Fast Refresh] New Overlay for Prerender Error (#12485) 2020-05-04 17:16:03 -04:00
Joe Haddad
d81f23d74f
Upgrade Flexbugs Dependency (#12459)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2020-05-04 12:33:34 -05:00
matamatanot
5787cbd9de
Update lint-staged (#12225) 2020-05-02 15:47:16 -04:00
Joe Haddad
4624c09fe5
fix lockfile 2020-05-02 01:11:30 -04:00
Shotaro Watanabe
eb9d10fa80
Update @ampproject/toolbox-optimizer to v2.3.0 (#12039) 2020-05-02 00:38:04 -04:00
Joe Haddad
37e3ec8d17
[Fast Refresh] Click to open in editor (#12397) 2020-05-01 22:04:03 -04:00
Joe Haddad
42daf7f47c
Upgrade source-map package (#12355)
* Abort after 10s instead of 3s while testing

* skip tests to unlock CI

* re-enable tests

* fix

* Catch `performReactRefresh` errors
2020-04-30 13:13:40 -04:00
Joe Haddad
fbea795ad9
[Fast Refresh] Redesigned Runtime Error Experience (#12222) 2020-04-30 10:50:25 -04:00
Tim Neutkens
0713ba4e78
Fix wildcard paths causing infinite resolving (#12318) 2020-04-29 17:04:42 +02:00
JJ Kasper
9482bfb906
Downgrade node-notifier to fix Azure tests (#12261) 2020-04-28 10:44:55 +02:00
JJ Kasper
3094016cc3
Downgrade terser to fix invalid minifying (#12178) 2020-04-26 15:16:43 -04:00
matamatanot
6ce3c7b435
Update node-notifier (#12205) 2020-04-26 17:24:21 +02:00
Joe Haddad
fcc6d7d483
Fix CSS Module HMR (#12177) 2020-04-25 13:08:06 +02:00
matamatanot
29f86d9076
Remove @types/find-up (#12120) 2020-04-23 09:39:31 +02:00
Joe Haddad
5d8709946a
[internal] Dedupe monorepo deps (#12093)
* Dedupe webpack

* Dedupe deps

* Update compiled deps
2020-04-22 01:25:43 -04:00
Joe Haddad
d8c71b1537
Evaluate App before Page in Dev for CSS Ordering (#12090) 2020-04-21 23:55:02 -04:00
Fonger
fc830b25de
Upgrade ora to 4.0.4 to prevent undefined progress on CI build (#12088) 2020-04-21 22:52:07 -04:00
Joe Haddad
07b24e6fa1
Upgrade webpack (#12082)
* Upgrade webpack

* rebundle
2020-04-21 16:05:29 -04:00
Joe Haddad
450d4bd0f3
Experimental: React Refresh Support (#12008)
* Add Fast Refresh Support

* Add Basic Acceptance Test

* Increase delay

* fix version

* Ignore test files

* Update packages/next/build/webpack/loaders/next-babel-loader.js

* Copy tests

* Redo test style

* drop directory

* fix compile

* fix remove function

* Update helpers
2020-04-19 13:58:31 -04:00
Joe Haddad
ec3f8e5815
Create React Refresh Utils (#12006)
* Create React Refresh Utils

* Fix Linting

* Update Prettier Ignore

* fix rules
2020-04-18 13:55:10 -04:00
Joe Haddad
fe09c10383
Upgrade terser-webpack-plugin for Webpack 5 (#11922)
* Upgrade `terser-webpack-plugin` for Webpack 5

* Upgrade again

* cacache cannot be bundled

* cacache cannot be bundled

* fix file

* remove cacache dep

* Update LICENSE
2020-04-15 14:20:25 -04:00
Joe Haddad
9fdd6ed2e4
Fix Lockfile 2020-04-13 14:48:23 -04:00
matamatanot
e686545c0d
Update @types in create-next-app (#11815)
* remove self made types

* add types

Co-authored-by: matamatanot <matamatanot@gmail.com>
2020-04-13 13:06:19 -04:00
Joe Haddad
041384bdda
Upgrade ci-info (#11758)
* Upgrade `ci-info`
This adds support for Nevercode, GH Actions, and Render.

* Repackage compiled deps

* Try to fix test
2020-04-09 10:23:04 -04:00
JJ Kasper
fa167e3346
Update to latest version of AMP optimizer (#11753)
* Update to latest version of AMP optimizer

* Update test

* Update another test

* Update another test
2020-04-09 10:23:31 +02:00
matamatanot
1f15072e99
Update got in create-next-app (#11725)
Co-authored-by: “kosuke_matano” <kosuke_matano@cyberagent.co.jp>
2020-04-07 09:24:57 -04:00
matamatanot
c89ddc97e2
Remove node-promisepipe library (#11700)
* remove promisepipe

* commit yarn.lock

Co-authored-by: “kosuke_matano” <kosuke_matano@cyberagent.co.jp>
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-04-06 10:46:04 -04:00
Madeline Ziolko
301cca3802
Update webpack and mkdirp (#11165)
* Update mkdirp to a version that no longer has a dependency on minimist: https://npmjs.com/advisories/1179

* Update webpack to the most recent minor version to remove minimist vulnerability.

* Update deps

Co-authored-by: Tim Neutkens <timneutkens@me.com>
2020-04-06 13:12:14 +02:00
Tim Neutkens
6e84c0c12a
Add dependencies used by compiled files (#11699)
* Add dependencies used by compiled files

* Update utils.ts
2020-04-06 11:52:19 +02:00
Joe Haddad
b747a366ab
Fix Preview Mode in <iframe> (#11638) 2020-04-03 13:18:04 -04:00
Guy Bedford
ce3f7d05b3
Drop url dependency (#11503) 2020-03-31 10:00:17 +02:00
Joe Haddad
b88f20c90b Fix lockfile 2020-03-30 16:26:25 -04:00
Guy Bedford
c16f60067b path-to-regexp 2020-03-30 16:26:25 -04:00
Guy Bedford
5619f990cf refactor ncc optimization, babel optimization 2020-03-30 16:26:25 -04:00
JJ Kasper
2713369e40
Update to not add path segments to redirect query automatically (#11497)
* Update to not add path segments to redirect query automatically

* Move check up
2020-03-30 18:43:24 +02:00
Tim Neutkens
e7ea27645d Add support for comments in tsconfig.json
Fixes #11390
2020-03-27 11:20:13 +01:00
JJ Kasper
d8155b22ff
Add initial support for new env handling (#10525)
* Add initial support for new env config file

* Fix serverless processEnv call when no env is provided

* Add missing await for test method

* Update env config to .env.json and add dotenv loading

* ncc dotenv package

* Update type

* Update with new discussed behavior removing .env.json

* Update hot-reloader createEntrypoints

* Make sure .env is loaded before next.config.js

* Add tests for all separate .env files

* Remove comments

* Add override tests

* Add test for overriding env vars based on local environment

* Add support for .env.test

* Apply suggestions from code review

Co-Authored-By: Joe Haddad <joe.haddad@zeit.co>

* Use chalk for env loaded message

* Remove constant as it’s not needed

* Update test

* Update errsh, taskr, and CNA template ignores

* Make sure to only consider undefined missing

* Remove old .env ignore

* Update to not populate process.env with loaded env

* Add experimental flag and add loading of global env values

Co-authored-by: Tim Neutkens <timneutkens@me.com>
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-03-26 13:32:41 +01:00
JJ Kasper
eeea53c04b
Fix warning for API routes with next export (#11330)
* Fix warning for API routes with next export

* Update warning copy
2020-03-24 13:38:22 -04:00
Tim Neutkens
876ae3fc87
Upgrade loader-utils (#11324) 2020-03-24 09:57:23 -04:00
Joe Haddad
f19dcf9b6e
Add Numeric Separator Support for TypeScript (#11308)
* Add Numeric Separator Support for TypeScript

* Check for number in render
2020-03-23 17:41:35 -05:00
Dulmandakh
d3fb262958
remove mkdirp, bump fs-extra to 9.0.0 (#11251)
* bump mkdirp to 1.0.3, which support promise

* fix mkdirp in spr-cache.ts

* bump fs-extra to 9.0.0

* remove mkdirp
2020-03-21 17:02:05 +01:00
Sebastian Benz
4b1ce16e12
upgrade @ampproject/toolbox-optimizer to 2.0.1 (#11168)
Fixes #11159
2020-03-18 14:20:29 +01:00
JJ Kasper
203f43c1fe
Add error when attempting to export GSSP page (#11154)
* Add error when attempting to export GSSP page

* Update errors/gssp-export.md

* Update errors/gssp-export.md

* Update errors/gssp-export.md

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2020-03-18 09:33:10 +01:00
Kaito Sugimoto
4cac93a75e
Update @next/bundle-analyzer dependencies (#11068)
* Update @next/bundle-analyzer

* update module

* Update yarn.lock
2020-03-15 12:24:07 +01:00
Joe Haddad
1e53a4961a
Correctly Count Object References (#10903)
* Correctly Count Object References

* Make error message better

* add more tests
2020-03-09 14:58:51 -04:00
Tim Neutkens
1a47dbea69
Upgrade webpack (#10895)
Fixes #10890
2020-03-09 13:11:06 +01:00
Prateek Bhatnagar
16672a4353
Adding conformance checks (#10314)
* adding tests  for rect sync conformance check

* adding test for react sync script conformance check

* reverting yarn lock changes

* adding duplicate polyfill conformance

* bug fixes in dulpicate polyfill conformance check

* adding settings capability to conformance plugin

* removing minification check from server build

* bug fix

* settings for react sync script check
2020-03-02 22:53:18 +01:00
Janicklas Ralph
7848615bd6
Fix url-polyfill dep and re-enable native-url (#10726)
* Adding native-url package

* Bumping native-url version

* Upgrading native-url

* Logging stats object for debugging

* Logging stats object for debugging

* Adding try catch to the error lines

* Experimenting with regex

* Experimenting with regex

* Experimenting with regex

* Testing regex changes

* Fixing defer-script test case to not include polyfill.js

* Meging changes with existing polyfill work

* Bumping version

* adjust webpack config

* Reduce size in size test

* Remove 1kb from legacy

* Bumping native-url version, includes fix for IE11

* Update lock file

* Updating native-url, fixes issue on IE11

* Fix sourcemap being added in document

* Adding Router as an app level dep. Fixes Router not being added as a dep to pages without Link when granularChunks is enabled

* Fix typescript error

* Fix modern + granularChunks hydration failing

* Fix TS error

* Update native-url version

* Adding native-url with safari fix

* Update url-polyfill in polyfill-nomodule package

* Remove url-polyfill from next package.json

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Joe Haddad <timer150@gmail.com>
2020-02-27 22:08:58 -05:00
Joe Haddad
40217b75b9
Revert "Re-Enable Native url Module (#10530)" (#10623)
This reverts commit b329f6a2d6.
2020-02-21 01:16:07 -05:00
Janicklas Ralph
b329f6a2d6
Re-Enable Native url Module (#10530)
* Adding native-url package

* Bumping native-url version

* Upgrading native-url

* Logging stats object for debugging

* Logging stats object for debugging

* Adding try catch to the error lines

* Experimenting with regex

* Experimenting with regex

* Experimenting with regex

* Testing regex changes

* Fixing defer-script test case to not include polyfill.js

* Meging changes with existing polyfill work

* Bumping version

* adjust webpack config

* Reduce size in size test

* Remove 1kb from legacy

* Bumping native-url version, includes fix for IE11

* Update lock file

* Updating native-url, fixes issue on IE11

* Fix sourcemap being added in document

* Adding Router as an app level dep. Fixes Router not being added as a dep to pages without Link when granularChunks is enabled

* Fix typescript error

* Fix modern + granularChunks hydration failing

* Fix TS error

* Update native-url version

* Adding native-url with safari fix

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Joe Haddad <timer150@gmail.com>
2020-02-21 00:25:49 -05:00
JJ Kasper
00855de60a
Add navigation test specific for Safari 10 (#10616)
* Add testing in Safari 10.1 on merge

* Add nav test specific for Safari 10
2020-02-20 13:35:28 -05:00
Joe Haddad
d7167e28e0
Fix AMP Validator Version (#10600) 2020-02-19 13:18:17 -05:00
Joe Haddad
c58f45f42d
Add Failing CSS Test Case (#10590)
* Add Failing CSS Test Case

* update tests
2020-02-19 08:46:58 -05:00
Jason Robinson
56a45f061a
Bump amphtml-validator to 1.0.30 (#10588) 2020-02-19 13:34:44 +01:00
JJ Kasper
9e8f173319
Update to latest watchpack with dynamic route rename fix (#10351)
* Fix dynamic route rename failing for case change

* Update normalizing curPageFiles

* Remove using webpacks file info since its inaccurate

* Revert changes in favor of fixing upstream

* Update to latest watchpack with case rename fix
2020-02-19 11:05:59 +01:00
Tim Neutkens
0222a09cd0
Enable polyfillsOptimization (#10574)
* Enable polyfillsOptimization

* Update sizes

* Commons is no longer there

* Update test
2020-02-18 19:26:55 +01:00
Sebastian Benz
ae9b13e0be
Migrate to AMP Optimizer 2.0 (#10535)
* Migrate to AMP Optimizer 2.0

Most notable changes:

* Automatically import all missing AMP component scripts.
* Automatically add any missing mandatary AMP tags.
* 40% faster

I've updated the docs to mention component auto import and added a corresponding
test case.

* change validator tests which now pass validation

* Improve wording

Co-Authored-By: JJ Kasper <jj@jjsweb.site>

* Update adding-amp-components.md

Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Joe Haddad <timer150@gmail.com>
2020-02-14 16:01:43 -05:00
Joe Haddad
71019e70d3
Remove native-url Again (#10526)
* Remove `native-url` Again

* update comment

* update sizes
2020-02-13 17:54:25 -05:00
Joe Haddad
3cb3498324
SSG Preview Mode (#10459)
* checkpoint: api impl

* Add support for tryGetPreviewData

* snapshot: server(less) support

* Add X-Prerender-Bypass-Mode header support

* Pass preview data to getStaticProps call

* add TODO

* setPreviewData

* 100k iterations

* Handle jwt error

* Write out preview values

* forgot file

* set preview props

* Send preview props

* add preview props

* Pass around more data

* update yarn lock

* Fail on Invalid Prerender Manifest

* Make Missing Prerender Manifest Fatal

* fix ts errors

* fix test

* Fix setting cookies + maxage

* Secure is not needed as we encrypt necessary data

* Set on domain root

* Set cookie max ages

* Render a fallback on-demand for non-dynamic pages

* Test preview mode

* remove old build

* remove snapshots

* Add serverless tests

* use afterAll

* Remove object assigns

* fix cookie spread

* add comment
2020-02-11 20:16:42 -05:00
Jan Potoms
5e4850ceee
Remove unused dependency @types/babel-types (#10448)
`@types/babel-types` doesn't seem to be in use anymore. `babel-types` is not used anywhere and `@babel/types` has its own typings included.
2020-02-07 11:13:59 +01:00
JJ Kasper
5ae7fe534e
De-dupe paths returned in getStaticPaths (#10423)
* De-dupe paths returned in getStaticPaths

* Remove warning
2020-02-04 21:55:11 -05:00
Joe Haddad
ecd628b7e0
Re-enable native-url (#10419)
* Re-enable `native-url`

* update sizes
2020-02-04 14:58:22 -05:00
JJ Kasper
e3d298dc62
Add support for rewriting to external resources (#10041)
* Add support for rewriting to external resources

* Update rewrite proxying test

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: Joe Haddad <timer150@gmail.com>
2020-02-04 14:08:03 -05:00
Tim Neutkens
e35005c214
[Experimental] Nomodule polyfills chunk (#10212)
* Polyfill Promise in polyfills chunk

* Override promise polyfill to use built-in

* Update sizes

* Update polyfills

* Test

* Add dep

* Use iife

* Unscope

* Revert "Unscope"

This reverts commit ab26bcefd551c544d5b3c577b7ce91e5ecfb9bb9.

* trigger

* Remove unused code

* Set helpers to true

* Update yarn.lock

* Fix test

* Update polyfills size

* Add comment

* Add back comment

* Put polyfills optimization under experimental flag

* Fix filename

* bring back promise for backwards compat until experimental feature is landed

* fix resolve alias check

* correct loader

* fix logic branches

* adjust !!

* adjust cache key

* Conditionally branch polyfill

* fix promise polyfill branching

* Re-add runtime

* fix base object

* fix yarn lock

* Add cache key

* correctly set caller

* add basic test

* Increment h=>i

* increment to j just in case

Co-authored-by: Joe Haddad <timer150@gmail.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2020-01-30 01:04:29 -05:00
James Mosier
c9dc17b852 Added support for BigInt to API routes (#10215)
* Added support for bigint to API routes

Closes #7980

* added BigInt test to get result

Co-authored-by: Joe Haddad <timer150@gmail.com>
2020-01-27 08:19:49 -05:00
Prateek Bhatnagar
0edd6a031a Adding conformance webpack plugin (#9716)
* adding Conformance Plugin behind a flag

* fixing compiler ts error

* fixing spelling errors 🤦🏻‍♂️

* addressing comments

* bug fix

* making it const enum

* reverting const enum

Co-authored-by: Joe Haddad <timer150@gmail.com>
2020-01-23 16:09:12 -05:00