Commit graph

7448 commits

Author SHA1 Message Date
Tim Neutkens
c792317295
Clear up production build missing message for next start and next export (#19777)
Adds an err.sh link to the production build missing message. Also clears up `valid` as `production`.

Also fixes an edge case where an unhelpful error would be thrown because we checked for `.next` instead of `.next/BUILD_ID`

Added the out directory location as the list line during export to make sure people know where the files are output. 

Fixes #19778
Fixes #19788
2020-12-08 15:16:56 +00:00
JJ Kasper
cf4665539a
Fix failing Azure tests (#19877)
Noticed Azure tests have started failing after https://github.com/vercel/next.js/pull/19758 due to the middleware taking longer than the allotted threshold which adds unexpected logs to stderr. This attempts to resolve these test failures by increasing the allotted time for the middleware when running on Azure. 

x-ref: https://dev.azure.com/nextjs/next.js/_build/results?buildId=22617&view=logs&jobId=5ee44de4-e310-59d9-0ba5-4a271a649fb0&j=5ee44de4-e310-59d9-0ba5-4a271a649fb0&t=af3fb693-3771-5a1a-ec97-2ba4cc77f25c
x-ref: https://dev.azure.com/nextjs/next.js/_build/results?buildId=22619&view=logs&jobId=5ee44de4-e310-59d9-0ba5-4a271a649fb0&j=5ee44de4-e310-59d9-0ba5-4a271a649fb0&t=af3fb693-3771-5a1a-ec97-2ba4cc77f25c
2020-12-08 09:24:22 +00:00
Sung Hah Hwang
f186be6927
Update client-only.js (#19884)
typos
2020-12-08 02:29:00 +00:00
Nicolás Figueroa
d1260762ef
with-facebook-pixel: remove package and update readme (#19807)
(@lfades), I forgot remove package react-facebook-pixel that is not necessary now and update readme doc.
2020-12-07 23:09:52 +00:00
Tim Neutkens
4bca939ff7
Remove aliases that are no longer needed (#19937)
Fixes #19939
2020-12-07 22:35:28 +00:00
Joe Haddad
df2f6ec003
Automatically cancel old workflow runs on PRs (#16976) 2020-12-07 14:30:46 -05:00
JJ Kasper
358861d315
Ensure trailingSlash redirect applies correctly for i18n (#19859)
This ensures locales aren't applied for the trailing slash redirect un-necessarily

Fixes: https://github.com/vercel/next.js/issues/19784
2020-12-07 17:36:46 +00:00
Daniel Kempner
90e97b535b
Custom Server with bodyParser, don't parse body again in API Route (#16169)
## Why

Some users prefer to use a custom server implementation that handles body parsing. If they do this, they have no way to opt out of all body parsing in API Routes. Requests with bodies die if next's `bodyParser` is not disabled. Requests just hang forever.

Instead of adding [this config](https://nextjs.org/docs/api-routes/api-middlewares#custom-config) to every API Route, we do a simple check to avoid parsing the body twice.

Fixes #8315
Fixes #7960
2020-12-07 13:30:38 +00:00
JJ Kasper
b403e9ec15 v10.0.4-canary.2 2020-12-04 09:48:30 -06:00
Pepijn Senders
3f730fc7b1
Improve way cache version string is created (#19763)
Nitpicky change, but the version string contained a double `|`, implying that there might be an empty value between `process.env.__NEXT_VERSION` and the environment variables.
2020-12-04 14:08:02 +00:00
JJ Kasper
e6c1aa6483
Add locale: false custom route prefix note (#19765)
This makes sure to note how custom-routes need to be prefixed when `locale: false` is used for routes to be matched correctly. 

Closes: https://github.com/vercel/next.js/issues/19703
2020-12-04 13:32:50 +00:00
JJ Kasper
42385f48db
Ensure i18n custom routes resolves correctly (#19766)
This ensures i81n custom routes are resolving correctly, it also corrects redirects for default locales when `locale: false` is not used, and this also simplifies the resolving for custom routes with i18n in `next-server` adding types for the i18n config. This also adds additional tests to prevent regression and starts leveraging a shared `NextConfig` type to allow us to share types for config values. 

Fixes: https://github.com/vercel/next.js/issues/19521
Fixes: https://github.com/vercel/next.js/issues/19403
Fixes: https://github.com/vercel/next.js/issues/19302
Fixes: https://github.com/vercel/next.js/issues/19227
2020-12-04 10:14:55 +00:00
Prateek Bhatnagar
57e156bc49
Making font optimization as default (#19758)
- Making font optimizations as default
- Re-enabling tests
- Fixes #19159
2020-12-04 09:52:54 +00:00
Allen Hai
2b817af1ea
Update fauna example (#19806)
This PR removes the `next.config.js` file with an `env` key and instead modifies the setup script to create a `.env.local` file with the provided credentials. 

I also made some changes to the Deploy Button to ask for the environment variables when creating a new project.
2020-12-04 01:28:37 +00:00
Nicolás Figueroa
dc4beade67
with-facebook-pixel (#19762)
## Problems with the other implementation
- pixel not working first time load page (this generate fake information to facebook analytics data)
- package react-facebook-pixel  error when try use events in code blocks or other pages with the current implementation
- sometimes pixel mark twice pageview (this generate warning in facebook panel)
- standar or custom events not working

## Solutions
- Initialize pixel when entering each page (_document)
- Now, we can use custom and standar events (utils/fpixel.js)
- correct way to implement pixel according to facebook and guide facebook to implement in SPA
- this solution is complemented with example "with-google-analytics"

In my opinion, the other development has problems, but I preferred created a new example because the way to implement the base code is different. It seems that the other example is based on set the events from the Facebook control panel then this method limits an advanced implementation.
2020-12-03 23:14:39 +00:00
Carmelo Scandaliato
20949612df
Replace Graphcool with a working GraphQL endpoint in with-apollo-and-redux example (#19248)
The example stopped working when the GraphQL service [Graphcool](https://www.graph.cool/) shut down in July. I have replaced it with an [Hasura](https://hasura.io/) endpoint.

Fixes #19093
2020-12-02 19:45:31 +00:00
Michael McQuade
3924b00478
docs/Remove extra word (#19754)
Remove extra word "the"
2020-12-02 18:09:54 +00:00
Lee Robinson
8c2cb4640a
Clarify data fetching documentation on calling API routes. (#19748)
We've received some feedback that the current note about calling API routes inside gSP/gSSP is confusing. This updates the wording to make it clear you can still use `fetch` in your application, and also to not say you "import" an API route. You import the _logic_ inside the route.
2020-12-02 16:23:42 +00:00
JJ Kasper
bb1bdbb10f
Update @ampproject/toolbox-optimizer to latest version (#19722)
This updates to the latest version of the `@ampproject/toolbox-optimizer` which contains updates for dependencies to remove the warnings on install from `npm`

x-ref: https://github.com/vercel/next.js/pull/18994
Closes: https://github.com/vercel/next.js/issues/17416
2020-12-02 12:55:43 +00:00
JJ Kasper
7ae76f4326 v10.0.4-canary.1 2020-12-01 18:00:06 -06:00
Jeff Escalante
b86a1731e1
Error Message Clarity (#16052)
* make the error message more clear if webpack config comes back undefined

* Update check and add test

* bump

* Update build-output test

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2020-12-01 15:58:52 -06:00
JJ Kasper
d016eadeef v10.0.4-canary.0 2020-12-01 14:53:27 -06:00
Janicklas Ralph
c8cd77a856
Script loader component (#18281) 2020-12-01 19:10:16 +01:00
Janicklas Ralph
6e4632efe1
Css optimizations (#16539)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2020-12-01 19:02:07 +01:00
Vyacheslav Matyukhin
7e387f0fce
Avoid misleading inline comments in .env example (#19708)
dotenv currently doesn't support inline comments (see https://github.com/motdotla/dotenv/issues/484), so it's misleading to use inline comments in documentation examples.
2020-12-01 17:34:05 +00:00
Pradip Caulagi
3766cff9b7
Fix typo in gitignore (#19638)
Build directory is `dist` and not `build`. The typo also makes gitignore not work correctly.
2020-12-01 17:08:38 +00:00
Luis Alvarez D
3b68bc3be8
Update with-zones example readme (#19713)
Updated one of the deployment steps to make sure the deployment of the home app is not done without pushing the blog URL first!
2020-12-01 16:48:02 +00:00
Steven
fddad89cbc
Fix cloudinary default quality to use q_auto (#19694)
The [default loader](17b91e7c76/packages/next/client/image.tsx (L488)) and [imgix loader](https://docs.imgix.com/apis/rendering/format/q) use a quality of 75 if none is specified on the Image component.

This PR does something similar for the cloudinary loader by utilizing `q_auto`, but it should yield even better results.

> This setting can significantly reduce the file size without any degradation noticeable to the human eye, and without the need for you to individually analyze every image.

https://cloudinary.com/documentation/image_optimization#use_q_auto_automatic_quality_and_encoding

### Example
- [Before](https://res.cloudinary.com/demo/image/upload/woman.jpg) - 583KB
- [After](https://res.cloudinary.com/demo/image/upload/q_auto/woman.jpg) - 46KB
2020-12-01 16:09:11 +00:00
Vishnu Paduchuri
17b91e7c76
Spelling fix (#19686) 2020-11-30 18:53:13 +00:00
Dennis Morello
b79d72ce60
Remove the as prop from the Link component in with-static-export example (#19650)
This PR closes #19649.
2020-11-30 11:19:09 +00:00
Tim Neutkens
ad8999356d Move note about next export and i18n 2020-11-30 11:15:32 +01:00
Wesley Tian
1231ddb001
Fix typo in image-optimization.md (#19670)
Either use `avoid` or `prevent` as verb, but not both.
2020-11-30 02:00:38 +00:00
Mark Steggles
fcf129d90d
Fix typo (#19624) 2020-11-28 14:31:14 +00:00
Louison
9f07d2dcfb
add missing import in with-firebase example (#19572)
Fixes https://github.com/vercel/next.js/issues/19571
2020-11-26 23:06:05 +00:00
Guy Bedford
9dd5ff2baa
fix: Revert #18921 and inline absolute babel runtime only for YarnPnp (#19542)
This reverts #18921 and ensures that the Babel runtime is only inlined as an absolute path when using PnP as before, but then including the correction this resolution as implemented by @merceyz only in the PnP cases, while keeping the diff to a minimum.
2020-11-25 22:28:39 +00:00
JJ Kasper
899a29cade
Break up the serverless loader into typed handlers (#19511)
This breaks up the `serverless-loader` into typed handlers to allow for easier maintenance and better type-checking/linting. 

Closes: https://github.com/vercel/next.js/issues/19071
2020-11-25 19:56:18 +00:00
Arthur Petrie
453adc6864
[Examples] update with-tailwindcss-emotion to tailwind 2.0 (#19476)
Hello, this PR updates the with-tailwindcss-emotion example to be compatible with tailwindcss 2.0

Here is a summary of all the changes:
- update `.babelrc` config
- update `README.md`
- delete `@emotion/css component` (makes the example simpler)
- update `@emotion/react` component to use xwind
- update `@emotion/styled` component to use xwind
- Add global styles to `_app.js`
- remove `_document.js` page
- remove `base.css` global style files (global styles are added in _app.js)
- update `tailwind.config.js`
- update `package.json` dependencies + remove unnecessary `build:base-css` script
2020-11-25 18:17:12 +00:00
Ivan V
14cb6556a8
example fix: hydrate method of the mobx store needs to be an action (#19522)
By default, MobX 6 and later require that you use `actions` to make changes to the state, otherwise, it issues a warning in the console, because the `hydrate` method of the `store.js` class hasn't been declared an action, you can see this warning if you try to load pages that use hydration (ssg, ssr).
This pull request fixes that.

More info about the behavior:
https://mobx.js.org/actions.html#disabling-mandatory-actions-
2020-11-25 17:20:57 +00:00
Jamie
397a375b37
Ensure next commands respect termination signals (#19433)
Fixes #16173

## What

Restores handling of termination signals, `SIGTERM` and `SIGINT`, to allow graceful termination of next commands. Seems to have been removed during a child process refactor #6450, was this intentional?

## Why 

Currently the command processes have to be forcefully killed. This would help those using Next.js with custom servers and tools like Docker and Kubernetes that rely on termination signals to shutdown instances.

---

Where would be a good location to add some tests? [test/integration/cli/test/index.test.js](fc98c13a2e/test/integration/cli/test/index.test.js)?
2020-11-25 13:30:06 +00:00
Curt Siffert
f4bf8a4696
Update getInitialProps.md (#19506)
To clarify what I've noticed as a common source of confusion in discussions online. Fixes https://github.com/vercel/next.js/issues/19426 

If you wish to know whether the code is running as part of a client-side page transition, in either `getInitialProps` or `getServerSideProps`, you can check to see if `context.req.url` starts with `/_next/data`.
2020-11-25 11:23:04 +00:00
Luis Alvarez D
86a0c7b0f7
Remove mention of the Next.js site repo from docs (#19504)
Fixes https://github.com/vercel/next.js/issues/19503
2020-11-25 01:21:51 +00:00
Luis Alvarez D
0ed8152858
Update documentation links (#19502)
- Updated some links in docs that don't have the `.md` extension. Not required for our live docs but useful for the GitHub view.
- Updated links that go to https://nextjs.org/docs to a relative path, that way they'll work for versioned docs
- Updated the `Regex Path Matching` example to be consistent with the paragraph above and with the official example in /examples.
2020-11-25 00:00:06 +00:00
Manu
d640590907
Change duplicated redirect in examples (#19479)
The code here should contain a regex path matching example, as stated in the comment; but it is the same as the wildcard path matching example above.

https://nextjs.org/docs/api-reference/next.config.js/redirects#regex-path-matching
2020-11-24 22:05:32 +00:00
Balázs Orbán
532a5bcc75
Fix grammar in API routes: Introduction (#19385)
For an API route to work, you need to `export as default a function` (a.k.a **request handler**), which then receives the following parameters:
For an API route to work, you need to `export a function as default` (a.k.a **request handler**), which then receives the following parameters:


I might be wrong though (not a native English speaker), it just sounds strange to my ears.
2020-11-24 21:26:02 +00:00
Osh Slomczynski
d82a6057a1
Fix italics in readme (#19441) 2020-11-24 21:04:53 +00:00
mikan3rd
9ca1f39f75
with-firebase example for SSR (#16070)
I couldn't find an example when creating an SSR page using firebase's firestore data, so I improved the example based on the actual app I created

My sample app: https://github.com/mikan3rd/commitly
2020-11-24 19:57:23 +00:00
Luis Alvarez D
af5b8ceb7a
Update next export docs to mention i18n caveat (#19491)
Fixes https://github.com/vercel/next.js/issues/19486
2020-11-24 19:23:39 +00:00
Nikolas Santis
a5917317f0
[ EXAMPLES ] Added with-neo4j (#16559)
Adding a example with **Neo4j** native graph database.

- with-neo4j: basic api routes with neo4j driver.

:)
2020-11-24 18:35:51 +00:00
James George
21e4c3f00e
tests(create-next-app): leverage execa (#19008)
Leverage [execa](https://github.com/sindresorhus/execa) for writing to `stdin`.
2020-11-24 14:51:41 +00:00
Laurent Meyer
6095119970
Typo (#19475) 2020-11-24 14:21:32 +00:00