Commit graph

2959 commits

Author SHA1 Message Date
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
JJ Kasper
6233ef7ed8
Correct client rewrite resolving with query (#16860)
This makes sure we only pass the as value's `pathname` instead of the full value so that we don't accidentally include `query` values while resolving the rewrites. This also adds tests to ensure the rewrites are resolved with the correct query values when only providing `href` and when manually mapping them with `href` and `as`

Fixes: https://github.com/vercel/next.js/issues/16825
2020-09-04 19:19:17 +00:00
JJ Kasper
f7435b4142
v9.5.4-canary.2 2020-09-04 10:37:58 -05:00
JJ Kasper
d97237a292
Fix invalid config export errors (#16834)
This corrects detecting of invalid page config exports and adds additional test cases for non-invalid config import/exports

Closes: https://github.com/vercel/next.js/issues/16775
2020-09-04 13:19:12 +00:00
Jan Potoms
764b194505
make parseRelativeUrl return a UrlObject (#16809)
Alternative to https://github.com/vercel/next.js/pull/16798
2020-09-03 18:26:52 +00:00
JJ Kasper
8426f13713
Update to show build indicator while re-fetching GS(S)P data in dev (#16789)
This is a follow-up to https://github.com/vercel/next.js/pull/16744 which shows the build/activity indicator while the data is being re-fetched to let the user know the re-fetching is occurring 

Closes: https://github.com/vercel/next.js/issues/16790
2020-09-03 12:27:08 +00:00
Joe Haddad
a555029a7b
v9.5.4-canary.1 2020-09-02 13:13:51 -04:00
JJ Kasper
4685332353
Add automatic reloading when editing GS(S)P methods (#16744)
This adds initial support for reloading the page when `getStaticProps`, `getStaticPaths`, or `getServerSideProps` were changed for a page by triggering a reload when the server output for a page has changed but the client output has not since these methods aren't included in the client output. 

Closes: https://github.com/vercel/next.js/issues/13949
2020-09-02 16:57:21 +00:00
JJ Kasper
f8d92a67f0
Ensure interpolating dynamic href values works correctly (#16774)
This corrects/makes sure interpolating dynamic route values for `href` works correctly. This provides an alternative approach to building the `href` value with `next/link` so that you don't need to worry about encoding the params manually. 

Closes: https://github.com/vercel/next.js/issues/13473
Closes: https://github.com/vercel/next.js/issues/14959
Closes: https://github.com/vercel/next.js/issues/16771
2020-09-02 16:23:26 +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
200c5ed806
v9.5.4-canary.0 2020-09-02 02:43:58 -04:00
Alex Castle
6874adbbb9
Make the image post-processor ignore SVG images (#16732)
This is a small change to the image post-processor logic. When it's looking for images to preload, it will now ignore SVGs, as these are rarely the relevant images for LCP.
2020-09-02 02:42:20 +00:00
Joe Haddad
b6df810406
v9.5.3 2020-09-01 16:21:49 -04:00
Joe Haddad
48ce4de0fd
v9.5.3-canary.27 2020-09-01 14:10:34 -04:00
Joe Haddad
e34e5e09d9
Revert #14580 (#16757) 2020-09-01 14:09:25 -04:00
Joe Haddad
1c45f70952
[test] Update hydration marker for React 17 (#16756) 2020-09-01 17:43:44 +00:00
Arthur
d20dbd6c2e
Export return type for GetStaticPaths (#16580)
* feat Export return type for GetStaticPaths

* add Duplicate generic

Co-authored-by: Luis Alvarez D <luis@vercel.com>
2020-09-01 12:20:17 -05:00
Joe Haddad
d59f12c416
v9.5.3-canary.26 2020-09-01 12:22:12 -04:00
JJ Kasper
91a50d3674
Revert "fix: Promise.prototype.finally is object (#16620)" (#16753)
This reverts commit 6926ab7b2a.
2020-09-01 12:06:51 -04:00
Joe Haddad
f921b4f476
Auto enable React's new JSX transform on 17.x (#16603) 2020-09-01 11:29:25 -04:00
TMQ
6926ab7b2a
fix: Promise.prototype.finally is object (#16620)
The [finally-polyfill](https://gist.github.com/developit/d970bac18430943e4b3392b029a2a96c)  did not expose any values.
![image](https://user-images.githubusercontent.com/15967520/91409583-2f916a00-e878-11ea-86d0-189966ceb83c.png)
2020-08-30 03:01:29 +00:00
Jan Potoms
20a4928b16
remove unneeded error (#16636)
This is not needed anymore since absolute urls are supported.
Also added an extra test for `mailto:` urls
2020-08-28 02:49:40 +00:00
Joe Haddad
f658b7641d
v9.5.3-canary.25 2020-08-26 22:18:49 -04:00
Joe Haddad
328abb72ca
Do not rely on cssText (#16611) 2020-08-26 22:13:28 -04:00
Joe Haddad
42e8dcf281
v9.5.3-canary.24 2020-08-26 12:35:37 -04:00
Joe Haddad
6895f9b0f4
Replace <link rel=stylesheet> client-side transitions with <style> tags (#16581)
This pull request replaces our client-side style transitions with `<style>` tags over async `<link rel=stylesheet>` tags. This should fix some edge cases users see with Chrome accidentally causing a FOUC.

This also removes the need to perform an async operation before starting the render, which should remove any perceivable navigation delay.

---

Fixes #16289
2020-08-26 16:34:53 +00:00
Joe Haddad
5fbe50c49a
v9.5.3-canary.23 2020-08-25 11:23:04 -04:00
Joe Haddad
52efe3364f
Reuse existing <link rel=stylesheet> on nav (#16537)
This pull request reuses existing `<link rel=stylesheet>` tags if their `href` matches instead of recreating it. This is in effort to fix an edge case where the browser will FOUC on the tag swap.

This behavior should be sufficiently covered by all the existing CSS cases, as misbehavior would result in the resulting CSS styles being incorrect.
2020-08-25 15:03:14 +00:00
Tim Neutkens
2e12e86d7c v9.5.3-canary.22 2020-08-25 12:03:06 +02:00
Jared Palmer
65648ece86
Update next-google-analytics to work with .env files (#16529)
Changes the name of the environment variable to `NEXT_PUBLIC_GA_TRACKING_ID`
2020-08-25 05:16:48 +00:00
Tim Neutkens
ed0820f763
Enable webpack 5 caching by default (#16531)
When the webpack 5 beta is used disk caching will be automatically enabled to improve incremental build performance.
2020-08-24 22:37:52 +00:00
Joe Haddad
885d145ff7
v9.5.3-canary.21 2020-08-24 01:23:01 -04:00
khades
1a7f3e5199
Store css file dependencies info for dynamic imports and apply it at SSR (#12843)
To prevent FOUC, discussed in #10557 i need to store information about css file dependencies for chunk. Right now current implementation just throws away everything but js.

Can there be more than one css file in chunk? If no - code will be simplified.

closes #10557
2020-08-24 05:20:11 +00:00
Luis Alvarez D
735aab6f03
Update Fast Refresh warning (#16496)
Fixes https://github.com/vercel/next.js/issues/16495

Terminal:

![image](https://user-images.githubusercontent.com/4278345/90984442-96421b00-e53a-11ea-9939-44b00cba87cf.png)

Browser: 

![image](https://user-images.githubusercontent.com/4278345/90984456-a9ed8180-e53a-11ea-86da-d9f28e9c2fdd.png)

The link https://nextjs.link/codemod-ndc used for the warning links to a currently 404 docs page, that will be available in the next stable release.

Tests not added as the warning has tests already.
2020-08-24 03:04:25 +00:00
JJ Kasper
a7550bf1d7
Add error when document component isn't rendered (#16459)
If a custom `_document` is added but not all of the expected document components are rendered it can cause unintended errors as noticed in https://github.com/vercel/next.js/issues/10219 so this adds detecting when one of the expected document components isn't rendered and shows an error. 

Closes: https://github.com/vercel/next.js/issues/10219
2020-08-24 02:42:51 +00:00
Tim Neutkens
f2ba97d866
Add webpack 5 cache invalidation (#16494)
Handles:

- Next.js version
- next.config.js `env` key
- `NEXT_PUBLIC_` prefixed environment variables
- next.config.js keys that affect performance

Ideally we don't invalidate the whole cache when `NEXT_PUBLIC_` / `env` key variables change, but this is just to initially make the caching reliable, this behavior is similar to the current webpack 4 behavior, so it can only be improved 👍
2020-08-24 01:37:48 +00:00
JJ Kasper
4e0b40145d
Correct initial fallback route param values (#16485)
This fixes invalid initial route params in development mode and serverless production mode. It also adds tests to ensure these values are correct in development, production, and serverless mode.

x-ref: https://github.com/vercel/next.js/pull/16084
Fixes: https://github.com/vercel/next.js/issues/16481
Fixes: https://github.com/vercel/next.js/issues/16482
2020-08-23 12:35:30 +00:00
JJ Kasper
32ee65efa1
Correct shallow routing behavior through history (#16477)
When navigating from a non-shallow page to a page that was navigated to shallowly in history it causes incorrect page data to be shown since an incorrect shallow navigation is done. We can only maintain shallow routing when the current page was navigated to shallowly and the page being navigated to in history was also navigated to shallowly. Additional tests to ensure this behavior is working has also been added. 

Closes: https://github.com/vercel/next.js/issues/7395
Closes: https://github.com/vercel/next.js/issues/14928
Fixes: https://github.com/vercel/next.js/issues/16028
2020-08-22 21:51:14 +00:00
Tim Neutkens
4a981428ae v9.5.3-canary.20 2020-08-22 15:00:30 +02:00
Tim Neutkens
d0754993fc
Add webpack 5 caching for css optimizer (#16467) 2020-08-22 14:16:13 +02:00
Joe Haddad
9acd001e09
Fix render cancel behavior (#16462)
This pull request correctly tracks render cancelation behavior. Prior to this PR, we'd have an unhandled rejection that left the app in a bad state and no routeChangeError event was fired.

---

Closes #16424
Fixes #16445
2020-08-22 11:47:21 +00:00
JJ Kasper
8a1c9937b6
Make sure to break rewrites chain when dynamic route matches (#16455)
This makes sure to also check if a dynamic route matched after resolving a rewrite on the client to match behavior on the server. It also adds tests for this behavior to ensure it is working properly. 

Fixes: https://github.com/vercel/next.js/issues/16454
2020-08-22 05:15:45 +00:00
Joe Haddad
42e1d5b5dc
v9.5.3-canary.19 2020-08-21 15:39:06 -04:00
JJ Kasper
78ef13914a
Fix un-transpiled client file with rewrites (#16453)
This fixes a client-side file not being transpiled correctly when rewrites are used. The cross browser tests have been updated to make sure there are rewrites so the related code is included and not dead-code eliminated'

Closes: https://github.com/vercel/next.js/issues/16440
2020-08-21 19:11:25 +00: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
JJ Kasper
450742274a
Fix optional catch-all /index revalidate params (#16451)
This corrects the case where `/index` is used during revalidation for an optional catch-all route and `index` is passed as a param even though it should be undefined. This also adds test cases to make sure the params are normalized correctly

Fixes: https://github.com/vercel/next.js/issues/16366
2020-08-21 18:13:24 +00:00
Joe Haddad
f5b6c8b7ab
v9.5.3-canary.18 2020-08-21 11:55:25 -04:00
Tim Neutkens
b6a2051d49
Solve last mini-css-plugin webpack 5 warning (#16447)
Adds missing context parameter
2020-08-21 15:33:57 +00:00
Joe Haddad
21566e3ae1
v9.5.3-canary.17 2020-08-20 15:42:07 -04:00
Janicklas Ralph
b1ea19a563
Eslint preload (#16199)
Eslint rule checks for missing preloads for stylesheets.

cc: @prateekbh
2020-08-20 19:34:12 +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
Joe Haddad
3f35b47344
v9.5.3-canary.16 2020-08-20 14:32:06 -04:00
Joe Haddad
ec7009620a
Ensure unknown static paths 404 for data request (#16401)
We were accidentally allowing data requests to be rendered unconditionally. Instead, we should also check them against the staticPaths result and 404 when appropriate.

---

Fixes #15383
2020-08-20 17:59:03 +00:00
Joe Haddad
fc98c13a2e
Warn on duplicate Sass deps (#16398)
Fixes #13953
2020-08-20 16:05:29 +00:00
JJ Kasper
3dec50001e
Add debug flag for extra build output (#16399)
This adds a `-d` or `--debug` flag which enables outputting additional build output information like the rewrites, redirects, and headers

Fixes #15281
2020-08-20 15:43:38 +00:00
Joe Haddad
c210154a28
v9.5.3-canary.15 2020-08-20 10:07:14 -04:00
Tim Neutkens
08ab3ac6c1
Fix mini-css-plugin webpack 5 deprecation warnings (#16390)
Solves the warnings coming from mini-css-plugin in webpack 5.

Fixes #15947
2020-08-20 13:56:52 +00:00
Stephen McMillen
3e81809df4
Correct comment on --help (#16391)
The comment on the two different `--help` sections matched, though their logic if what was handled was slightly different.

This adjusts the comments to clarify that difference.

This is completely unrelated to function, but I noticed it while reviewing code and thought I'd PR the fix.
2020-08-20 13:32:55 +00:00
Tim Neutkens
fa449d9ee5 v9.5.3-canary.14 2020-08-20 12:39:09 +02:00
Tim Neutkens
dab55b473c
Add serialization for mini-css-plugin webpack 5 caching (#16379) 2020-08-20 12:38:39 +02:00
Joe Haddad
8efc8be3e9
v9.5.3-canary.13 2020-08-20 00:27:15 -04:00
JJ Kasper
e1e6cfa189
Fix page checking failing with trailingSlash (#16362)
This fixes page checking failing due to the trailing slash being present which causes pages to proxied by a rewrite when they shouldn't be. This also adds additional tests to ensure rewriting to an external resource is working correctly with `trailingSlash: true`

Fixes: https://github.com/vercel/next.js/issues/15700
2020-08-20 04:05:38 +00:00
JJ Kasper
681fbbd04d
Fix basePath and public folder check ending routes early (#16356)
This corrects the basePath being required check for filesystem routes to not consider the public folder catch-all route since it always matches even if the public file isn't present and instead moves the basePath check inside of the public-folder catch-all. Tests already exist that catch this by adding a public folder to the existing `basepath` test suite

Fixes: https://github.com/vercel/next.js/issues/16332
Closes: https://github.com/vercel/next.js/pull/16350
2020-08-19 17:30:33 +00:00
matamatanot
0226e7872a
CNA: Add warning about permission (#14889)
close #14744

<img width="851" alt="screen_shot" src="https://user-images.githubusercontent.com/39780486/86603491-06bec800-bfdf-11ea-9928-ee85cbad86a7.png">


I have some concerns.

- `import { isWriteable } from '../next/build/is-writeable'` **not** from `create-next-app ` package.
- The warning sentence is from npm. Not for Next.js. I'm not a native English speaker. I'd like to know the natural expression for this.
2020-08-19 17:09:34 +00:00
Joe Haddad
1ad9cd90e5
Reduce filesystem lookups during bootup (#16354)
This PR reduces the total number of filesystem accesses we perform on CLI boot-up to make it happen faster.
2020-08-19 16:15:16 +00:00
JJ Kasper
67482914c6
Normalize request URL/asPath for fallback SSG pages (#16352)
This interpolates the dynamic values and rebuilds the request URL for fallback SSG pages since the proxy uses the output path for non-prerendered pages on Vercel which can cause inconsistent request URL/`asPath` values for SSG pages. This also adds tests to ensure the `asPath` is correctly updated

Fixes: https://github.com/vercel/next.js/issues/16269
2020-08-19 15:23:02 +00:00
Tim Neutkens
1388aa41d5 v9.5.3-canary.12 2020-08-19 13:54:28 +02:00
Joe Haddad
0a72d14deb
Make loadPage track success of script loading (#16334)
Prior to this PR, `loadPage` would call `loadScript` which would then report if the script failed to load.

This was problematic because `loadScript` notified a failure to load via `pageRegisterEvents`, which would not set the `pageCache` value for future requests.
This means a one-off promise rejection would happen, [in lieu of being] typically consumed within the client-side router, causing a server-side reload.

However, when `loadPage` was used independently (i.e. to preload pages), this promise rejection would be ignored as a preload failure.
When the real routing request comes in, the `loadPage` function skips its attempt to load the `<script>` because it was already in the DOM, and the router would stop functioning.

---

To fix this behavior, I've removed erroneous emits on `pageRegisterEvents` to only happen during the page registration lifecycle (its intended use).

The new behavior is that `loadScript` returns a `Promise` that `loadPage` can track, and if any of the page(s) scripts fail to load, we mark the entire page as errored in `pageCache`. This ensures future requests to `loadPage` will always immediately reject with a `PAGE_LOAD_ERROR`, which causes the server-side redirect at the appropriate point.

---

Fixes #16333
2020-08-19 11:41:01 +00:00
Joe Haddad
8ef253fd02
v9.5.3-canary.11 2020-08-19 02:35:22 -04:00
Joe Haddad
9746043354
Fix IE11 CSS Compatibility (#16336) 2020-08-19 02:34:44 -04:00
Tim Neutkens
25fa1653bd v9.5.3-canary.10 2020-08-18 23:16:35 +02:00
Alex Castle
7198cbe093
Add at attribute to image preload link (#16328)
Fixes a small error in the image preload post-processor. Adds a needed 'as' attribute to the link.
2020-08-18 21:14:42 +00:00
Joe Haddad
fe61948d4f
v9.5.3-canary.9 2020-08-18 14:54:27 -04:00
Joe Haddad
ec07bf12aa
Add <link> attributes in proper order (#16319)
1. `as` should be set before `rel` in case of `preload` or `prefetch`
2. `href` should be after `onload` and `onerror`
2020-08-18 18:53:04 +00:00
Joe Haddad
5f9755002d
Force browser to recompute layout on page nav (#16318)
This fixes an edge case where every dozen or so transitions you'll see a flash depending on what's happening on the main thread at the time.

I'm not sure it's possible to test for this case, so we'll just have to do more field testing with this.
2020-08-18 18:15:51 +00: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
Joe Haddad
f3d622ae47
v9.5.3-canary.8 2020-08-18 10:36:29 -04:00
Joe Haddad
8916e401a2
Fix old TypeScript version compatibility (#16288)
Fixes #16260
2020-08-18 14:06:10 +00:00
Tim Neutkens
0fbc9d23ef
Add experimental webpack 5 cache option (#16307)
Don't use this yet as it's still being developed. This is a first iteration that enables the webpack cache. There's still more to do here, for example if css modules are used there's currently a bug where webpack does not save the cache for browser compilation (impacting build performance). @sokra is going to look into that issue.
2020-08-18 15:46:55 +02:00
James Mosier
29ae372738
Allow React experimental version without warning (#16140)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-08-18 01:54:31 -04:00
Joe Haddad
a81ab3baee
v9.5.3-canary.7 2020-08-18 00:13:36 -04:00
JJ Kasper
9aadd1aa36
Fix forEach error in CSS commit in ie11 (#16282)
This fixes an error that was occurring in ie11 due to `forEach` being called on `querySelectorAll` before it was massaged to an array.

x-ref: https://github.com/vercel/next.js/pull/16126
Fixes #16283
2020-08-18 03:56:14 +00:00
Joe Haddad
d824189bcd
v9.5.3-canary.6 2020-08-17 19:03:17 -04:00
Joe Haddad
06d8acdfd0
Update stylesheets on page navigation (#16126)
This pull request adds a test case for the reproduction provided in #12445. This bug is specifically caused when loading the next page before navigation has actually occurred.

---

Fixes #12445
2020-08-17 21:20:05 +00:00
JJ Kasper
cdff5dfb75
v9.5.3-canary.5 2020-08-17 12:58:13 -05:00
Kevin Mårtensson
aa4b87e357
Handle cases where config is exported after its declaration (#16211)
AMP will still not work correctly when switching between non-AMP and AMP pages in development mode because of https://github.com/vercel/next.js/blob/canary/packages/next/build/babel/plugins/next-page-config.ts#L116-L120.

Fixes #15704.
2020-08-17 17:24:18 +00:00
JJ Kasper
f8534a6e62
Fix data URL with root-catchall and basePath (#16263)
This fixes the incorrect `/_next/data` URL being generated on client transition due to the `as` value passed to `getRouteInfo` having the `basePath` which is used while interpolating the values for dynamic routes, specifically root catch-all routes. A regression test has also been added to ensure this is working

Closes: https://github.com/vercel/next.js/issues/15747
2020-08-17 15:25:36 +00:00
Tim Neutkens
aa7659d807 v9.5.3-canary.4 2020-08-17 13:00:57 +02:00
Tim Neutkens
bbbbb3502d
Make css-minimizer compatible with webpack 5 (#16250) 2020-08-17 12:59:44 +02: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
cargallo
aec37fa8f1
how to bundle-analyzer with next-compose-plugins (#15370)
Added a section in readme with the proper use of the plugin with next-compose-plugins ^2.0.0, otherwise it doesn't work
2020-08-16 15:25:51 +00:00
Joe Haddad
2e8068fcbe
v9.5.3-canary.3 2020-08-14 16:24:19 -04:00
JJ Kasper
1b4d463cc8
Update rewrite params query appending (#16189)
This updates to not automatically append params to the query for rewrites if one or more of the params are already used in the destination's path. No other behavior is being changed and if the user still wants the params in the query after using them in the destination's path they can manually add them like with redirects.

Closes: https://github.com/vercel/next.js/issues/15626
2020-08-14 18:51:58 +00:00
Joe Haddad
9fcf39acd4
Refactor <Document> files (#16184)
Instead of reading the `BuildManifest` and passing it to `/_document`, it should be able to read it for itself.

---

Fixes #16182
2020-08-14 14:20:03 +00: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
32adc3a00d
v9.5.3-canary.2 2020-08-14 01:43:45 -04:00
Joe Haddad
3597978d7f
Modify low priority files in manifest (#16181)
This pull request edits the `BuildManifest` that is sent to `/_document` instead of modifying a single input array to decouple its implementation details.

Optimally, we'd eliminate the `files` key all together.

---

Related to #16182
2020-08-14 04:30:25 +00:00
Joe Haddad
4e813ae0c6
v9.5.3-canary.1 2020-08-13 18:49:35 -04:00
Joe Haddad
cb786ebd81
Share NEXT_DATA type instead of recreating it (#16174) 2020-08-13 22:19:06 +00:00
Joe Haddad
33176806f3
Remove unused dependency (#16168) 2020-08-13 13:40:08 -04:00
Joe Haddad
0e48ea3938
Convert next/client to TypeScript (#16167)
Fixes #16166
2020-08-13 13:39:33 -04:00
Joe Haddad
09afc376cd
Convert performance relayer to TypeScript (#16161)
Really basic one! Needed for `next/client`.
2020-08-13 15:20:29 +00:00
Joe Haddad
5b81531676
Reduce router code (#16159)
This reduces the code as suggested: https://github.com/vercel/next.js/pull/15231#discussion_r469691649.

Removes these bloated Babel helpers:

```diff
@@ -678,80 +678,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
 
       var _createClass = __webpack_require__("W8MJ");
 
-      function _createForOfIteratorHelper(o, allowArrayLike) {
-        var it;
-        if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
-          if (
-            Array.isArray(o) ||
-            (it = _unsupportedIterableToArray(o)) ||
-            (allowArrayLike && o && typeof o.length === "number")
-          ) {
-            if (it) o = it;
-            var i = 0;
-            var F = function F() {};
-            return {
-              s: F,
-              n: function n() {
-                if (i >= o.length) return { done: true };
-                return { done: false, value: o[i++] };
-              },
-              e: function e(_e) {
-                throw _e;
-              },
-              f: F
-            };
-          }
-          throw new TypeError(
-            "Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."
-          );
-        }
-        var normalCompletion = true,
-          didErr = false,
-          err;
-        return {
-          s: function s() {
-            it = o[Symbol.iterator]();
-          },
-          n: function n() {
-            var step = it.next();
-            normalCompletion = step.done;
-            return step;
-          },
-          e: function e(_e2) {
-            didErr = true;
-            err = _e2;
-          },
-          f: function f() {
-            try {
-              if (!normalCompletion && it["return"] != null) it["return"]();
-            } finally {
-              if (didErr) throw err;
-            }
-          }
-        };
-      }
-
-      function _unsupportedIterableToArray(o, minLen) {
-        if (!o) return;
-        if (typeof o === "string") return _arrayLikeToArray(o, minLen);
-        var n = Object.prototype.toString.call(o).slice(8, -1);
-        if (n === "Object" && o.constructor) n = o.constructor.name;
-        if (n === "Map" || n === "Set") return Array.from(o);
-        if (
-          n === "Arguments" ||
-          /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)
-        )
-          return _arrayLikeToArray(o, minLen);
-      }
-
-      function _arrayLikeToArray(arr, len) {
-        if (len == null || len > arr.length) len = arr.length;
-        for (var i = 0, arr2 = new Array(len); i < len; i++) {
-          arr2[i] = arr[i];
-        }
-        return arr2;
-      }
-
       exports.__esModule = true;
       exports.hasBasePath = hasBasePath;
       exports.addBasePath = addBasePath;
@@ -1864,28 +1790,16 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
               } // handle resolving href for dynamic routes
 
               if (!pages.includes(cleanPathname)) {
-                var _iterator = _createForOfIteratorHelper(pages),
-                  _step;
-
-                try {
-                  for (_iterator.s(); !(_step = _iterator.n()).done; ) {
-                    var page = _step.value;
-
-                    if (
-                      (0, _isDynamic.isDynamicRoute)(page) &&
-                      (0, _routeRegex.getRouteRegex)(page).re.test(
-                        cleanPathname
-                      )
-                    ) {
-                      parsedHref.pathname = addBasePath(page);
-                      break;
-                    }
+                // eslint-disable-next-line array-callback-return
+                pages.some(function(page) {
+                  if (
+                    (0, _isDynamic.isDynamicRoute)(page) &&
+                    (0, _routeRegex.getRouteRegex)(page).re.test(cleanPathname)
+                  ) {
+                    parsedHref.pathname = addBasePath(page);
+                    return true;
                   }
-                } catch (err) {
-                  _iterator.e(err);
-                } finally {
-                  _iterator.f();
-                }
+                });
               }
 
               return parsedHref;
@@ -2069,10 +1983,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                 }
 
                 if (cancelled) {
-                  var _err = new Error("Loading initial props cancelled");
-
-                  _err.cancelled = true;
-                  throw _err;
+                  var err = new Error("Loading initial props cancelled");
+                  err.cancelled = true;
+                  throw err;
                 }
 
                 return data;
```
2020-08-13 14:50:01 +00:00
Tim Neutkens
7b13205e7e v9.5.3-canary.0 2020-08-13 14:41:25 +02:00
JJ Kasper
8a489e24bc
Add initial handling for dynamic route href resolving and rewrites on the client (#15231)
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2020-08-13 14:39:36 +02:00
Joe Haddad
ff0571ae14
Remove unused router method (#16149)
This PR removes a legacy router method that was used for old-style HMR, now replaced by Fast Refresh.

This method was not public:
```tsx
export type NextRouter = BaseRouter &
  Pick<
    Router,
    | 'push'
    | 'replace'
    | 'reload'
    | 'back'
    | 'prefetch'
    | 'beforePopState'
    | 'events'
    | 'isFallback'
  >
```

Even if someone found this method, it's highly unlikely they could use it successfully—it required the full module object.
2020-08-13 05:43:13 +00:00
Joe Haddad
c7acd1187b
Dedupe ComponentRes type (#16148)
This PR dedupes the `ComponentRes` type to now align with the `loadPage` return type.
2020-08-13 05:24:57 +00:00
Joe Haddad
94a85cff12
Improve page loader types (#16145) 2020-08-13 00:01:15 -04:00
Joe Haddad
16e4f9e79e
Strongly type Head Manager (#16144) 2020-08-12 23:54:48 -04:00
Joe Haddad
9e65c6a958
Strongly type PageLoader (#16132)
Fixes #16131
2020-08-12 20:42:05 +00:00
Tim Neutkens
e72ac76422
Remove tslint disables (#16116)
We no longer use tslint so these comments don't do anything.
2020-08-12 14:39:07 +00:00
Tim Neutkens
16345f631e
Add codemod documentation (#16067)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-08-11 15:12:00 +02:00
Joe Haddad
07df897dad
v9.5.2 2020-08-10 19:17:42 -04:00
Joe Haddad
1bc63a379d
v9.5.2-canary.18 2020-08-10 18:45:23 -04:00
Joe Haddad
782d27e576
v9.5.2-canary.17 2020-08-10 16:49:03 -04:00
Yuhei Yasuda
052a9d2353
Don’t prevent the browser’s default behavior for Alt key (#16003)
In most browsers, clicking links with the Alt key has a special behavior, for example, Chrome downloads the target resource. As with other modifier keys, the router should stop the original navigation to avoid preventing the browser’s default behavior.

When users click a link while holding the Alt key together, the browsers behave as follows.

Windows 10:

| Browser    | Behavior                                    |
|:-----------|:--------------------------------------------|
| Chrome 84  | Download the target resource                |
| Firefox 79 | Prevent navigation and therefore do nothing |
| Edge 84    | Download the target resource                |
| IE 11      | No impact                                   |

macOS Catalina:

| Browser    | Behavior                                    |
|:-----------|:--------------------------------------------|
| Chrome 84  | Download the target resource                |
| Firefox 79 | Prevent navigation and therefore do nothing |
| Safari 13  | Download the target resource                |
2020-08-10 20:32:47 +00:00
Joe Haddad
378f092aaf
v9.5.2-canary.16 2020-08-10 15:46:43 -04:00
Prateek Bhatnagar
2ddfd84411
Improvements - Font optimizations (#16031)
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-08-10 14:06:38 -04:00
Joe Haddad
bd70354394
v9.5.2-canary.15 2020-08-10 13:55:06 -04:00
Joe Haddad
6d71eef518
Do not assign to readonly property in Safari (#16051) 2020-08-10 13:15:37 -04:00
Joe Haddad
4a04212d6b
v9.5.2-canary.14 2020-08-10 12:28:49 -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
1398aebf7b v9.5.2-canary.13 2020-08-10 16:29:13 +02:00
Tim Neutkens
7acfd7eea7
Add files array to @next/codemod (#16049) 2020-08-10 16:24:01 +02:00
Joe Haddad
06d0ba4199
Fix typos in @next/codemod CLI (#16042) 2020-08-10 15:09:47 +02:00
Tim Neutkens
e8e59a175e v9.5.2-canary.12 2020-08-10 14:35:25 +02: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
281318d50e v9.5.2-canary.11 2020-08-10 11:49:45 +02:00
Tim Neutkens
1738c02ae0 Update version of next-codemod to prepare for publishing 2020-08-10 11:49:13 +02:00
Tim Neutkens
37d2d15b6e
Resolve aliases modules (#16033)
Co-authored-by: Kristoffer K. <merceyz@users.noreply.github.com>
2020-08-10 11:45:10 +02:00
Tim Neutkens
62031ff24f
Move next-codemod to Next.js monorepo (#15536) 2020-08-10 11:14:53 +02:00
Tim Neutkens
f4433ceaa2 v9.5.2-canary.10 2020-08-10 09:50:15 +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
Amirali Esmaeili
4b6e9a45a3
Fix amphtml link rel not respecting basePath (#15949)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-08-08 15:15:00 +02: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
Tim Neutkens
6f7dfe111c
Make helpers.ts compatible with ie11 (#15973)
Fixes #15680

This does not solve the issue that an error triggered will fail on shadowroots being created, however it does fix the general failure

Closes https://github.com/vercel/next.js/pull/15825
2020-08-07 14:13:24 +00:00
Tim Neutkens
7fc92a6c78 v9.5.2-canary.9 2020-08-07 09:39:18 +02:00
JJ Kasper
b1ef76df31
Fix asPath normalizing for non-dynamic pages (#15960) 2020-08-07 09:01:34 +02:00
Markoz Peña
6375026a41
Added Friendly error for res.redirect 🐝 (#15844)
## Which solves this PR

 Displaying a friendly error, when the user is only passing `statusOrUrl`(type number) and the second argument `url` is ignored.

**Example**

`res.redirect(307);` // Show friendly error

Closes: https://github.com/vercel/next.js/issues/15594
x-ref: https://github.com/vercel/next.js/pull/15603
2020-08-06 22:53:09 +00:00
Tom Dohnal
eb4be226fd
notify component when route hash changes (#13894)
This resolves https://github.com/vercel/next.js/issues/13659
2020-08-06 22:04:47 +00:00
Evil Rabbit
8fed0c3ab5
Improve Vercel's badge (#15946) 2020-08-06 12:35:36 -04:00
Jan Potoms
cbfb8cbcc7
Remove querystring from the client (#15378) 2020-08-06 12:32:58 -04:00
Joe Haddad
882288b532
Warn when Fast Refresh is disabled (React <16.10) (#15931) 2020-08-06 10:41:11 -04:00
Joe Haddad
2d42b8e076
Delay server start message until it's listening (#15929)
Fixes #15928

---

This would cause us to print the message too early and open the browser to a server that wasn't started yet. This waits until we're listening, but before the app is ready fully.
2020-08-06 06:47:01 +00:00
Joe Haddad
0923ee6db4
v9.5.2-canary.8 2020-08-05 16:46:28 -04:00
Joris
0fd1958ae4
Disallow re-export all exports from Next.js pages (#14325)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-08-05 16:21:40 -04:00
Joe Haddad
3c04111c9c
Adjust overlay modal padding on mobile (#15915)
This PR reduces padding on all [iPhone models](https://developer.apple.com/library/archive/documentation/DeviceInformation/Reference/iOSDeviceCompatibility/Displays/Displays.html) to make the error easier to see when you have the debugger open.

Before
![image](https://user-images.githubusercontent.com/616428/89454188-5a334b80-d72e-11ea-8e0b-ce392615d814.png)


After
![image](https://user-images.githubusercontent.com/616428/89454129-40920400-d72e-11ea-903d-8a8178da2966.png)

---

Fixes #14702
Closes #14767
2020-08-05 19:51:46 +00:00
JJ Kasper
7d7a8fc300
Normalize serverless asPath value (#15914)
Since we now use query parameters to pass dynamic route params while routing on Vercel, this makes sure we normalize the request URL before populating the `asPath`

Fixes: https://github.com/vercel/next.js/issues/15879
2020-08-05 19:29:38 +00: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
Joe Haddad
46488fbcc6
v9.5.2-canary.7 2020-08-05 14:25:00 -04:00
Jan Potoms
5dbe0d0215
Allow absolute urls in router and Link (#15792)
Fixes https://github.com/vercel/next.js/issues/15639
Fixes https://github.com/vercel/next.js/issues/15820

To Do:
- [x] Doesn't work with `basePath` yet
2020-08-05 18:12:17 +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
Joe Haddad
fce1830d35
v9.5.2-canary.6 2020-08-04 22:28:36 -04:00
Joe Haddad
754ec6642a
Run Fast Refresh Loader in Babel Loader (#15851)
Next.js plugins like `@next/mdx` inject additional webpack loaders to compile files, but they omit the necessary loader for Fast Refresh to work.

Instead of making these files deopt out of Fast Refresh, we can automatically detect and inject the loader in these cases.

Fixes #13574
2020-08-04 21:24:56 +00:00
Joe Haddad
1968f7f552
v9.5.2-canary.5 2020-08-04 13:52:26 -04:00
Jan Potoms
92304404a4
Disallow basePath: false for internal routes (#15837) 2020-08-04 17:50:09 +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
Joe Haddad
e818389999
Add support for fallback: 'blocking' (#15672)
By popular request, this pull request adds support for returning `fallback: 'blocking'` from `getStaticPaths`.

This new mode will cause unknown paths to be rendered on-demand ("SSR") without the static (placeholder) fallback.

This feature is **currently experimental and should not be used in production yet**. It's currently flagged behind `unstable_`:

```
fallback: 'unstable_blocking'
```

TODO:

- [x] Next.js tests
- [ ] Add Vercel support
- [ ] Vercel tests

---

Fixes #15637
2020-08-04 15:10:31 +00:00
Tim Neutkens
668cc6a6f1 v9.5.2-canary.4 2020-08-04 12:35:24 +02:00
Darsh Patel
96a66c4bd3
incremental static generation and regeneration support in build manifest (#14365)
The icon is just something I thought might look good, can certainly be changed.
I've currently added incremental static generation support

Edit: Updated screenshot after 8037981
![Screenshot 2020-08-04 at 1 51 14 PM](https://user-images.githubusercontent.com/11258286/89270960-afe9f400-d659-11ea-8f18-197dc53b8beb.png)





Fixes: #14204
2020-08-04 08:42:18 +00:00
Jonathan G
6c59cbb46a
[Feature] Progress bar for static build (#15297)
Co-authored-by: Tim Neutkens <timneutkens@me.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2020-08-04 09:58:23 +02: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
8285df5ed2
v9.5.2-canary.3 2020-08-04 00:08:28 -04:00
Joe Haddad
48ca2f2cc5
Fix CSS grid-column shorthand syntax (#15848) 2020-08-04 00:08:09 -04:00
Tim Neutkens
e8c3190255
Support persisting the dev cache buster (#15827)
Same as #15483 but couldn't push to it

---

Closes #15483
Fixes #15828
2020-08-03 14:22:55 +00:00
Jan Potoms
b87e4989e2
Rename exportTrailingSlash to existing trailingSlash property (#15768)
In terms of url rewriting, `trailingSlash` supports everything `exportTrailingSlash` does. We can just share all other code paths and deprecate `exportTrailingSlash`.

This PR shows a deprecation warning when `exportTrailingSlash` is used.

Also fixes https://github.com/vercel/next.js/issues/15774

We can update the tests now or later. (I kept them the same to prove it's non-breaking)

To do:
- [x] Do we want to keep this? => nope 841d4efc51/packages/next/next-server/lib/router/router.ts (L329)
- [x] I kept `exportTrailingSlash` here. Do we want to rename that as well? => nope 2d9d649d49/packages/next/build/index.ts (L959)
2020-08-03 14:03:11 +00: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
210a6980d2
Solve large portion of webpack 5 deprecation warnings (#15806)
- Using `namedChunks` where possible, this will also allow for faster access to the chunks as we no longer have to look them up like we did before using `find`
- Using the new asset hooks introduced in the latest webpack beta
- Using the new externals function signature
2020-08-03 12:26:23 +00:00
Joe Haddad
ed0a47b110
v9.5.2-canary.2 2020-08-03 01:47:42 -04:00
JJ Kasper
9dd974dfca
Fix dotenv loading with cascading values (#15799)
Adds additional test cases for cascading env values and corrects behavior

Fixes: https://github.com/vercel/next.js/issues/15744
2020-08-02 20:15:11 +00:00
Jan Potoms
841d4efc51
Improve router types (#15775) 2020-08-01 18:13:03 +00:00
Jan Potoms
1b033423dc
Fix asPath of rewrite without basePath (#15760)
Fixes https://github.com/vercel/next.js/issues/15755
2020-08-01 11:51:47 +00:00
Joe Haddad
6366727550
v9.5.2-canary.1 2020-07-31 13:31:49 -04:00
Jan Potoms
ad5c736798
Remove unused error (#15748)
Irrelevant since https://github.com/vercel/next.js/pull/15379
2020-07-31 17:29:09 +00:00
Rafau
bcd1ba622e
[webpack5] Complile for ES5 (#15708)
I think this is necessary for IE11.

via [Webpack docs](https://webpack.js.org/migrate/5/#turn-off-es2015-syntax-in-runtime-code-if-necessary)


> By default, webpack's runtime code uses ES2015 syntax to build smaller bundles. If your build targets environments that don't support this syntax (like IE11), you'll need to set output.ecmaVersion: 5 to revert to ES5 syntax.


Thank you
2020-07-31 08:50:54 +00:00
Jan Potoms
c9e379c3bf
Fix wrong asPath on 404 (#15728)
Caught this while reviewing router code for https://github.com/vercel/next.js/pull/15710
2020-07-31 06:38:39 +00:00
Joe Haddad
dcb69ee92f
Strictly type react-dev-overlay (#15669)
Fixes #15668
2020-07-30 06:55:23 +00:00
Arsalan Khattak
3caa996096
Error overlay should not be dismissable for a server error (#14011) 2020-07-30 00:57:29 -04:00
JJ Kasper
ce56b60166
Add additional pageProps check (#15667)
`pageProps` should always be defined to ensure everything is working as expected although to prevent a breaking change this adds an additional check before attempting to access `pageProps` before hydration. It also adds tests to prevent regressing on this

Closes: https://github.com/vercel/next.js/issues/15647
2020-07-30 04:47:20 +00:00
Joe Haddad
6a48e3de60
v9.5.2-canary.0 2020-07-29 23:53:24 -04:00
Joe Haddad
cac35c389a
Fix hot reloader edge case with broken webpack plugins (#15659) 2020-07-29 23:44:25 -04:00
Joe Haddad
6b0c4948f0
v9.5.1 2020-07-29 23:11:48 -04:00
Joe Haddad
662d84b95b
v9.5.1-canary.3 2020-07-29 22:36:18 -04:00
Joe Haddad
8f914a3bcb
Fix error overlay hotlinking (#15658)
This pull request:

1. Relocates tests to correct location
1. Tests more scenarios
1. Fixes a bug with anchors at the start of error message
1. Fixes react key warning error

Fixes #15599
2020-07-30 00:58:36 +00:00
Darsh Patel
c1e5b66cd7
Fix: space issue in error overlay and add tests (#15617) 2020-07-29 19:30:18 -04:00
Joe Haddad
3d98171dab
Test webpack 5 beta (#15645) 2020-07-29 19:19:32 -04:00
Joe Haddad
b748b5a443
v9.5.1-canary.2 2020-07-29 13:18:18 -04:00
Jan Potoms
80998a05f7
Don't use assetprefix on getServerSideProps and getStaticProps (#15634)
Strictly use `basePath` and not `assetPrefix` on `getStaticProps` and `getServerSideProps`

Fixes https://github.com/vercel/next.js/issues/15563
2020-07-29 16:51:51 +00:00