Commit graph

1127 commits

Author SHA1 Message Date
JJ Kasper
fafa16f350
Bundle env configs in serverless mode (#13406)
As discussed this adds bundling of `.env` files in `serverless` mode so that the environment values are also available when deploying with this target

closes: https://github.com/zeit/next.js/issues/13332
2020-05-26 19:01:57 +00:00
Fabio Benedetti
235b3befcc
fix(client-routing): page render (#13305)
Fixes https://github.com/zeit/next.js/issues/12935
2020-05-26 17:50:06 +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
Jan Potoms
cefbcadf45
Make page path case sensitive in dev (#8848)
URL paths are case sensitive, MacOS file system is case insensitive. This PR makes sure development mode doesn't find pages that don't have the casing as specified in the URL.

Will clean up and write a test when agreed on this approach.

Fixes https://github.com/zeit/next.js/issues/8825
Fixes https://github.com/zeit/next.js/issues/8847
Fixes https://github.com/zeit/next.js/issues/9080
2020-05-26 12:50:28 +00:00
Joe Haddad
2ecb7c6e37
Fix retry for Windows tests (#13296)
Noticed these tests failed for Windows on `canary`, then traced down the cause.
2020-05-24 01:34:06 +00:00
James Mosier
846ec74013
Special case default template in CNA (#12109)
This addresses #11910 in which `-e default` was not working because there was no example with the name `default`. This PR checks if a user inputted `default` as the example argument for `create-next-app` and if so it will use the local `default` template in the create-next-app directory.

Closes #11910
2020-05-23 22:50:31 +00:00
Joe Haddad
3ee0a1f41a
Wait for flush before firing routing event (#13287)
This waits for the render to be committed to DOM before we render the route change complete event (no longer sync in new React).

We have tests that ensure this resolves.

---

Closes #12938
2020-05-23 21:54:11 +00:00
Joe Haddad
d6ad201f80
[Fast Refresh] Upgrade react-refresh (#13285)
Closes #13254
2020-05-23 21:37:56 +00:00
Jairo Tylera
e66bcfa838
Add support for sass-loader prependData option (#12277)
This PR adds support for prepending sass code before the actual entry file.

It's common for developers to import their sass mixins and variables once on their project config so they don't need to import them on every file that requires it. Frameworks like gatsby and nuxt.js already support that handy feature.

The way it works is:

```
/// next.config.js
module.exports = {
  experimental: {
    sassOptions: {
      prependData: `
        /// Scss code that you want to be
        /// prepended to every single scss file.
      `,
    },
  },
}
```

Fixes #11617 and duplicates
2020-05-23 13:37:48 +00:00
Luis Alvarez D
589f44ef94
Ignore nullish user configs (#10250) 2020-05-22 16:46:36 +00:00
Joe Haddad
3d852d895f
Better formatted Sass errors (#13211)
https://twitter.com/timer150/status/1263689549898829829
2020-05-22 05:25:02 +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
Joe Haddad
7c7fd3e863
Record presence of reportWebVitals (#13155)
Closes #12897
2020-05-20 18:44:39 +00:00
Joe Haddad
57815c5fe5
Fix Windows LogBox Test (#13147) 2020-05-20 13:33:26 -04:00
Joe Haddad
74d7e3585c
Eliminate array destructuring assignment (#13151)
While we're at it, we should fix this too.

x-ref: #13144
2020-05-20 17:13:31 +00:00
Joe Haddad
92a159d939
Correctly eliminate destructuring assignment (#13144)
This eliminates code referenced via destructuring assignment, as reported by @styfle.
2020-05-20 15:57:18 +00:00
Joe Haddad
ccea1c018b
Enable jest/no-try-expect (#13124) 2020-05-20 13:37:35 +02:00
Janicklas Ralph
a17ace8eba
GranularChunks conformance check (#11710)
Adding a conformance plugin the make sure users don't undo the benefits of the granularChunks config.

The plugin makes sure that minSize, maxInitialRequests values aren't overridden. Also ensures the cacheGroups - vendors, framework, libs, common, shared are maintained.

The warning and error messages do not break the build with this change. They only display a message.

cc - @prateekbh, @atcastle
2020-05-20 06:40:23 +00:00
Joe Haddad
d64e2e1cbe
Use eval-source-map for Server Side Errors (#13123)
This switches to faster source maps in development for the server-side compilation on macOS.

We still need to figure out a story for Windows.
2020-05-20 05:00:50 +00:00
Dave Cardwell
07084d4819
[Experimental] Only consider files within plugins (#12943)
I have a plugin with a src folder structure following jest’s recommended practice of including a `__tests__` folder:

```
$ find src/
src/
src/document-html-props-server.ts
src/__tests__
src/__tests__/document-html-props-server.unit.ts
```

collect-plugins.ts [reads the src directory](960c18da53/packages/next/build/plugins/collect-plugins.ts (L65)) and finds:
```js
[ '__tests__', 'document-html-props-server.ts' ]
```

…which it then [converts to](960c18da53/packages/next/build/plugins/collect-plugins.ts (L76-L80)):
```js
[ '', 'document-html-props-server' ]
```

…and finally [outputs](960c18da53/packages/next/build/plugins/collect-plugins.ts (L90-L96)):
```
Next.js Plugin: {my plugin} listed invalid middleware
```

This pull request makes collect-plugins.ts only consider files, so my __tests__ directory and its contents are ignored.
2020-05-20 04:05:29 +00:00
Joe Haddad
9386ba29f8
Stabilize config tests (#13116) 2020-05-19 18:42:41 -04:00
Joe Haddad
f7bdf29ecb
Fix Lint 2020-05-19 18:00:04 -04:00
Jan Potoms
0d05904552
Fix catch-all route + index.js in dev when accessed with trailing slash (#10502)
Failing test case for https://github.com/zeit/next.js/issues/10488#issuecomment-584500081

This used to give a 500 in dev environment
2020-05-19 18:03:14 +00:00
JJ Kasper
ef422467dc
Add error when exporting pages with fallback: true (#13063) 2020-05-19 09:29:34 -04:00
Slawek Kolodziej
7f604a504b
Fix building server-side generated AMP pages (#13046) 2020-05-19 07:58:50 -04: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
86160a5190
Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
Joe Haddad
f9b7247360
Fix lint 2020-05-18 14:01:45 -04:00
Jan Potoms
714747957a
Add eslint-plugin-jest (#13003) 2020-05-18 13:16:07 -04:00
Mario Pareja
5af38f1727
fix crash when NODE_OPTIONS includes --inspect-port (#12555) 2020-05-18 13:14:41 -04:00
JJ Kasper
97587eb8e0
Correct multi-match behavior for queries and header values (#13017) 2020-05-18 13:04:54 -04:00
Joe Haddad
6d6ce94f68
An empty jsconfig.json should not fail the build (#13051) 2020-05-18 12:31:15 -04:00
Jan Potoms
3b382a08d5
Improve jsconfig.json error message (#13053) 2020-05-18 12:07:08 -04:00
Joe Haddad
f5c8b428ab
Stabilize test for Windows (#13050) 2020-05-18 12:05:18 -04:00
Jan Potoms
f8125c9ed7
[Experimental] Implement optional catch all routes (#12887) 2020-05-18 09:47:13 -04:00
Joe Haddad
73eb9cede5
Convert test to be inline (#13022) 2020-05-17 18:30:30 -04:00
Tim Neutkens
dfe6d14859
[Experimental] Add support for production browser source maps (#13018) 2020-05-17 16:30:42 -04:00
Jan Potoms
9f8076be43
Only retry tests on CI (#12998) 2020-05-17 12:10:02 -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
Joe Haddad
9d17d9ed1f
Test TypeScript Enum (#12954) 2020-05-15 19:55:58 -04:00
JJ Kasper
9df9d4aea5
Fix build stalling with styled-jsx plugins (#12952) 2020-05-15 17:15:15 -04:00
Joe Haddad
202ea6fbd9
Support eliminating memoized functions (#12953) 2020-05-15 17:14:46 -04:00
Joe Haddad
7edc815a38
Elimination has to run before other plugins (#12949) 2020-05-15 16:51:29 -04:00
Tim Neutkens
313b552026
Enable .env support by default (#12911)
* Enable .env support by default

Given we've had tons of reports from various people that expected .env support to work even though they had dotenv installed already I think it's fine to enable it as a default:

Fixes #12728

* Remove old test

* Fix duplicate env loading

* Update docs

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2020-05-15 14:02:16 -05: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
Joe Haddad
3bd2711c19
[Fast Refresh] Improve responsiveness on Windows (#12909) 2020-05-15 08:30:23 -04:00
Joe Haddad
ff8d4c45e3
Explicit header for SSR error (#12880) 2020-05-14 12:10:08 -04:00
Joe Haddad
b931cbecbf
Simplify CSS Errors (#12852) 2020-05-13 17:18:45 -04:00