Commit graph

7506 commits

Author SHA1 Message Date
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
Joe Haddad
17c81cdce3
v10.0.3 2020-11-24 01:11:41 -05:00
Joe Haddad
38df992aa6
v10.0.3-canary.3 2020-11-24 00:26:13 -05:00
Noob Tsai
33df8e6fa4
Update Koa Router Example (#19272)
The `custom-server-koa` example is not working in the latest koa-router, so I made some changes mentioned in #9705.

Also update Koa.js to 2.13.0.
2020-11-24 01:22:39 +00:00
Allen Hai
3478e1d0cc
[examples] Add Next.js + MySQL example (#19452)
* [examples] add with-mysql example

* [examples] add demo link to with-mysql readme

* [examples] add next.js + mysql example with correct env pattern

* [examples] fix lint errors, update package name, remove unnecessary res statement

* [examples] remove unused imports and variables

* [examples] fix some linting errors

* Added NextApiHandler to API endpoints

* Lint fixes

* Added useEntry hook

* Updated type

* Update examples/with-mysql/package.json

* Updated readme

* fixed URL

Co-authored-by: Matthew Sweeney <mail@mcs.dev>
Co-authored-by: Luis Alvarez <luis@vercel.com>
2020-11-23 19:13:09 -05:00
Joe Haddad
b063f85f87
v10.0.3-canary.2 2020-11-23 15:13:38 -05:00
Joe Haddad
2832e753ad
Update vitals URL (#19454)
Update for rebranding purposes
2020-11-23 20:08:04 +00:00
Joe Haddad
8ddb3ad7da
v10.0.3-canary.1 2020-11-23 10:16:30 -05:00
Joe Haddad
c96c13a71b
Use render after hydrate (#19442)
Fixes #19399
2020-11-23 15:04:12 +00:00
Tobias Lundgren
f637c8a2cc
Update Chakra UI examples to v1 (#19282)
- Upgrade TypeScript example to Chakra UI v1
- Upgrade to React 17
- Patch some missing parts and fix broken icons in non TypeScript example
- Add example how to persist color mode when you refresh the page: https://chakra-ui.com/docs/features/color-mode#add-colormodescript

Source: https://chakra-ui.com/docs/migration
2020-11-22 17:51:14 +00:00
JJ Kasper
53a4458bae
Ensure dist-dir test has fresh start (#19370)
h/t to @prateekbh for noticing this test isn't cleaning up properly 

Closes: https://github.com/vercel/next.js/issues/19369
2020-11-21 17:19:19 +00:00
Ivan V
b28b8b2913
add example with mobx version 6 and mobx react lite (#17493)
Mobx version 6 has been released, and it's a big one.

<blockquote class="twitter-tweet" data-partner="tweetdeck"><p lang="en" dir="ltr">Just released <a href="https://twitter.com/hashtag/mobx?src=hash&amp;ref_src=twsrc%5Etfw">#mobx</a> 6! <br><br>👉 makeAutoObservable 😍<br>👉 Decorator free by default<br>👉 Fully revamped docs for modern React <br>👉 Supersedes both MobX 4 and 5<br>👉 Codemod for migration<a href="https://t.co/U6EpZaNhyz">https://t.co/U6EpZaNhyz</a></p>&mdash; Michel Weststrate (@mweststrate) <a href="https://twitter.com/mweststrate/status/1311344102991159296?ref_src=twsrc%5Etfw">September 30, 2020</a></blockquote>


Decorator support is officially dropped, so the syntax for creating observable objects has changed (checkout store.js).

There is no need for custom babel configuration anymore.

In comparison to current mobx examples, the difference is that I'm using regular  `React.useContext` and `React.createContext` to consume the mobx store, [this is recommended by the official documentation.](https://mobx.js.org/react-integration.html#using-external-state-in-observer-components)

When the component is wrapped in the observer function, the component function is given a name so it appears correctly in the react development tools.

As of mobx v6  `mobx-react` package bundles `mobx-react-lite` so I could have used that package, but I've decided to use the `lite` one, because of the size.
2020-11-20 23:55:09 +00:00
JJ Kasper
e1737809db
Update fallback locale for locale: false (#19322)
This updates the fallback locale for `locale: false` to be the `defaultLocale` instead of the currently active `locale` as it allows passing through URLs more seamlessly as a URL without the locale prefixed can be treated as the `defaultLocale` instead of having to worry if the locale matches the currently active locale. This also ensures `locale={false}` is tested in the i18n-support-catchall suite

Closes: https://github.com/vercel/next.js/issues/19048
2020-11-20 21:50:26 +00:00
Connor Davis
c1702c2349
Exclude well known files when trailing slash: true (#19364)
* Exclude well known files when trailing slash: true

* Update manifest test

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2020-11-20 15:17:58 -06:00
JJ Kasper
26634c475e
v10.0.3-canary.0 2020-11-20 14:39:12 -06:00
Nikolas Santis
4bbdd09097
[ EXAMPLES ] Added with-apollo-neo4j-graphql (#16560)
Adding a example with **Neo4j** native graph database.

- with-apollo-neo4j-graphql: basic apollo configuration with neo4j driver and neo4j-graphql-js.

:)
2020-11-20 20:38:08 +00:00
JJ Kasper
2790ea411b
Ensure i18n + trailingSlash works for different page types (#19331)
This adds additional test coverage and more handling for i18n + `trailingSlash: true`

Closes: https://github.com/vercel/next.js/issues/19069
2020-11-20 18:45:47 +00:00
Yuri Yakovlev
0c38922525
Update Tailwind example to v2.0 (#19278)
- Bump the Tailwind version to v2.0
- Add necessary latest `postcss` and `autoprefixer` deps
- Clean the tw config a bit
- Add dark mode styles
2020-11-20 18:18:49 +00:00
JJ Kasper
7782ba6ff8
Ensure export progress handles less pages than segments (#19281)
This updates the export progress to make sure we log out the final progress update when less pages than number of progress updates (segments). This also adds tests to ensure we are logging the progress out as expected. 

Fixes: https://github.com/vercel/next.js/issues/19122
Closes: https://github.com/vercel/next.js/pull/19123
2020-11-20 16:57:34 +00:00
JJ Kasper
5959f18431
Ensure non-configured i18n locales 404 (#19338)
This ensures navigations to non-configured locales causes the 404 page to be shown, it also adds tests to ensure direct visits for non-configured locales 404s correctly. 

Fixes: https://github.com/vercel/next.js/issues/19214
2020-11-20 15:07:00 +00:00
Shihabudheen US
fc9fa10618
Add note about disabling prefetching (#19299)
Added the line _Prefetch can be disabled by passing `prefetch={false}`._
2020-11-20 14:44:29 +00:00
JJ Kasper
13aa9d666c
Correct errsh links in config checks (#19280)
This makes sure we're using `next.js` in the err.sh links instead of `nextjs` since that leads to a 404
2020-11-20 13:04:18 +00:00
Karl Horky
65db069d3c
Upgrade Emotion example to React 17 and Emotion 11 and use automatic JSX runtime (#18620)
~~‼️ **Blocked** on https://github.com/vercel/next.js/issues/18096~~

Probably resolved here: https://github.com/vercel/next.js/issues/18096#issuecomment-729868888

Ref: https://github.com/emotion-js/emotion/pull/2062
Ref: https://github.com/emotion-js/emotion/issues/2041#issuecomment-720053255

Example upgrade here: f46407e345
2020-11-19 23:10:26 +00:00
JJ Kasper
13f8732f86
Add note to docs for i18n and next export (#19321)
This adds a note about current `i18n` support and `next export` since it is not currently supported as was mentioned in the [initial RFC](https://github.com/vercel/next.js/discussions/17078)

x-ref: https://github.com/vercel/next.js/issues/18318
2020-11-19 17:04:18 +00:00
JJ Kasper
8193df5309
Fix serverless with next start error case (#19288)
This fixes the case where we were returning page data when rendering `/_error` in `serverless` mode with `next start`

Closes: https://github.com/vercel/next.js/issues/19068
2020-11-19 16:25:54 +00:00
Sylvain Bannier
ce7ca2487b
Rewrite locale : fix wrong error message (#19319) 2020-11-19 16:04:55 +00:00
Lee Robinson
d47d83d88d
Update incremental adoption documentation. (#19286)
Some slight tweaks to match the corresponding blog post.
2020-11-19 00:10:12 +00:00
Joe Haddad
30c2dfdc47
Remove old modern mode experiment (#19275)
This PR removes the modern mode experiment because:

- It does not yield meaningful bundle size wins when compared to other initiatives we've taken
- It's not compatible with webpack 5 (which we're upgrading to)
- It's currently broken and causes most apps to malfunction
- There's no champion currently owning the experiment

We can re-introduce this in the future when we'd like to make it a default for all Next.js apps.

Note: **Next.js still supports Differential Loading (`nomodule`) and does it by default.** This PR strictly removes the experimental modern _syntax_, and does not disable our existing modern/legacy polyfilling.

---

Fixes #19200
Fixes #18960
Fixes #14707
Fixes #14465
2020-11-18 18:30:00 +00:00
Joe Haddad
ce5d9c858b
v10.0.2 2020-11-18 08:49:17 -05:00
Vitor Dino
c3293b730e
Fix docs about the return of getStaticProps on basic-features/pages (#19267) 2020-11-18 14:06:18 +01:00
Luis Alvarez D
b955268dbb
Update next/link docs to not include example without href (#19247)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-11-18 13:39:35 +01:00
Ondřej Chrastina
0f5db2a583
Fix link to developer plan in Kontent example (#19265) 2020-11-18 12:07:56 +01:00
Joe Haddad
5e5f206bcf
v10.0.2-canary.20 2020-11-18 00:49:44 -05:00
JJ Kasper
ca590c4cb9
Ensure i18n + trailingSlash: true handles correctly (#19149)
This ensures redirects are handled properly with i18n + `trailingSlash: true`, additional tests have also been added to ensure this is covered 

Fixes: https://github.com/vercel/next.js/issues/19069
2020-11-17 21:46:46 +00:00
JJ Kasper
2750880546
v10.0.2-canary.19 2020-11-17 12:54:56 -06:00
JJ Kasper
99e10a07fb
Ensure data prefetch for default locale is correct (#19085)
This makes sure SSG data is correctly prefetched for the default locale and other locales on the same page. Tests for this behavior have been added for catch-all and normal pages. 

Closes: https://github.com/vercel/next.js/issues/19048
2020-11-17 18:04:07 +00:00
Joe Haddad
ab0e2744ee
Upgrade styled-jsx (#19241)
This fixes compatibility with React 17 and `styled-jsx`.

Fixes #19242
2020-11-17 16:53:35 +00:00
Tim Neutkens
c283442ef0
Update 1.Bug_report.md 2020-11-17 14:11:11 +01:00
Lee Robinson
6826ddf9d7
Add docs on incrementally adopting Next.js. (#19226)
Building off the "Migrating to Next.js" section started, this doc provides information on using `rewrites`, `redirects`, and micro-frontends to incrementally adopt Next.js in your codebase.
2020-11-17 12:51:12 +00:00
GH Lee
23111ca057
Update fast-refresh.md (#18047)
ref. https://github.com/vercel/next.js/pull/14519, https://github.com/vercel/next.js/pull/15062
Add limitation for Anonymous arrow functions.
2020-11-16 22:46:43 +00:00
Paul van Dyk
feb10f45c1
Update with-magic example (#19207)
fixes the event argument inside the function call
- argument is `e` but `event` was used instead
2020-11-16 16:50:58 +00:00
Luis Alvarez D
43e7561240
Update multi zones example (#16281)
~Updated the `with-zones` example and docs to use `@vercel/next` instead of `@now/next` and also updated the readme instructions with better steps.~

~Related to https://github.com/vercel/next.js/issues/12317 - Looks like there may be an issue with the example but it continues to work as expected to me, moving away from `@now/next` may help.~

Fixes https://github.com/vercel/next.js/issues/12317
Closes https://github.com/vercel/next.js/issues/12317

Moved the example to use [Vercel Monorepos](https://vercel.com/blog/monorepos). Locally it switches to `next dev` instead of `vercel dev`.
2020-11-16 16:21:13 +00:00
Abdullah Mzaien
208551fca4
Upgraded to chakra V1 (#19181)
Upgraded charkra ui and peer dep and fixed the icon to follow the new api
2020-11-16 15:15:48 +00:00