Commit graph

7477 commits

Author SHA1 Message Date
Tim Neutkens
72fae8bed4
Move productionBrowserSourceMaps out of experimental (#20267)
Makes https://www.npmjs.com/package/@zeit/next-source-maps a built-in feature so that it can be deprecated.
2020-12-17 15:04:17 +00:00
ykdojo
cfca41cbfd
Fix a link to a Slack clone example in Supabase (#19993) 2020-12-17 09:35:13 +00:00
Leo Toneff
25cb43a73b
Added flag to identify shallow router events (#19802)
This PR is an implementation of RFC #13276 (more specifically @banerjeesouvik's [suggestion](https://github.com/vercel/next.js/discussions/13276#discussioncomment-17874)) which solves #3322 by adding an extra parameter to the router events that'll allow you to see whether or not the route is shallow.

This is a recreation of PR #13243.
2020-12-17 09:14:50 +00:00
JJ Kasper
0970873bb7 v10.0.4-canary.7 2020-12-16 17:09:51 -06:00
Joe Haddad
9661256263
Upgrade http-proxy dependency (#20239) 2020-12-16 17:02:39 -05:00
JJ Kasper
e819e00d0c
Add required server files manifest (#20035)
This keeps track of required server files in a manifest file
2020-12-16 20:46:55 +00:00
Tim Neutkens
5d5383b263
Update font-stylesheet-gathering-plugin to be webpack 5 compatible (#20229)
Solves the following warning:

> (node:1484) [DEP_WEBPACK_MAIN_TEMPLATE_REQUIRE_FN] DeprecationWarning: MainTemplate.requireFn is deprecated (use "__webpack_require__")
2020-12-16 14:35:50 +00:00
Tim Neutkens
a7812ef7eb v10.0.4-canary.6 2020-12-16 11:23:05 +01:00
Tim Neutkens
8ed132deb6
Update import to prevent loader from erroring in webpack 5 (#20211)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-12-16 08:56:14 +01:00
Tuan Nguyen
977b3ed769
Correct a typo (#20183) 2020-12-14 21:43:12 +00:00
Dmitry Belyaev
a442841517
Update Link documentation (#19980)
Mention onClick property for next/link wrapping custom components
2020-12-14 10:02:10 +00:00
Joi Glifberg
ac89474303
Add dynamic and import note. (#20145)
Add note about import required to be explicit and dynamic required to be top-level module.
2020-12-14 09:42:53 +00:00
Erik August Johnson
76c0efb3dd
Update README-template.md for API endpoint info (#20024)
Adds brief summary in Getting Started to explain the `pages/api` functionality. The intention here is reduce confusion to new users of Next.js as to what `pages/api` is and how it works.
2020-12-14 09:22:55 +00:00
Craig Johnson
114f4801df
Update introduction.md (#20129)
Grammar correction.
2020-12-14 09:55:52 +01:00
bram-l
929f17e183
Fix prefetching for URLs including trailing slash (#19474)
Fixes  #17813
2020-12-12 22:09:09 +00:00
JJ Kasper
1132a8dedf v10.0.4-canary.5 2020-12-12 14:29:15 -06:00
Tim Neutkens
81e67ce95e
Update terser-webpack-plugin to support webpack 4 (#20089)
Solves some of the cache warnings when using webpack 5
2020-12-12 20:28:53 +00:00
JJ Kasper
5b89b1b6df
Ensure href resolvedAs is correct with locale (#20080)
This makes sure the `locale` doesn't cause the wrong `href` to be resolved, this also ensures route specificity is correct when loading dynamic routes in production mode. 

Fixes: https://github.com/vercel/next.js/issues/19747
2020-12-12 14:06:46 +00:00
Hidetaka Okamoto
748bcb996d
docs: add example of Ionic with TypeScript (#18532)
* docs: add example of Ionic with TypeScript

* docs: fix example code typo

* fix: support ionicons

* docs: fix example code by ESLint and prettier

* docs: example remove invalid config

* Renamed example to with-ionic-typescript

* Updated .gitignore

* Updated readme

* Updated package.json

Co-authored-by: Hidetaka Okamoto <info@wp-kyoto.net>
Co-authored-by: Luis Alvarez <luis@vercel.com>
2020-12-11 12:17:39 -05:00
Bruno Antunes
8340e6d345
[Image Component] image sizes property becomes 100vw by default (#20067)
Currently if sizes is not defined, Next.js is setting sizes as:
```
(max-width: 640px) 640px, (max-width: 750px) 750px, (max-width: 828px) 828px, (max-width: 1080px) 1080px, (max-width: 1200px) 1200px, (max-width: 1920px) 1920px, (max-width: 2048px) 2048px, 3840px'
```

This pull request will make sizes be `100vw` by default, which will allow us to download "smaller" images than what's currently happening. 

In a demo app I have, the difference is between downloading 488KB vs 1.4MB (in images)
2020-12-10 21:29:37 +00:00
Joe Haddad
f4809b950b
v10.0.4-canary.4 2020-12-10 11:54:59 -05:00
Joe Haddad
1692e931d9
Upgrade Terser (#20063)
Fixes #18056
2020-12-10 16:49:23 +00:00
Luis Alvarez D
a5fea53bc8
Update logo for dark mode (#20047)
Closes https://github.com/vercel/next.js/issues/20046
2020-12-09 23:57:07 +00:00
Felix Meziere
3410106958
Fix bug in with-apollo example leading to cached lists being duplicated. (#19812)
Closes https://github.com/vercel/next.js/issues/19759
2020-12-09 23:35:38 +00:00
JJ Kasper
782537dd2d
Add NEXT_LOCALE cookie note to docs (#20045)
Closes: https://github.com/vercel/next.js/issues/20044
2020-12-09 22:45:05 +00:00
Aral Roca Gomez
d96c454127
Update example with next-translate upgrading to 1.0 (#20039)
I applied the changes of the [migration guide of next-translate from 0.x of 1.0](https://github.com/vinissimus/next-translate/blob/1.0.0/docs/migration-guide-1.0.0.md)
2020-12-09 19:33:25 +00:00
Lachlan Campbell
9bdb793c4e
Fix double-quoted hotlinks in dev error panel (#19974)
Fixes #19923.

Before:
<img width="564" alt="Screen Shot 2020-12-08 at 3 07 11 PM" src="https://user-images.githubusercontent.com/5074763/101535738-1adc6c00-3967-11eb-8c80-c7f2e75f8de5.png">

After:
<img width="574" alt="Screen Shot 2020-12-08 at 3 07 18 PM" src="https://user-images.githubusercontent.com/5074763/101535742-1b750280-3967-11eb-828b-1ecac08c6511.png">
2020-12-09 07:48:54 +00:00
Joe Haddad
19fed3f83b
v10.0.4-canary.3 2020-12-08 11:14:36 -05:00
Richard Lee
e3244e96a6
Correct production docker base image tag (#19962)
As seen in https://github.com/mhart/alpine-node, the `base` image tag has been renamed to `slim`.
2020-12-08 15:43:24 +00:00
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