Commit graph

2702 commits

Author SHA1 Message Date
Alex Castle
c9eb3dcad9
Image component lazy loading (#17916)
Co-authored-by: Tim Neutkens <timneutkens@me.com>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2020-10-17 20:55:29 +02:00
Tim Neutkens
b37835ac9c
Make sure w parameter is only included when a width is provided. (#17971) 2020-10-17 18:24:06 +02:00
Joe Haddad
ba83d86544
v9.5.6-canary.4 2020-10-16 16:31:49 -04:00
Joe Haddad
0fe5b23b0e
Add perf data experiment (#17956) 2020-10-16 16:31:09 -04:00
Yamagishi Kazutoshi
6bc6e2c494
Improve types for Image Component (#17954)
![Screenshot on VS Code](https://user-images.githubusercontent.com/12539/96300300-43fc1280-1030-11eb-89ae-dba8beeca583.png)

The only attribute that must be used with Image Component is src, but all attributes are required and TypeScript will warn you.
2020-10-16 20:04:39 +00:00
Yamagishi Kazutoshi
6f13956f12
Unify config.image.breakpoints to config.image.sizes (#17953)
Unify the confusing `config.images.sizes` ([Image Optimizer](https://github.com/vercel/next.js/discussions/17141)) and `config.images.breakpoints` ([Image Component](https://github.com/vercel/next.js/discussions/16832)).
2020-10-16 19:36:31 +00:00
Yamagishi Kazutoshi
5f7c6ae8d8
Fix width param name for Image Optimizer (#17952)
Image Optimizer only accepts the name of the width parameter as a `w`.

ref https://github.com/vercel/next.js/blob/v9.5.6-canary.3/packages/next/next-server/server/image-optimizer.ts#L71
2020-10-16 18:48:50 +00:00
JJ Kasper
98458246b6
v9.5.6-canary.3 2020-10-16 12:11:17 -05:00
Tim Neutkens
4f59209bf2
Update default configuration to match image optimization (#17943)
Co-authored-by: Steven <steven@ceriously.com>
2020-10-16 19:09:18 +02:00
Tim Neutkens
dfcf26732a
Only load plugins with @next prefix (#17945) 2020-10-16 18:38:36 +02:00
Tim Neutkens
cbbf9a720e
Add missing next/image package file (#17940) 2020-10-16 14:40:05 +02: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
JJ Kasper
f0ead09421
Fix initialRevalidateSeconds manifest field with i18n (#17926)
This makes sure the correct `initialRevalidateSeconds` field is populated in the `prerender-manifest` for non-dynamic SSG pages since they will be inserted into the `initialPageRevalidationMap` under their locale prefixed variant with `i18n` enabled

x-ref: https://github.com/vercel/next.js/pull/17370
2020-10-16 09:27:34 +00:00
Joe Haddad
75f75f33ba
Call Web Vitals reporting at correct time (#17933)
This PR adjust the Web Vitals reporting to be called *after* rendering occurs. It used to work like this, but React's render method is no longer synchronous—so we have to do it in an effect.

Existing tests should cover this code path, and IMO it's unfeasible to test that it's invoked _after_ hydration.

Also removed the `&& ST` condition which is not relevant to Web Vitals.
2020-10-16 08:27:50 +00:00
JJ Kasper
4b126cc336
Ensure i18n support with AMP (#17923)
* Ensure i18n support with AMP

* Fix type error

* Update size-limit
2020-10-15 18:00:08 -05:00
JJ Kasper
2a94ae037a
Add support for returning 404 from getStaticProps (#17755) 2020-10-15 23:55:38 +02:00
JJ Kasper
6ec36595e3
v9.5.6-canary.2 2020-10-15 13:29:44 -05:00
JJ Kasper
acd44c5b38
Add i18n items to routes manifest (#17893)
This adds the i18n config items to the routes-manifest so that they can accessed in the builder. This doesn't increment the routes-manifest version as existing value shapes haven't been modified and an additional non-breaking value is being added

x-ref: https://github.com/vercel/next.js/pull/17370
2020-10-15 18:21:30 +00:00
Tim Neutkens
b14331c58b v9.5.6-canary.1 2020-10-15 17:05:41 +02:00
Slawek Kolodziej
4238878c17
Make sure that params are properly passed to hybrid amp pages (#17461)
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-10-15 16:03:02 +02:00
JJ Kasper
e554a1fbb9
Add locale prop for transitioning locales client side (#17898)
This adds the `locale` prop for `next/link` to allow transitioning between locales client-side and also allows passing the locale to `router.push/replace` via the transition options similar to `shallow` e.g. `router.push('/another', '/another, { locale: 'nl' })`

x-ref: https://github.com/vercel/next.js/pull/17370
2020-10-15 08:58:26 +00:00
JJ Kasper
245499a05a
Handle preferring default locale over accept-lang preferred locale (#17883)
This updates to set the `NEXT_LOCALE` cookie to the default locale when the user prefers a different locale from the default in their `accept-language` header but visits the default locale path e.g. `/en-US` with a `accept-language` preferred header of `nl` will set the `NEXT_LOCALE=en-US` header and then redirect to `/`

x-ref: https://github.com/vercel/next.js/pull/17370
2020-10-14 21:02:38 +00:00
Tim Neutkens
7cf7c2f1c1 v9.5.6-canary.0 2020-10-14 14:03:28 +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
Simone Corsi
fad07cc09a
chore(collect-plugins.ts): removes duplicated entries (#17441) 2020-10-14 11:57:35 +02:00
Alex Castle
87175fe9df
Image component foundation (#17343)
Co-authored-by: Tim Neutkens <timneutkens@me.com>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2020-10-14 11:57:10 +02:00
JJ Kasper
9a5a1525bc
Update redirect handling for locale domains (#17856)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-10-14 11:56:58 +02:00
Jan Potoms
9300151118
Allow pages to be async modules to enable top-level-await (#17590)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-10-14 11:55:42 +02:00
Prateek Bhatnagar
71d798ce88
Font optimization for webpack 5 (#17450)
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2020-10-12 20:58:09 +02:00
JJ Kasper
854a84937c
Fix a couple i18n cases (#17805)
While working on https://github.com/vercel/next.js/pull/17755 noticed a couple of cases that needed fixing and broke them out to this PR to make that one easier to review. One fix is for `ssgCacheKey` where it wasn't having the `locale` prefix stripped correctly due to the locales no longer being populated under the server instances `renderOpts` and the second fix is for the `asPath` not being set to `/` when the `locale` is the only part in the URL e.g. `/en` became an empty string `""`

x-ref: https://github.com/vercel/next.js/pull/17370
2020-10-12 10:05:47 +00:00
JJ Kasper
1eeac4f99b
Make sure locale detecting is case-insensitive (#17757)
Follow-up to https://github.com/vercel/next.js/pull/17370 this makes sure the locale detection is case-insensitive.
2020-10-11 20:40:47 +00:00
JJ Kasper
5cab03fef0
Add handling for domain to locale mapping (#17771)
Follow-up to https://github.com/vercel/next.js/pull/17370 this adds mapping of locales to domains and handles default locales for specific domains also allowing specifying which locales can be visited for each domain. 

This PR also updates to output all statically generated pages under the locale prefix to make it easier to locate/lookup and to not redirect to the default locale prefixed path when no `accept-language` header is provided.
2020-10-10 10:22:45 +00:00
JJ Kasper
e334c4ece8
v9.5.5 2020-10-09 19:19:45 -05:00
JJ Kasper
5e85709786
v9.5.5-canary.1 2020-10-09 15:49:32 -05:00
JJ Kasper
2170dfd1e3
Update to generate auto static pages with all locales (#17730)
Follow-up PR to #17370 this adds generating auto-export, non-dynamic SSG, and fallback pages with all locales. Dynamic SSG pages still control which locales the pages are generated with using `getStaticPaths`. To further control which locales non-dynamic SSG pages will be prerendered with a follow-up PR adding handling for 404 behavior from `getStaticProps` will be needed. 

x-ref: https://github.com/vercel/next.js/issues/17110
2020-10-09 09:13:05 +00:00
JJ Kasper
62b9183e89
v9.5.5-canary.0 2020-10-08 14:51:32 -05:00
JJ Kasper
ec2ffb4244
Handle css-loader file resolving change (#17724)
This is a follow-up to https://github.com/vercel/next.js/pull/16973 which adds handling for the breaking change in the latest version of css-loader that causes unresolved file references in `url` or `import` to cause the build to fail. This fixes it by adding our own resolve checking and when it fails disabling the `css-loader`'s handling of it. 

Fixes: https://github.com/vercel/next.js/issues/17701
2020-10-08 18:45:39 +00:00
JJ Kasper
bbc1a21c74
Update to have default locale matched on root (#17669)
Follow-up PR to https://github.com/vercel/next.js/pull/17370 when the path is not prefixed with a locale and the default locale is the detected locale it doesn't redirect to locale prefixed variant. If the default locale path is visited and the default locale is visited this also redirects to the root removing the un-necessary locale in the URL. 

This also exposes the `defaultLocale` on the router since the RFC mentions `Setting a defaultLocale is required in every i18n library so it'd be useful for Next.js to provide it to the application.` although doesn't explicitly spec where we want to expose it. If we want to expose it differently this can be updated.
2020-10-08 11:12:17 +00: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
JJ Kasper
6588108150
v9.5.4 2020-10-07 13:56:56 -05:00
JJ Kasper
7108567b06
v9.5.4-canary.25 2020-10-07 12:29:46 -05:00
Joe Haddad
241f38eaa8
v9.5.4-canary.24 2020-10-06 09:48:39 -04:00
JJ Kasper
04234cc312
Update to use hasNextSupport for custom-routes in next export check (#17630)
Follow-up to https://github.com/vercel/next.js/pull/17538 per https://github.com/vercel/next.js/pull/17538#discussion_r499647323 this updates the check to use the existing `hasNextSupport` export instead of checking the environment variable directly
2020-10-05 15:26:11 +00:00
JJ Kasper
b42be17593
Normalize optional catch-all fallback: true page params (#17551)
This makes sure to normalize the params for optional catch-all routes on Vercel since for `fallback: true` pages the `[[...paramName]]` value will be provided for the undefined/root param which needs to be normalized. 

Tests have been added in https://github.com/vercel/vercel/pull/5247 and were manually tested with the changes in this PR with https://github.com/ijjk/next-update-loader

Fixes: https://github.com/vercel/next.js/issues/17220
x-ref: https://github.com/vercel/vercel/pull/5247
2020-10-05 07:34:50 +00:00
JJ Kasper
782b7e48ec
Add warning when exporting with custom routes (#17538)
This adds a warning when `next export` and custom routes are defined  outside of a platform that supports them since they won't be applied anymore.
2020-10-05 07:11:06 +00:00
JJ Kasper
91b5390617
Remove left-over api-utils method (#17595)
Noticed this method was left-over from previous query handling logic in `api-utils` while working on https://github.com/vercel/next.js/pull/17370 so this removes the extra code which should be safe since `api-utils` is an internal file that shouldn't be relied on externally.
2020-10-04 19:16:30 +00:00
Joe Haddad
c731c63631
v9.5.4-canary.23 2020-09-28 17:41:15 -07:00
JJ Kasper
f7f376f91e
Ensure optional-chaining/nullish coalescing is included (#17429) 2020-09-28 16:47:05 -07:00
JJ Kasper
489b13d00e
Fix empty title in head (#17430)
This handles the case where the children on a head element are undefined and not a string or an array of strings. This doesn't currently handle sub-children on head elements so additional handling will be needed if this is a feature we would like to support although can be discussed/investigated separately from this fix. 

Fixes: https://github.com/vercel/next.js/issues/17364  
Fixes: https://github.com/vercel/next.js/issues/6388
Closes: https://github.com/vercel/next.js/pull/16751
2020-09-28 23:12:07 +00:00
JJ Kasper
8eccecb35e
v9.5.4-canary.22 2020-09-25 13:16:35 -05:00
JJ Kasper
ad22e77309
Expose dotenv loading under separate package (#17152)
* Expose dotenv loading under separate package

* Update pre-compiled

* Rename package to @next/env

* Update lint ignores

* Update package.json

Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-09-25 13:14:28 -05:00
JJ Kasper
a3b9d8670a
Remove extra check in config loading (#17336)
Noticed while adding config checks for a new config that the `basePath` checks were wrapped in a `result.experimental` check and even though this should always be true from the default experimental value being an object the `basePath` checks shouldn't be wrapped in this check since it isn't experimental anymore.
2020-09-25 02:29:13 +00:00
Joe Haddad
47b7e0b318
v9.5.4-canary.21 2020-09-24 02:17:53 -04:00
Joe Haddad
c351f6154b
Improve server performance by skipping decode/re-encode (#17323)
Prior to this pull request, Next.js would immediately decode all URLs sent to its server (via `path-match`).

This was rarely needed, and Next.js would typically re-encode the incoming request right away (see all the `encodeURIComponent`s removed in PR diff). This adds unnecessary performance overhead.

Long term, this will also help prevent weird encoding edge-cases like #10004, #10022, #11371, et al.

---

No new tests are necessary for this change because we've extensively tested these edge cases with existing tests.
One test was updated to reflect that we skip decoding in a 404 scenario.

Let's see if all the existing tests pass!
2020-09-24 06:05:40 +00:00
Yuji Sugiura
4adf48b6cc
Fix export-cli progress label default value (#17106)
This PR fixes `info  - undefined (N/N)` log for `export` cli.

![image](https://user-images.githubusercontent.com/6259812/93186247-5d801500-f779-11ea-89ec-e20939d7b7c1.png)

Default parameter `label` for `createProgress()` was always ignored by `${Log.prefixes.info} undefined` 😅 .
2020-09-21 16:09:14 +00:00
Joe Haddad
63fee0f30c
v9.5.4-canary.20 2020-09-15 15:32:27 -04:00
JJ Kasper
2cf1d1c191
Separate resolved asPath from resolved URL for GSSP (#17121)
This makes sure we have the correct `asPath` value to prevent breaking hydration for `getServerSideProps` pages and doesn't re-use the `resolvedUrl` value for the `asPath` and instead creates a separate `resolvedAsPath` value that only removes the `_next/data` prefix from the path. Additional tests have been added in the `getServerSideProps` suite to ensure correct `asPath` with rewrites. 

Fixes: https://github.com/vercel/next.js/issues/17113
2020-09-15 19:19:07 +00:00
Joe Haddad
6a4c256491
v9.5.4-canary.19 2020-09-14 23:37:08 -04:00
JJ Kasper
a4c97c5c4a
Update webpack 5 resolving (#17095)
On the latest beta of webpack 5 resolving fails with the below error and according to https://github.com/webpack/webpack/issues/11467 is due to the imports in this module not being fully specified. This adds the config mentioned in the thread to correct the resolving for this module. 

```sh
Failed to compile.
--
16:33:50.046 | ModuleNotFoundError: Module not found: Error: Can't resolve './assertThisInitialized' in '/vercel/f03cc85/node_modules/@babel/runtime/helpers/esm'
16:33:50.046 | > Build error occurred
16:33:50.047 | Error: > Build failed because of webpack errors
16:33:50.047 | at build (/vercel/f03cc85/node_modules/next/dist/build/index.js:15:918)
16:33:50.099 | error Command failed with exit code 1.
```
2020-09-15 03:27:43 +00:00
Joe Haddad
0c1ebb4d3a
v9.5.4-canary.18 2020-09-14 21:04:10 -04:00
JJ Kasper
62cbbf525c
Fix API page check during SSG page collecting (#17092)
Fixes SSG pages that start with `/api` not being detected as SSG pages. This also adds tests to ensure this is working correctly in the `prerender` suite.

x-ref: https://github.com/vercel/next.js/issues/17091
2020-09-15 01:03:43 +00:00
JJ Kasper
d3f4a4cb2a
Provide resolvedUrl to getServerSideProps (#17082)
This continues off of https://github.com/vercel/next.js/pull/17081 and provides this normalized `asPath` value in the context provided to `getServerSideProps` to provide the consistent value since the request URL can vary between direct visit and client transition and the alternative requires building the URL each time manually. 

Kept this change separate from https://github.com/vercel/next.js/pull/17081 since this is addressing a separate issue and allows discussion separately. 

Closes: https://github.com/vercel/next.js/issues/16407
2020-09-14 21:01:04 +00:00
JJ Kasper
71a0181572
v9.5.4-canary.17 2020-09-14 14:47:53 -05:00
Joe Haddad
49a59b1ad2
Polyfill missing std lib fns for module browsers (#17083) 2020-09-14 15:25:30 -04:00
JJ Kasper
7203f50091
v9.5.4-canary.16 2020-09-14 12:15:33 -05:00
JJ Kasper
94a5bd6109
Normalize asPath for GS(S)P pages (#17081)
This normalizes the `asPath` for `getServerSideProps` and `getStaticProps` pages to ensure it matches the value that would show on the client instead of a) the output pathname when revalidating or generating a fallback or b) the `_next/data` URL on client transition. 

Fixes: https://github.com/vercel/next.js/issues/16542
2020-09-14 16:48:04 +00:00
Jens Meindertsma
80000f4238
[Fix] webpack@5.0.0-beta.30: Invalid configuration (#17045)
Earlier today #17038 was merged which I opened to fix a problem when using `webpack@5.0.0-beta.30` with Next.js using the new Webpack 5 support. In that PR, the only change was the renaming of a configuration key. I later discovered that the change on the Webpack side was different than I initially thought, and this meant that the fix I submittted to Next.js didn't work.

This PR intends to fix the remaining problems. Webpack 5 now accepts a `environment` key that can be used to configure the target output. Previously, this was known as `ecmaVersion` and accepted a number. Now, `environment` accepts a configuration object with individual options. I've configured this in such a way where it resembles an ES5 environment:
```js
environment: {
   arrowFunction: false,
   bigIntLiteral: false,
   const: false,
   destructuring: false,
   dynamicImport: false,
   forOf: false,
   module: false,
}
```
2020-09-14 13:21:17 +00:00
Joe Haddad
1d30f2179f
v9.5.4-canary.15 2020-09-13 23:39:22 -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
Joe Haddad
9b22dc4660
Improve custom document error message (#17048) 2020-09-12 18:57:07 +00:00
Tim Neutkens
d113c640b3 v9.5.4-canary.14 2020-09-12 16:16:28 +02:00
Jens Meindertsma
4af5032e77
Fix Webpack 5 configuration for v5.0.0-beta.30 (#17038)
This PR fixes #17035. As described in the issue, there was a breaking change in `webpack@5.0.0-beta.30`: `output.ecmaVersion` was replaced by `output.environment`. This meant Next.js apps using this `webpack` version would break. This PR updates the relevant Webpack config.

I think this will break any apps that are still using `webpack@5.0.0-beta.29`, but I don't know whether that is a problem as this is a beta feature. If it is, I'd love it if someone could let me know how to detect beta versions in the code so I can make it backwards-compatible.
2020-09-12 13:23:55 +00:00
Joe Haddad
4c3631402f
v9.5.4-canary.13 2020-09-12 02:37:04 -04:00
Markus Lautenbach
76e86e0fba
Remove false positive in circular structure detection (#16380)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-09-12 02:36:29 -04: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
Joe Haddad
310863e86f
v9.5.4-canary.12 2020-09-11 14:27:49 -04: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
a7a6187193
v9.5.4-canary.11 2020-09-10 16:06:51 -04:00
JJ Kasper
47d983f71f
Add error when href interpolation fails (#16946)
This adds an error when interpolation fails to make sure invalid `href`s aren't accidentally used and an invalid URL is built. 

Closes: https://github.com/vercel/next.js/issues/16944
2020-09-10 20:05:02 +00:00
Joe Haddad
c12afa066e
v9.5.4-canary.10 2020-09-10 13:50:52 -04:00
Joe Haddad
1ea6745106
Importing CSS from Third Party React Components (#16993) 2020-09-10 13:45:30 -04:00
Jan Potoms
5aed1d2e35
Correct query behavior for falsey values to pre 9.5.1 behavior (#16608)
Fixes https://github.com/vercel/next.js/issues/16147
2020-09-10 15:12:37 +00:00
Joe Haddad
ca986abd95
v9.5.4-canary.9 2020-09-10 00:05:18 -04:00
JJ Kasper
dcdcf49a87
Fix resolving href with a rewrite (#16975)
This makes sure we properly resolve a rewrite when only the `href` value is used. This was causing a full-reload and was missed in the existing test since we weren't making sure a full navigation didn't occur which has been added in this PR. 

Fixes: https://github.com/vercel/next.js/issues/16974
2020-09-10 00:55:22 +00:00
Joe Haddad
72b78f3be3
v9.5.4-canary.8 2020-09-09 19:44:04 -04:00
Joe Haddad
25cdaab297
Add Support for CSS Module Value Imports (#16973)
Fixes #10142
Fixes #11629
2020-09-09 23:29:37 +00:00
Joe Haddad
fceb566baf
v9.5.4-canary.7 2020-09-08 22:02:48 -04:00
Gerald Monaco
039eb817e1
Remove next-head-count (#16758)
Removes `next-head-count`, improving support for 3rd party libraries that insert or append new elements to `<head>`.

---

This is more or less what a solution with a `data-` attribute would look like, except that instead of directly searching for elements with that attribute, we serialize the elements expected in `<head>` and then find them/assume ownership of them during initialization (in a manner similar to React's reconciliation) based on their properties.

There are two main assumptions here:
1. Content is served with compression, so duplicate serialization of e.g. inline script or style tags doesn't have a meaningful impact. Storing a hash would be a potential optimization.
2. 3rd party libraries primarily only insert new, unique elements to head. Libraries trying to actively manage elements that overlap with those that Next.js claims ownership of will still be unsupported.

The reason for this roundabout approach is that I'd really like to avoid `data-` if possible, for maximum compatibility. Implicitly adding an attribute could be a breaking change for some class of tools or crawlers and makes it otherwise impossible to insert raw HTML into `<head>`. Adding an unexpected attribute is why the original `class="next-head"` approach was problematic in the first place!

That said, while I don't expect this to be more problematic than `next-head-count` (anything that would break in this new model also should have broken in the old model), if that does end up being the case, it might make sense to just bite the bullet.

Fixes #11012
Closes #16707

---

cc @Timer @timneutkens
2020-09-09 01:41:04 +00:00
JJ Kasper
f46ddc6933
Correct page path for GS(S)P data refreshing (#16939)
This makes sure to the page path is the expected version to trigger refreshing on the client and adds additional tests to make sure it is working properly with these page variants. 

Closes: https://github.com/vercel/next.js/issues/16938
2020-09-08 16:00:05 +00:00
Tim Neutkens
ac0c892acc v9.5.4-canary.6 2020-09-08 11:07:29 +02:00
JJ Kasper
bc80fb4fb2
Add handling for redirects from getStaticProps/getServerSideProps (#16642)
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2020-09-08 09:23:21 +02:00
Tim Neutkens
4c5c7cd2da v9.5.4-canary.5 2020-09-07 14:11:50 +02:00
JJ Kasper
f942d9e892
Include additional query values when interpolating href (#16878)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-09-07 13:09:02 +02:00
Tim Neutkens
f077a39e21
Divide export build output in 4 segments instead of showing it one by one (#16815) 2020-09-07 11:52:12 +02:00
JJ Kasper
a9c442f2df
v9.5.4-canary.4 2020-09-06 21:17:34 -05:00
JJ Kasper
489cad36bc
Fix href resolving with trailing slash enabled (#16873)
This makes sure to strip the trailing slash before attempting to resolve the `href` against pages/dynamic routes and adds tests ensuring the correct pages are resolved with `trailingSlash: true` enabled.

Fixes: https://github.com/vercel/next.js/issues/16872
2020-09-06 02:36:57 +00:00
Joe Haddad
ae7ae0ba68
v9.5.4-canary.3 2020-09-05 00:43:53 -04:00