Commit graph

3307 commits

Author SHA1 Message Date
Tim Neutkens
36aeca8f04 v10.0.7-canary.0 2021-02-01 12:56:04 +01:00
Guy Bedford
d5a4dec042
fix: add declarations for compiled webpack and loader (#21741)
This should resolve the typing issues described in https://github.com/vercel/next.js/issues/21390 from the webpack inlining, by declaring `next/dist/compiled/webpack` in the main typing file as a source.
2021-02-01 11:27:41 +00:00
Rafael Bonalume Lebre
60e699555d
Fix #top anchor link scroll (#16638)
According to [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-href) the page must scroll to the top with both "#" and "#top" anchors.

<img width="675" alt="Screen Shot 2020-08-27 at 7 20 19 PM" src="https://user-images.githubusercontent.com/13899924/91500693-582a5b80-e89a-11ea-803f-4592d458baba.png">
2021-01-30 04:32:00 +00:00
Joe Haddad
5201cdbaea
v10.0.6 2021-01-29 15:21:46 -05:00
Joe Haddad
f8f2a173e3
v10.0.6-canary.12 2021-01-29 14:45:49 -05:00
Joe Haddad
558289247e
v10.0.6-canary.11 2021-01-29 11:36:36 -05:00
Janicklas Ralph
8f21c283b2
Experimental feature changes (#21646)
Adding test for experimental-serverless-trace + fix for the same
2021-01-29 13:53:07 +00:00
Tim Neutkens
08846cf8b5 v10.0.6-canary.10 2021-01-29 12:10:06 +01:00
Dale Bustad
652a1e8915
Improvements to webpack tracing, including hot-reload (#21652)
@timneutkens I think this is ready for a review.

I've made some changes to the original design that _seem_ to have paid off.  The parenting relationships for traces of normal builds are applied more uniformly, resulting in more intelligible traces:

<img width="900" alt="Screen Shot 2021-01-29 at 12 53 47 AM" src="https://user-images.githubusercontent.com/5016978/106253732-ba321880-61cc-11eb-98fd-d45af5078273.png">

Hot-reloading is surfaced now, too.  I will note, however, that we will want to dig in deeper and find out where the large portion of time at the beginning of hot-reload is spent.  Example:

<img width="894" alt="Screen Shot 2021-01-29 at 12 53 28 AM" src="https://user-images.githubusercontent.com/5016978/106253828-e057b880-61cc-11eb-967d-46eaff31ecef.png">

Where did those 180 ms go?  At the least, we can now track how long a hot-reload takes, and have a place to start with further investigation.
2021-01-29 10:32:26 +00:00
Lee Robinson
5a73859fe8
Update docs and Create Next App to use API Middlewares by default. (#21639) 2021-01-28 23:34:03 +00:00
JJ Kasper
e75f6119d8 v10.0.6-canary.9 2021-01-27 10:49:12 -06:00
JJ Kasper
87ed37d51c
Ensure prerender-manifest contains all i18n revalidate values (#21404)
This insures we add entries for each locale version of a non-dynamic SSG page since they can have unique revalidate values. This requires a version bump in the `prerender-manifest` since the static routes now contain additional values which need to be handled separately. 

Fixes: https://github.com/vercel/next.js/issues/21568
2021-01-27 11:24:00 +00:00
Joe Haddad
b785fbc5d1
chore: upgrade webpack5 (#21563) 2021-01-26 21:05:58 +00:00
Jaon
e1fe28c849
Fix and add test filterModuleRules for next-plugin-storybook (#17306)
I tried the preset provided at `packages/next-plugin-storybook` but it was raising error due to an [unsafe negation](https://eslint.org/docs/rules/no-unsafe-negation) in the `preset.js` file.

I added a test to show the error:
```
● next-plugin-storybook filterModuleRules › should filter module rules correctly

    TypeError: rule.test.test is not a function

      48 |       if (!rule.test instanceof RegExp) return true
      49 |       // use Next.js' built-in CSS
    > 50 |       if (rule.test.test('hello.css')) {
         |                     ^
      51 |         return false
      52 |       }
      53 |       // use next-babel-loader instead of storybook's babel-loader

      at filter (../packages/next-plugin-storybook/preset.js:50:21)
          at Array.filter (<anonymous>)
      at Object.filterModuleRules (../packages/next-plugin-storybook/preset.js:46:28)
      at Object.<anonymous> (unit/webpack-config-overrides.test.js:12:36)
```
2021-01-26 19:28:41 +00:00
Janicklas Ralph
dc2de37014
Font optimization - Pass nonce to inlined font definition (#21346) 2021-01-26 18:32:39 +00:00
Roko Bekavac
004ad62d6b
Allow undefined body sent to sendData() (#20981)
Co-authored-by: rokobekavac0 <roko.beakavac2003@gmail.com>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2021-01-26 10:24:48 -05:00
Andre Hsu
a47d47e07a
Change type of GetServerSidePropsContext.req.cookies the be the same as NextApiRequest.cookies (#21336)
The original type for `GetServerSidePropsContext.req.cookies` was introduced in #19724. In the PR, the test at `test/integration/typescript/test/index.test.js` expects req.cookies to always exist, so `req.cookies` will never be undefined.

I'm guessing that req.cookies is parsed using the same cookie middleware as `NextApiRequest`, in which case `req.cookies` should be `{ [key: string]: string }`, not `{ [key: string]: any }`.
2021-01-26 14:26:59 +00:00
Chulki Lee
f6cc0dedaa
Remove mkdirp (#21365)
Closes #17042

I removed mkdirp from package.json taskfil.js, and ran `yarn && ./check-pre-compiled.sh `. Please let me know if anything else is needed!

(Extracted from #20411)

Note that now compiled webpack has mkdirP function
2021-01-26 14:02:16 +00:00
youngvform
3368fdde48
Fix to parse REACT_EDITOR in env (#21331)
I made an issue #[21330](https://github.com/vercel/next.js/issues/21330).

I think this line 0bd175264b/packages/react-dev-overlay/src/internal/helpers/launchEditor.ts (L216) return string array and toLowerCase is undefined in string array so throw error.

I fixed it by referring to [launchEditor](7e4949a20f/packages/react-dev-utils/launchEditor.js) of create react app.
2021-01-26 12:08:06 +00:00
tarunama
b40fd6ce25
refactor: add types to name-default-components.ts (#21291)
- Add.type to variables and function, arguments
2021-01-26 11:43:52 +00:00
tarunama
c110e45b62
refactor: server/api-utils.ts (#21148)
- Add return type to function
- Add [isNotValidData](https://github.com/vercel/next.js/pull/21148/files#diff-64466461287cc1a70ce5597e3e1d18ac22755f9aeb7ff1865160a8c057540983R374) function for readability
2021-01-26 09:52:00 +00:00
kaykdm
47cb4cf850
Fix aspath for getInitialProps (#20572)
Fixes: https://github.com/vercel/next.js/issues/20370

> AsPath is incorrect on Server if you use rewrites and getInitialProps. On the server, asPath is the rewritten asPath while on the client asPath ist as given in the request URL.

The same issue was used to happen on `getServersideProps`, but it was fixed in this PR (https://github.com/vercel/next.js/pull/17121).
`getInitialProps` needs same fix except when the target is serverless, which has correct `asPath` value.

Additional tests have been added in the `getInitialProps` suite to ensure correct asPath with rewrites.
2021-01-25 18:26:32 +00:00
Joe Haddad
88b6ea416d
v10.0.6-canary.8 2021-01-25 12:59:39 -05:00
Janicklas Ralph
cf95146a51
Critical css fix (#21462)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2021-01-25 12:43:05 -05:00
Ryan
8798c40c96
Require only build directory to be writeable for build (#20977)
Allows building without permission to write to the application directory, useful for containers and sandboxes.
2021-01-25 12:09:22 -05:00
Joe Haddad
75c504708b
fix: upgrade pinned deps for tests (#21515) 2021-01-25 12:08:08 -05:00
Chulki Lee
fc34f89a80
Fix hostname message in dev/start (#20409) 2021-01-25 16:13:12 +01:00
Calmon Ribeiro
783b9d86ff
fix(next): respect extends in tsconfig with exclude and include (#16619) 2021-01-24 14:24:36 +01:00
kaykdm
a5b0094677
Fix shallow routing scroll (#21437)
This ensures that Next.js will not scroll to the top of the page in shallow routing.

Fixes: https://github.com/vercel/next.js/issues/21386
Fixes: https://github.com/vercel/next.js/issues/21366
2021-01-22 18:03:29 +00:00
Joe Haddad
74b6389bd6
ci: fix webpack 5 enabling for tests (#21436)
* ci: fix webpack 5 enabling for tests

* refactor: move default location

* Disable incompatible suite
2021-01-22 11:20:53 -06:00
Tim Neutkens
4dc32ec0a7 v10.0.6-canary.7 2021-01-22 09:56:40 +01:00
JJ Kasper
5b70802f61
Preserve asPath while resolving rewrites (#21410)
* Preserve asPath while resolving rewrites

* remove un-needed alias

* Add new alias

* Add return type for resolve rewrites
2021-01-21 17:40:23 -06:00
Joe Haddad
a1b8fb49e6
v10.0.6-canary.6 2021-01-20 00:48:30 -05:00
Joe Haddad
47ec677127
chore: compile css-loader (#21357)
This PR compiles `css-loader` to resolve a peer dep warning.
2021-01-20 05:47:25 +00:00
Joe Haddad
55b8502dd0
chore: compile style-loader dep (#21355)
This PR compiles `style-loader` to resolve a peer dep warning.

---

Closes #21359
2021-01-20 05:25:46 +00:00
Joe Haddad
0d0db45c72
v10.0.6-canary.5 2021-01-19 15:11:46 -05:00
Joe Haddad
ab158c0aee
chore: compile resolve-url-loader (#21351)
Closes #21166
2021-01-19 20:08:24 +00:00
Tim Neutkens
56b149f7be
Add experimental per-page option to disable JS preloads (#21329)
As discussed with @csswizardry. This is a temporary option in case you know the preloads are not needed. It will likely be a default once the ScriptLoader work from @janicklas-ralph has been proven in partner apps and landed.

```js
// pages/index.js
export const config = {
  unstable_JsPreload: false
}
```
2021-01-19 19:38:15 +00:00
Tobias Koppers
11900431fa
upgrade webpack 5 for empty entrypoint fix (#21353)
fixes a problem where entrypoints are nearly empty.
2021-01-19 19:15:45 +00:00
Bernd Artmüller
72ce099106
Fix splitting page path by buildId (#19901)
Running next.js in `development` causes issues when having pages named "development" or "developments",... as `this.buildId` = `development`

Fixes: https://github.com/vercel/next.js/issues/19520
2021-01-19 18:27:28 +00:00
Joe Haddad
d33aad7815
chore: upgrade chokidar to fix install warning (#21343)
To resolve:
```
warning next > chokidar > fsevents@2.1.3: "Please update to latest v2.3 or v2.2"
```
2021-01-19 17:02:32 +00:00
Tim Neutkens
85624d6164 Remove console.log 2021-01-19 09:44:03 +01:00
Tim Neutkens
f8fecf57c3
Fix webpack 5 warning + disabling of profiling (#21276)
Noticed that there was a specific warning when using webpack 5.
2021-01-18 16:38:00 +00:00
Tim Neutkens
c5b5c43e3d
Add codemod for files that do not support the new React JSX transform (#21281)
Previously our automatic React injection approach injected `import React from 'react'` automatically whenever JSX was detected. The new official JSX transform solves this by enforcing importing `React` when it is used.

This codemod automatically converted files that are using a "global React variable" to use `import React from 'react'`
2021-01-18 15:17:10 +00:00
Tim Neutkens
f534a5cad2 v10.0.6-canary.4 2021-01-17 20:13:41 +01:00
Tobias Koppers
b02df3f487
improve splitChunks config for webpack 5 (#21208) 2021-01-17 20:05:47 +01:00
Tobias Koppers
9c4d368459
use webpack resolve api to resolve in externals config (#21205) 2021-01-17 20:02:20 +01:00
JJ Kasper
cfa9326c63
Minimal mode normalizing (#21083)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-01-16 16:46:21 +01:00
kaykdm
cdab7bf831
fix hydration mismatch on href for url with anchor refs (#21065)
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-01-15 17:53:10 +01:00
Joe Haddad
ceef1566c3
v10.0.6-canary.3 2021-01-15 11:49:31 -05:00