Commit graph

2150 commits

Author SHA1 Message Date
Markus Maerzhase
fa8ab993d0
Fix with-firebase-hosting running locally (#21971) 2021-02-09 08:52:21 -06:00
Smit Barmase
74e0c6d6d8
with-apollo SSR example added. (#21956)
Co-authored-by: Lee Robinson <me@leerob.io>
2021-02-08 23:12:01 -06:00
Espen Hovlandsdal
394bbf6207
Improve sanity.io example (#18227) 2021-02-08 21:54:01 -06:00
Kazutaka NAKAMURA
5d5862693f
Upgrade packages for example/with-typescript-eslint-jest (#21963) 2021-02-08 21:08:26 -06:00
Joost Jansky
e69a4d7a23
[examples] Added blog-starter example using Ghost CMS (#19990) 2021-02-07 12:27:47 -06:00
GH Lee
fb843a5577
[examples] Fix for custom server SSR caching (#18786) 2021-02-07 12:20:00 -06:00
Michael McQuade
1773b991bc
[examples] Wrap entire app with Styletron provider for with-styletron (#21908) 2021-02-07 11:30:41 -06:00
Rafael Laurindo
984a78d545
Update React version in Tailwind example (#21906)
This PR updates the React packages version in the example with Tailwind.
Thus solving the new version notice when starting the project in dev.

Notice screenshot: 📸 
![image](https://user-images.githubusercontent.com/25041169/107084102-5bc0f780-67d5-11eb-82bb-b9ea2682ec5c.png)

Now with the updated version:📸 
![image](https://user-images.githubusercontent.com/25041169/107084154-71ceb800-67d5-11eb-95c9-54ea534145dd.png)
2021-02-05 20:29:20 +00:00
Flavio Wuensche
ee184a11d8
Add example for headers and link in the docs (#21821) 2021-02-05 09:07:22 -06:00
Kazutaka NAKAMURA
a98ba4c808
Update react to 17.0.1 in example/with-typescript-eslint-jest (#21870)
I met following warning message after invoking create-next-app for ` example/with-typescript-eslint-jest `:

```
 % yarn dev
yarn run v1.22.10
$ next dev
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
warn  - React 17.0.1 or newer will be required to leverage all of the upcoming features in Next.js 11. Read more: https://err.sh/next.js/react-version
event - compiled successfully
```

I have followed the instructions in the link, and this patch is. Please merge this.

Thank you for reading.
2021-02-04 20:13:57 +00:00
Pete Correia
9a930b69e5
Fix Linaria link (#21826) 2021-02-04 08:12:19 +00:00
Lee Robinson
5536526826
Remove dotenv from Relay example. (#21814)
Address one of the bullet points from https://github.com/vercel/next.js/issues/15225 to remove unused dependencies on `dotenv` now that it's supported by default in Next.js.
2021-02-03 19:33:51 +00:00
Balázs Orbán
e750f4378c
fix: send url to gtm.pageview (#21747)
`gtm.pageview` was called without sending an actual URL, while it is required here:

36aeca8f04/examples/with-google-tag-manager/lib/gtm.js (L3-L6)
2021-02-03 15:28:25 +00:00
Michael McQuade
4cadb68dfe
Return a number from sort compare function (#21763)
Changed the return values of the compare function from string values to numbers
2021-02-03 15:21:11 +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
Matt Ruby
8f0c15544d
Grammatical fixes (#21644) 2021-01-28 22:52:56 +00:00
Luis Alvarez D
0370c037fc
Update links that go to vercel.com/now (#21556) 2021-01-26 18:59:01 +00:00
Kazutaka NAKAMURA
07d4af9307
suppressing eslint warning (#21163) 2021-01-26 10:22:43 -05:00
Ymir
9a63f3ca8a
Corrected links in with-yarn-workspaces (#21523) 2021-01-25 12:34:40 -05:00
Dominik Felber
1dc430883e
Update dependencies of with-tailwindcss example (#21517) 2021-01-25 12:10:32 -05:00
Burak Tokak
130039c3e5
Add "title" as the source for "slug" in cms-sanity example (#19867)
* add "title" as the source for "slug"

* Fix linting

Co-authored-by: Tim Neutkens <timneutkens@me.com>
2021-01-25 14:46:51 +01:00
Nick Carchedi
379c4c4e33
Bring Tailwind CSS example in line with official Tailwind docs (#19750)
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2021-01-25 14:20:14 +01:00
Robin
c47f3d84c4
Unify installation scripts for example apps (#19808) 2021-01-24 17:05:49 +01:00
Kevin Jennison
450e7130b0
Add example: Firebase authentication + SSR (#15202)
Co-authored-by: Luis Alvarez D. <luis@vercel.com>
2021-01-23 15:49:14 +01:00
Max Nowack
f2de5a08b8
Fix typo in Header component of with-iron-session example (#21428)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-01-22 14:14:55 +01:00
Hank Andre
372fb5dc53
refactor(with-tailwindcss-emotion): example remove styles directory (#21368)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-01-22 12:16:57 +01:00
MMT-LD
60b0267400
feature/vanilla-emotion - add an example of vanilla emotion (#20228)
Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2021-01-22 12:16:50 +01:00
Michael McQuade
ded6e24b3d
Use autoprefixer instead of postcss-preset-env (#21215)
I realized while looking over this that the `autoprefixer` plugin isn't being used by postcss because it's not included in the `postcss.config.js`. Additionally, since `postcss-preset-env` doesn't support PostCSS 8 yet, and it includes PostCSS 7 as a dependency, I've removed that package. 

There is an open issue to add PostCSS 8 support to `postcss-preset-env` [here](https://github.com/csstools/postcss-preset-env/issues/191). @kripod's comments on my other PR #20956 are what prompted me to check this out. 

On a side note, it looks like all the CMS examples use Tailwind CSS v1 still, so that's something someone (possibly myself) could tackle later.
2021-01-22 06:13:33 +00:00
Lindsey Simon
7602cfad32
Adds optional REDIS_PASSWORD env var to make setup with RedisLabs work easily for the with-redis example (#21432)
Easy to add one more optional password env var locally and a few lines of code to make the example app work with RedisLabs as well.
2021-01-22 00:28:27 +00:00
Shashi Srinath
9fd9d83221
added an ipcRenderer usage sample to the electron-typescript example (#20000)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-01-21 16:37:40 +01:00
Thor 雷神 Schaeff
0bd175264b
Update Supabase example. (#21200) 2021-01-19 07:10:56 -06:00
Luis Alvarez D
e28fd50441
Include utm_source on example links to vercel.com (#21305) 2021-01-19 07:28:54 +00:00
Ben Botvinick
cf916f9906
Add useCreateIndex to mongoose connection options (#21145)
To prevent `DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead.`
2021-01-15 09:57:52 +01:00
Lee Robinson
dc87a8436b
Update redirected or broken Vercel docs links. (#21119) 2021-01-14 15:37:21 +00:00
Ludovico Fischer
406c996189
fix: bump node-sass peer dependency (#21084)
Get rid of the unmet peer dependency warning when installing
a next.js project wtih node-sass 5.

node-sass 5 is the currently maintained version and removes
support one deprecated API and Node.js versions that Next.js does
not support either. Next.js uses node-sass 5 in devDependencies.

node-sass changelog: https://github.com/sass/node-sass/releases

On the other hand, as the docs encourage the sass package instead of node-sass,
(see errors/duplicate-sass.md)
I have updated examples which used node-sass 4 to the latest sass instead.
2021-01-14 02:26:01 +00:00
Lee Robinson
92637a9b08
Update with-polyfills example. (#20996)
From https://github.com/vercel/next.js/discussions/20992.
2021-01-13 14:00:50 +00:00
Ludovico Fischer
b3a631305d
fix(examples): make with-graphql-hooks run correctly again (#20929)
Fixes #20474

* Switch API url to working URL used in apollo example
* Update deps
* Move styled jsx out of the way to avoid demonstrating too many
  unfamiliar concepts at once

dev, build and start work now.
2021-01-11 13:55:18 +00:00
Almad
920c22157c
Use archive link for electron-next in the examples (#20879)
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2021-01-11 13:53:31 +01:00
Tom
06efca998a
Update Supabase Quickstart Screen + Tailwind 1.x to 2.x (#20770)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-01-11 10:44:38 +01:00
Tom
8bfe06e899
GraphCMS example - Upgrade to React 17 / Tailwind 2 and next/image (#20772) 2021-01-11 10:29:05 +01:00
taisei mima
d0f1e33d53
Fix with-three-js example (#20897) 2021-01-11 10:28:43 +01:00
Michael McQuade
d9f1cf007f
Fix error in example (#20934) 2021-01-11 10:28:31 +01:00
Michael McQuade
8d7e7d526c
Update PostCSS plugin list in README (#20956) 2021-01-11 10:27:21 +01:00
Victor Assis
86bb064578
Improve with firebase cloud messaging (#20868) 2021-01-11 10:14:14 +01:00
Zain Fathoni
77a2eeb194
Fix an error in Kontent CMS example caused by a file name typo (#20863)
![image](https://user-images.githubusercontent.com/6315466/103914132-57f17500-5144-11eb-9a21-ff27bea14f29.png)
2021-01-07 16:18:01 +00:00
Luc Leray
b442acbe1c
Replace zeit/next.js with vercel/next.js (#20849) 2021-01-07 08:41:04 -05:00
Luc Leray
8eaabe2fb0
Fix deploy buttons URLs (#20834)
Fix all deploy button URLs in the Next.js repo to follow the following format:
```
https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/<EXAMPLE_NAME>&project-name=<EXAMPLE_NAME>&repository-name=<EXAMPLE_NAME>
```

The detailed docs for the Deploy Button can be found here: https://vercel.com/docs/more/deploy-button.

Also updates legacy Vercel import flow URLs (starting with vercel.com/import or with vercel.com/new/project), to use the new vercel.com/new URLs.

---

For example, for the `hello-world` example:

The URL is https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/hello-world&project-name=hello-world&repository-name=hello-world

And the deploy button looks like this:
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/hello-world&project-name=hello-world&repository-name=hello-world)

---

For reference, I used the following regexes to search for the incorrect URLs

```
\(https://vercel.com/import/git\?s=https://github.com/vercel/next.js/tree/canary/examples/(.*)\)
\(https://vercel.com/import/git\?c=1&s=https://github.com/vercel/next.js/tree/canary/examples/([^&]*)(.*)\)
\(https://vercel.com/import/project\?template=https://github.com/vercel/next.js/tree/canary/examples/(.*)\)
https://vercel.com/import/git
https://vercel.com/import/select-scope
https://vercel.com/import
https://vercel.com/new/project
```
2021-01-07 01:40:29 +00:00
Simon Taggart
66a49721d5
feat: add Twilio Paste example (#20587)
* feat: add Twilio Paste example

* Updated readme

Co-authored-by: Luis Alvarez <luis@vercel.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-01-06 13:49:57 -05:00
Bar
54102b0a04
Update gtm.js (#20807) 2021-01-06 13:15:26 -05:00
Shu Uesugi
817cffdcbe
Use vercel.app for blog starter URL (#20820)
Rename https://next-blog-starter.now.sh to https://next-blog-starter.vercel.app (@lfades renamed the domain name)
2021-01-06 18:13:40 +00:00
Sebastian König
5fc8d48732
Added with-mqtt-js example (#17939)
* Added with-mqtt-js example

* Fixed eslint/prettier errors

* Update README.md

* Updated with-mqtt-js to latest next/react versions, WIP: Refactoring useMqtt()

* A2PC

* Working example, unrefactored

* A2PC

* Ran prettier

* Used NEXT_PUBLIC_ prefix instead of keys as props

* Updated readme and added .env.local.example

Co-authored-by: Sebastian König <sebastian_koenig@cotyinc.com>
Co-authored-by: Luis Alvarez D <luis@vercel.com>
2021-01-06 12:06:56 -05:00
Farhan Ullah
9a73db703f
Fix: Build time error for with-mysql example #19635 (#19636) 2021-01-06 11:27:59 -05:00
Michael Aufreiter
ccf26a850d
Guard useSwr() to avoid sending invalid request (#20671) 2021-01-06 10:59:18 -05:00
Benjamin Bender
1a3adaa5d9
Fix mini typo in with-cookie-auth-fauna-example (#20808)
Fix mini typo
2021-01-06 09:13:45 +00:00
Josh
51f2a530d6
Updated deploy button URL (#20756)
* Updated deploy button URL

* Update bottom button
2021-01-05 17:36:33 -05:00
Thomas Wang
356bcdec03
Move window check to after initializing Firebase (#20764)
You can initialize the Firebase app instance without checking for window, but it is required for using the analytics module.
2021-01-05 21:59:37 +00:00
kaykdm
b6c6770cd9
Fix with-react-intl example (#20763)
Co-authored-by: Kanta Kodama <kanta.kodama@linecorp.com>
2021-01-05 11:44:40 -05:00
Tom
6fd877ff34
fix deploy button + create-next-app command (#20777) 2021-01-05 11:43:27 -05:00
Tom
266a4d33b1
fix deploy button (#20774) 2021-01-05 11:42:23 -05:00
Tuan Nguyen
873bf5dd76
Remove an undefined parameter (#20762)
`getLoginSession` takes only one argument
2021-01-05 14:26:06 +00:00
Lee Robinson
5678d24f56
Add new example for rate limiting API routes. (#19509)
Adds an example using `lru-cache` to implement a simple rate limiter for API routes ([Serverless Functions](https://vercel.com/docs/serverless-functions/introduction)).

**Demo: https://nextjs-rate-limit.vercel.app/**
2021-01-04 22:19:31 +00:00
zoomdong
87c97fd3e7
Update with-antd example (#19699)
https://ant.design/docs/react/getting-started#Import-on-Demand
At the document, We don't need to use `babel-import-plugin` to `Import on Demand`.
2021-01-04 21:34:28 +00:00
Manaia Junior
2e8259ffdc
Update withUser to useUser in README.md of the example with-iron-session (#20723) 2021-01-04 21:13:32 +00:00
Justin Philpott
2a4887c30a
New example: /with-storybook-styled-jsx-scss (#18570)
Hi, 

I'm submitting this PR for consideration as a new example app showing Styled JSX with SCSS working inside and outside storybook with example components.

Only known issue: I noticed that when running this example with:

`$ yarn next ./examples/with-storybook-styled-jsx-scss`

I receive the following error:

```
error - ./pages/_app.js
Error: [BABEL] .../next.js/examples/with-storybook-styled-jsx-scss/pages/_app.js: Cannot find module 'styled-jsx-plugin-sass' (While processing: ".../next.js/node_modules/next/babel.js")
```

However I notice that this same missing module error is triggered when running this existing example app "with-styled-jsx-scss".

Any changes/tweaks needed?

Thanks!
2021-01-04 20:46:34 +00:00
mongolyy
7f23954f7e
Update database config explanation in with-firebase-app example (#20709)
I made the following changes.

- Addition of procedure for setting private_key
- Addition of procedure for creating a database and setting database_url
2021-01-04 20:25:57 +00:00
Kristoffer K
104b8d4732
fix(next-mdx): resolve webpack loader (#17983)
**What's the problem this PR addresses?**

`@next/mdx` adds the webpack loader `@mdx-js/loader` without resolving it to an absolute path

Depends on https://github.com/vercel/next.js/pull/17606

**How did you fix it?**

`require.resolve` the webpack loader before adding it
2021-01-04 16:24:16 +00:00
Vitali Zaidman
9ff378559d
Improve the "why did you render" library example and readme (#20712) 2021-01-03 16:21:33 +00:00
Justin Eder
9ded7aa955
Update to Tailwind CSS 2.0 in blog-starter-typescript example (#20664)
This updates the blog-starter-typescript example to use the latest version of Tailwind CSS (2.0.2)

Notes:
Followed the upgrade guide here: https://tailwindcss.com/docs/upgrading-to-v2 
And Next / PostCSS guide here: https://nextjs.org/docs/advanced-features/customizing-postcss-config
2021-01-01 18:45:55 +00:00
Luke Harries
16d464caf6
Fix withSourceMaps is not a function (#20643)
In order to get this example working, I needed to remove the invocation as described here: https://github.com/vercel/next-plugins/issues/309#issuecomment-674376348
2020-12-31 22:00:41 +00:00
enoch ndika
44ee7de664
example with-mdbreact (#19879)
This example illustrates how to integrate mdbreact (material design bootstrap for react) with next.js
2020-12-31 18:46:10 +00:00
Tom
bd4eb9ea41
fix mongoose not latest next.js version (#20644) 2020-12-31 11:33:24 -05:00
Greg Rickaby
305b15e089
Update blog starter example (#19698)
* bump dependencies to latest versions

* use tailwindcss class names

* use next/image component

* pass in height & width. update tailwindcss classes

* update tailwindcss classes

* mention tailwindcss 2.0
2020-12-30 19:04:23 -05:00
mustafaKamal-fe
4e27e00c30
Update dbConnect.js (#19644)
* Update dbConnect.js

The previous logic was in my opinion prone to errors in situations when different calls to this function from different locations may happen at the same time ( like a race condition  ). If the readyState is anything but not 0, then we must not try to perform a new connection as this may cause consequent connections!

I hope this makes sense

* Update examples/with-mongodb-mongoose/utils/dbConnect.js

* Lint fix and minor changes

Co-authored-by: Luis Alvarez D <luis@vercel.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-12-30 15:18:32 -05:00
Luis Alvarez D
b540054388
Update authentication examples (#19330)
* Updated example readme

* Updated with-passport example

* Updated profile page for with-passport

* Updated with-passport-and-next-connect

* Updated with-magic

* Updated with-magic readme

* Updated with-iron-session

* Updated next version in with-iron-session

Co-authored-by: Lee Robinson <me@leerob.io>
2020-12-29 12:43:47 -05:00
Vojtech Miksu
2433c11946
Update with-styletron example to not use DebugEngine (#20233)
[DebugEngine stopped working](https://github.com/styletron/styletron/issues/366) with v9.5 since the devtool is strictly set to eval and this option is not customizable. Unfortunately there is currently no way to fix this.
2020-12-29 16:39:12 +00:00
Pier-Luc Gendreau
e6c351859f
Update with-mongodb to be TypeScript-friendly (#19383)
* Update with-mongodb to be TypeScript-friendly

I slightly modified the approach so TypeScript can correctly infer types without actually having to type anything but the global:

**index.d.ts**
```ts
import { Db, MongoClient } from "mongodb";

declare global {
  namespace NodeJS {
    interface Global {
      mongoCache: {
        conn: {
          client: MongoClient | null;
          db: Db | null;
        }
        promise: Promise<MongoClient> | null;
      };
    }
  }
}
```

* lint

Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-12-28 14:40:18 -05:00
Branden Dane
9553b6da67
with-zustand example fix for build error on ssr page (#19465) 2020-12-28 14:34:26 -05:00
Donavon West
47433b62ba
Correct import comment in interfaces (#20052)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-12-28 14:25:01 -05:00
Jens Meindertsma
bc403af001
Update with-msw example (#20335)
* Update with-msw example

* Update README

* Update examples/with-msw/README.md

* lint fix

Co-authored-by: Luis Alvarez D <luis@vercel.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-12-28 14:22:10 -05:00
Jesse Jafa
556ab4f169
Upgrade Tailwindcss to 2.0.2 (#20517)
Normally I wouldn't make a PR for a minor version upgrade, but the 2.0.2 version contains some important performance improvements.
https://github.com/tailwindlabs/tailwindcss/pull/3032
2020-12-28 17:36:32 +00:00
Sung Hah Hwang
c759abe8a4
Update README.md (#19885)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-12-28 16:58:40 +00:00
xiaooye
e87b05f066
Update README for with-emotion example (#20338)
Change README from outdated @emotion/core to @emotion/react
2020-12-28 16:35:36 +00:00
armspkt
e4da4e5aaa
fix example using-router import wrong pathname (#20536)
![image](https://user-images.githubusercontent.com/49720317/103223063-07b23000-4958-11eb-8bf9-09c39231a092.png)

About page import wrong pathname causing warning like this.
2020-12-28 15:26:38 +00:00
Laura Beatris
d96de6ea6b
Fix typos found on examples docs (#20516)
This PR fixes some typos found on examples docs
2020-12-27 17:14:58 +00:00
Laura Beatris
bad1448478
Style improvements on MongoDB example (#20515)
I've looked at the example code and saw some consistent issues related to code style. The changes applied to this PR fixes the following points:

- Differences of line breaks styles between multiple files
- Differences of if statements styles
- Unnecessary comment
- A typo on a JSDocs

---

There were line breaks between statements on `pages/index.js`
````
export async function getServerSideProps(context) {
  const { client } = await connectToDatabase()

  const isConnected = await client.isConnected() 

  return {
    props: { isConnected },
  }
}
```` 

And this wasn't being applied to the MongoDB utility:

````
export async function connectToDatabase() {
  if (cached.conn) return cached.conn
  if (!cached.promise) {
    const conn = {}
    const opts = {
      useNewUrlParser: true,
      useUnifiedTopology: true,
    }
{...}
````

And also, as shown in the snippet above, there are different styles of if statements being used. 

With that being said, the reason I made this PR is because I think that this kind of inconsistent arises questions when a contributor looks to the codebase, even if this is a simple example.
2020-12-27 16:20:15 +00:00
Nicolás Figueroa
27bb24fe35
example with-google-tag-manager (#20042)
Hi ✌️

I've seen that many people have problem with implement Google Tag Manager, I've created an example of how insert "Google Tag Manager" in a NextJs app
2020-12-25 21:17:14 +00:00
Max Romanyuta
c8837dcbda
Upgrade all http links to https (#20402)
Upgraded all `http` links to `https` that support the `https` protocol.

Llinks
-----
- https://github.com/
- https://koajs.com
- https://ant.design
- https://www.carbondesignsystem.com/components/overview
- https://themes.carbondesignsystem.com
- https://knexjs.org
- https://jxnblk.com/rebass
- https://i.imgur.com/JCxtWSj.gif
- https://react.semantic-ui.com
- https://stomp.github.io
- https://videojs.com
2020-12-22 21:41:27 +00:00
Darsh Patel
bad9a8c960
Fix: progressive-web-app example (#20288)
Fixes: #20289 
I noticed the following errors about missing icon files while working on the progressive-web-app example
<img width="639" alt="Screenshot 2020-12-18 at 9 16 25 AM" src="https://user-images.githubusercontent.com/11258286/102572751-e3ae4d80-4112-11eb-896a-2facfb5e16d3.png">

I've added the missing icon files and updated the path :)
2020-12-18 10:13:02 +00:00
Vishnu Paduchuri
ce4def79b3
Sentry URL for Organization (#20269)
Build Fails due to Invalid Token error, adding SENTRY_URL fixed the issue.
2020-12-18 09:07:23 +00:00
ykdojo
cfca41cbfd
Fix a link to a Slack clone example in Supabase (#19993) 2020-12-17 09:35:13 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Ondřej Chrastina
0f5db2a583
Fix link to developer plan in Kontent example (#19265) 2020-11-18 12:07:56 +01: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
Yordis Prieto
1e3534e169
Add apollo state func (#19137)
The intention is to show people the correlation between things, in this case, understand the usage of the same key from the props and the rehydration.

Hopefully, this change will bring value as it has done with some Juniors already.
2020-11-15 23:04:22 +00:00
Steven
17a53e2765
Revise image example with layouts near the top (#19161)
This page is useful for testing out layouts so we moved that section to the top.
2020-11-14 02:00:02 +00:00
Tony Spiro
f4c2c6d4d1
Upgrade Cosmic example to Next.js 10, image load fix, post sorting by -created_at (#18310) 2020-11-13 23:22:06 +00:00
xeust
cd1e2e1d60
Example: Deta Base (#19061)
Add an example for using Next.js with Deta Base on Vercel.
2020-11-13 23:00:30 +00:00
Akuma Isaac Akuma
7631c1cac5
Added query object as property to url object (#18340)
`url` object is an instance of `url.URL` which has no property called `query` and it's causing an error with Next image-optimizer as you can see with the error log below.

```log
TypeError: Cannot destructure property 'url' of 'parsedUrl.query' as it is undefined.
    at imageOptimizer (/[redacted]/node_modules/next/next-server/server/image-optimizer.ts:51:11)
    at Object.fn (/[redacted]/node_modules/next/next-server/server/next-server.ts:617:11)
    at Router.execute (/[redacted]/node_modules/next/next-server/server/router.ts:200:40)
    at DevServer.run (/[redacted]/node_modules/next/next-server/server/next-server.ts:1017:41)
    at DevServer.run (/[redacted]/node_modules/next/server/next-dev-server.ts:406:18)
    at DevServer.handleRequest (/[redacted]/node_modules/next/next-server/server/next-server.ts:437:14)
    at /[redacted]/server/next-wrapper.ts:9:5
```
2020-11-12 21:23:58 +00:00
LittleboyHarry
08ce06a3ef
Improve with-electron-typescript example (#18277)
1. updates the `.gitignore` for this example to ignore the temporary output folders. ( similar to #15783 )
2. change yarn run script to npm run script ( I don't like use yarn currently. )
2020-11-12 21:02:43 +00:00
Mihai Pocorschi
08f6c57efb
fixed project name to reflect example name in readme (#19056) 2020-11-12 01:51:27 -05:00
George
9b4a63402d
fix(examples/with-chakra-ui): Fixed Spelling (#19088) 2020-11-12 00:56:26 -05:00
Yann Pringault
d2b017c519
[examples/blog-starter-typescript] Upgrade to TypeScript v4 (#18225)
Co-authored-by: Luis Alvarez D <luis@vercel.com>
2020-11-11 21:34:30 -05:00
jose-donato
e827925735
Example for adding a service worker into a next.js application (#17855)
Example for adding a service worker without any plugin or custom server
2020-11-12 01:09:25 +00:00
Lucas Varela
7fd04c956d
Add self-hosted information to with-sentry example (#18102)
* Add info about SENTRY_URL on source map uploading

* Update examples/with-sentry/README.md

Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Luis Alvarez D <luis@vercel.com>
2020-11-11 19:47:11 -05:00
Vyacheslav Konyshev
e6a6beb38d
fix(examples/with-firebase-cloud-messaging): replace deprecated method (#19080) 2020-11-11 18:41:37 -05:00
Jose Manuel Casani Guerra
f226a376b1
refactor: update example of storybook (#17936)
## Change

- Update package versions
- Replace @storybook/addons, @storybook/addon-actions to @storybook/addon-essentials
- Replace examples of button, the action function is legacy: https://storybook.js.org/docs/react/essentials/actions#advanced--legacy-usage
2020-11-11 23:14:42 +00:00
Marco Valsecchi
27691d5882
Use useRouter over Router for with-react-ga example (#17710)
Use useRouter over Router and add a workaround for the issue #11639
2020-11-11 22:33:15 +00:00
Daniel Stocks
44932612f8
Fixed missing SSR styles in with-fela example (#17647)
Added `<Html>` and `<Head>` components in the custom `_document.js` for the with-fela example package

This fixes an issue where fela `<style>` tags were not added and sent as part of the server-side rendered HTML payload, causing a FOUC.
2020-11-11 20:12:51 +00:00
Kanitkorn Sujautra
6de34e7557
Add missing dependency to with-typescript-eslint-jest (#17864)
In `with-typescript-eslint-jest` example, `identity-obj-proxy` is being used here, but it's not in `package.json` yet.
5b1be2bb98/examples/with-typescript-eslint-jest/jest.config.js (L14)

This PR adds `identity-obj-proxy` to `package.json`.
2020-11-11 00:14:03 +00:00
Ante Sepic
e404b9962b
[Examples] Prevent getStaticProps from returning "undefined" (#19012)
If the example is cloned and ran with no further setup (no environment variables set up), it will error out because `extractPostEntries` will return `undefined` which can not be serialized by `getStaticProps `.

This PR basically ensures that we return an empty array instead of the `undefined` for a collection of posts, and a `null` instead of the `undefined` for a single post.
2020-11-10 23:33:51 +00:00
Callum Booth
f300ecaa94
Feat(example): Add with-zustand example (#17835)
Helps with https://github.com/pmndrs/zustand/issues/182 

I have seen the comments from this PR https://github.com/vercel/next.js/pull/11222#pullrequestreview-406998918 and this PR matches the with-redux example.
2020-11-10 23:06:49 +00:00
Ash Connell
b8c49ae97a
Add with-knex example (#17904)
* Add with-knex example

* Fix with-knex README typo

Co-authored-by: Ash Connell <hello@ashconnell.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-11-10 17:45:21 -05:00
WeichienHung
a2bea9b492
Add mutation example to with-typescript-graphql (#16742)
Fixes  https://github.com/vercel/next.js/issues/16550

Add a graphql mutation operation in this example.
The changes are:
1. Define mutation in schema `type-defs.graphqls`
2. Add mutation to `viewer.graphql ` that compiled to typescript code.
3. Add mutation resolver in `resolvers.ts`
4. [UI] add a input box and button to submit mutation request to change name. 

screenshot of change
![mutation_example](https://user-images.githubusercontent.com/1462027/91797123-5ffc4e00-ec54-11ea-910b-3ddb399b42f0.gif)
2020-11-10 21:10:54 +00:00
Steven
70d8d8c9f2
Fix ViewSource component in the docs (#19022)
This PR moves the `<a>` element inside the `<svg>` element.
2020-11-10 17:02:39 +00:00
David Golden
d5daa06654
Upgrade with-mobx example (#17921)
upgrade mobx dependencies for with-mobx example and make all necessary code changes as per https://mobx.js.org/migrating-from-4-or-5.html

addresses #17809
2020-11-09 22:50:47 +00:00
Galanggg
435d4586df
Add with-gsap example (#17195)
This PR adds an example Next.js project with GSAP
![example-next-gsap](https://user-images.githubusercontent.com/21099312/93552465-170dfe80-f9a3-11ea-978c-4e1dc01731e8.gif)
2020-11-09 20:38:07 +00:00
Weston Thayer
6aef4b8445
Update with-sentry example to show how to track API routes + bug fixes (#16484)
## New features

- Example of how to use `Sentry.captureException()` in API routes 5a35982717

## Bug fixes

- Server-side source maps now work in Sentry when deployed to Vercel 629a9ed504
- If uploading source maps, `Sentry.init()` now sets the `release`, so that exceptions are correctly associated with the source maps in that release

## Open issues

### `_error.js` is unused for `getServerSideProps` errors when deployed to Vercel

Instead of rendering this example's overridden `_error.js` (like it does when testing locally with `NODE_ENV='production'`), when deployed to Vercel and an Error is thrown from `getServerSideProps`, this page is shown:

![Screenshot of Vercel Application Error page](https://user-images.githubusercontent.com/709153/90968889-aa3c3d00-e4a6-11ea-9eff-fafee3d1ff33.png)

This confuses me because the Error is still successfully sent to Sentry, but I would've expected it to be sent by the call to `Sentry.captureException()` in `_error.js`. I'm not sure why it works.

### API test 2 & 3 don't work in the "server" build config

They don't work when deployed to Vercel in the "serverless" config either, but that's expected because there aren't any handlers to flush the Sentry queue. I can't figure out why they don't work in the long-lived "server" config.
2020-11-09 18:36:36 +00:00
Davidson Nascimento
019bbb284a
chore: fix some with-electron-typescript example setup (#18976)
- Changed script `start` to `dev` and improved it #18934 adding commando to transpile electron code;
- Added some folders into `.gitignore`;
- Updated react to avoid issues as #18916

Fixes #18934
2020-11-09 13:34:16 +00:00
Jesse Jafa
50a416a53c
Fixes with-chakra-ui example error (#18954)
Resolves https://github.com/vercel/next.js/issues/18941
2020-11-09 03:03:26 +00:00
Davidson Nascimento
7820468401
chore: updated react to v17 on with-webassembly example (#18916) 2020-11-07 13:13:24 -05:00
Ante Sepic
3f4872aa67
[Examples] Switch contentful example to graphql (#15223)
Now that all Contentful spaces support GraphQL, we are looking into switching the example from using a JS library to a simple fetch with GraphQL.

@stefanjudis ☝️
2020-11-07 00:51:59 +00:00
Steven
37fb0ad220
Update image example with link back to source code (#18909)
Fixes #18908
2020-11-06 17:13:01 -05:00
Bruno Crosier
b471b3b29e
Add <a> to <Link> (#18900)
Co-authored-by: Luis Alvarez <luis@vercel.com>
2020-11-06 16:03:24 -05:00
Prottay Rudra
ac54573b74
Updated chakra-ui dependencies (#18881)
- new chakra-ui rc version doesn't work without 'farmer-motion', installed farmer motion
- updated 'chakra-ui' library from '^1.0.0-rc.3' to '^1.0.0-rc.8'
2020-11-06 06:10:01 +00:00
Steven
b684b110e4
Add props objectFit and objectPosition to Image component (#18849)
Fixes #18794
2020-11-05 19:42:55 +00:00
Matthew Lilley
8e9e9494dd
Fix issues with apollo cache data merging and restoration (#17681)
This PR fixes issues in two apollo examples where cached queries are lost, and cached data is merged incorrectly.
2020-11-05 18:24:39 +00:00
Vitor Dino
6ea504a6a0
feat(examples): use next-plugin-preact on using-preact example (#18588)
hey there 👋 

stumbled on the [`using-preact` example](https://github.com/vercel/next.js/tree/canary/examples/using-preact) first when i tried to port my project, just saw that the [config wasn’t that trivial](https://github.com/vercel/next.js/issues/13969#issuecomment-641540051), and it would fit better on a [plugin](https://github.com/preactjs/next-plugin-preact)..

I did this migration first on my project (it worked super well) and realized that people also would dislike having to maintain that kind of code, and would stumble faster on the plugin if it was already on the official example 
2020-11-05 16:56:58 +00:00
Steven
35f8f521a2
Update Image docs with links to examples (#18770)
This revises the docs to add headings and also links to layout examples.

Fixes #18554
2020-11-04 17:24:14 +00:00
Matsumoto Toshi
5ecdcab648
fix: Using getIdToken to get a token (#18599)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-11-03 20:40:42 -05:00
Steven
d4a92d92ba
Update example for Image Component (#18762) 2020-11-03 15:40:53 -05:00
Aral Roca Gomez
44ea598f88
Update next-translate example to support Next 10 with i18n routing (#18480)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-11-03 09:48:26 -05:00
Carmelo Scandaliato
197d46ddb9
Remove the static optimization indicator (#18629)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-11-02 09:27:36 +01:00
Daniel Treviño
a6660729ea
fix: issue #18360 - loading spinner not showing up (#18527)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-10-30 13:48:55 -05:00
ospira
3bbb35c323
small tweaks for those testing on an existing site with missing autho… (#18506)
* small tweaks for those testing on an existing site with missing author or featured image on posts

When migrating WordPress or using an exisitng site, sometimes you have published posts wth missing data. The graphql plugin will properly resolve these to null, but some of existing code accessing tries to access the node property on these null values. I've made these properties optional in the pages and also tweaked some of the components along similar lines.

* Lint fix

Co-authored-by: Luis Alvarez <luis@vercel.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-10-30 13:45:18 -05:00
Yudai Oriver K
61981da9e0
Fix i18n-routing Vercel deploy button URLs (#18524)
Fixes #18523

## description
The i18n-routing Vercel deploy button URLs was:
https://vercel.com/import/project?template=https://github.com/vercel/next.js/tree/canary/examples/amp

So, I fixed the URLs for examples/i18n-routing:
https://vercel.com/import/project?template=https://github.com/vercel/next.js/tree/canary/examples/i18n-routing
2020-10-30 15:44:21 +00:00
Yuji Matsumoto
629884af7d
Update using-preact example's dependencies (#18493)
- Update Next.js version to 10.0.0
- Update the other dependencies
- Modify `next.config.js` to prevent circular `__self` and `__source`in dev env (ref: https://github.com/developit/nextjs-preact-demo/issues/25)
2020-10-29 22:52:27 +00:00
Joris W
7d4b36cccd
Fix GSP page titles in i18n-routing example (#18465) 2020-10-29 12:48:12 +01:00
Jip Sterk
e058fa49d0
remove unneeded deps & updated example (#17651)
Closes #17626
2020-10-29 02:31:17 +00:00
Sebastian Troć
4caf98efbf
Tweak Image Optimization URL in example (#18355) 2020-10-28 13:04:09 +00:00
Quinn Turner
6d4395f22c
fix: Order moduleFileExtensions left-to-right (#18328)
Order moduleFileExtensions from most used to least used extensions.

Sources: https://jestjs.io/docs/en/configuration#modulefileextensions-arraystring
and facebook/jest#7616
2020-10-27 20:20:03 +00:00
JJ Kasper
1b22a39eb1
Add initial example for i18n routing (#18206)
This is a follow-up to https://github.com/vercel/next.js/pull/18067 adding an example for i18n routing

x-ref: https://github.com/vercel/next.js/pull/17370
2020-10-27 07:59:44 +00:00
Steven
3c6f421d99
Add docs for Image Optimization (#18107)
Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2020-10-24 14:53:28 +02:00
Tuan Nguyen
c28d39e47d
Use ya in case xa is false (#18074)
This closes [#18023](https://github.com/vercel/next.js/issues/18023). 

I was following the example mentioned in the issue (https://github.com/vercel/next.js/tree/canary/examples/with-firebase-authentication) and for some reason `xa` was always false, failing fetching food. Through `console.log` I saw that `ya` contained a token value and using `ya` worked.
2020-10-21 01:17:39 +00:00
Justin W Hall
c9d4d6299e
Update step 5 to Strapi example Readme (#17985)
Co-authored-by: Rémi de Juvigny <remi@hey.com>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-10-19 11:32:01 +02:00
Ash Connell
fd4eb558a2
Add with-facebook-pixel example (#17667) 2020-10-19 00:00:27 +00:00
Or Yoffe
68c62b3307
Updated dependencies for example: with-react-native-web (#17375)
The current dependencies of  the example "with-react-native-web" are outdated.
In this PR I updated them and tested that they run and work.

Newest current react and react-dom versions: 16.13.1
Newest current  react-native-web and babel-plugin-react-native-web versions: 0.13.14

Mainly for the people starting with this example to have the new versions since the current versions are very far from each other.
Please merge 🙏
2020-10-18 17:56:41 +00:00
Ash Connell
82041542e3
Fix with-mongodb hot-reload issue and race condition (#17666)
This PR fixes 2 issues with the mongodb example:

### 1. Fallable Caching Strategy

Calling `connectToDatabase()` multiple times before it's cached results in multiple connections being created. The latest one created was becoming the "cached" one and the others dissappear into the background.

This is now fixed by using **promise sharing** so that only one connection can ever be created.

### 2. Problematic Hot Reload

During development you can monitor your database connections and see that it continues to create more and more connections over time. Some users have reported their [databases reaching maximum connection limits](https://github.com/vercel/next.js/discussions/12229).

This is resolved by using `global` to store the cached connection. It's not ideal but it is necessary.
2020-10-17 00:30:38 +00:00
kamei
ee0a4a7086
Fixed link for expo (#17908) 2020-10-15 15:11:35 +02:00
Davidson Nascimento
d396bc68fb
feat(example): added missing prisma.io examples (#17896) 2020-10-15 15:10:24 +02:00
Henrik Wenz
1c4aecbeaf
Improve with-tailwindcss example (#17742)
## Change

To opt-in to using the new layers mode by default.

## Motivation

- Reduces CSS filesize
- Prevents users from using the already deprecated old layers mode
- Removes the following console warnings:

```log
risk - There are upcoming breaking changes: purgeLayersByDefault
risk - We highly recommend opting-in to these changes now to simplify upgrading Tailwind in the future.
risk - https://tailwindcss.com/docs/upcoming-changes
```

[more info](https://tailwindcss.com/docs/upcoming-changes)
2020-10-12 16:37:56 +00:00
Jens Meindertsma
c021662d1e
Fix with-msw example (#17695)
When using the `with-msw` example I noticed it increased my bundle size in production, even through MSW is meant to be used in development only. 

**Build size before implementing MSW**
```
Page                                                           Size     First Load JS
┌ λ /                                                          479 B          58.9 kB
├   /_app                                                      0 B            58.4 kB
└ ○ /404                                                       3.44 kB        61.9 kB
+ First Load JS shared by all                                  58.4 kB
  ├ chunks/f6078781a05fe1bcb0902d23dbbb2662c8d200b3.b1b405.js  10.3 kB
  ├ chunks/framework.cb05d5.js                                 39.9 kB
  ├ chunks/main.a140d5.js                                      7.28 kB
  ├ chunks/pages/_app.b90a57.js                                277 B
  └ chunks/webpack.e06743.js                                   751 B

λ  (Server)  server-side renders at runtime (uses getInitialProps or getServerSideProps)
○  (Static)  automatically rendered as static HTML (uses no initial props)
●  (SSG)     automatically generated as static HTML + JSON (uses getStaticProps)
   (ISR)     incremental static regeneration (uses revalidate in getStaticProps)
```
**Build size after implementing MSW according to the `with-msw` example**
```
Page                                                           Size     First Load JS
┌ λ /                                                          479 B          71.6 kB
├   /_app                                                      0 B            71.1 kB
└ ○ /404                                                       3.44 kB        74.6 kB
+ First Load JS shared by all                                  71.1 kB
  ├ chunks/f6078781a05fe1bcb0902d23dbbb2662c8d200b3.b1b405.js  10.3 kB
  ├ chunks/framework.cb05d5.js                                 39.9 kB
  ├ chunks/main.a140d5.js                                      7.28 kB
  ├ chunks/pages/_app.c58a6f.js                                13 kB
  └ chunks/webpack.e06743.js                                   751 B

λ  (Server)  server-side renders at runtime (uses getInitialProps or getServerSideProps)
○  (Static)  automatically rendered as static HTML (uses no initial props)
●  (SSG)     automatically generated as static HTML + JSON (uses getStaticProps)
   (ISR)     incremental static regeneration (uses revalidate in getStaticProps)
```

There was a 12.7 kB large increase in the `_app` First Load JS which increased the pages' First Load JS size. I tracked the problem down to the following code: 
```js
if (process.env.NEXT_PUBLIC_API_MOCKING === 'enabled') {
  require('../mocks')
}
```
Removing this reduces the `_app` First Load JS to what it was previously. The `NEXT_PUBLIC_API_MOCKING` environment variable is defined in the `.env.development` file, as this means that Next.js will only activate MSW during development/testing, which is what MSW is intended for.

After discussing with @kettanaito, the author of MSW, I did some investigation. This dynamic require statement is intended to allow tree-shaking of the MSW package for production. Unfortunately this did not seem to be working. To fix this, I changed the code to the following:
```js
if (process.env.NODE_ENV !== 'production') {
  require('../mocks')
}
```
This means I could remove the `NEXT_PUBLIC_API_MOCKING` environment variable  from `.env.development`, as it is no longer used. 

It is important to note that this still achieves the same functionality as before: MSW runs in development / testing, and not in production. If MSW must be enabled in production for some reason, the following code can be used to run MSW regardless of the environment:
```js
if (true) {
  require('../mocks')
}
```

If possible, I'd love to hear from the Next.js maintainers regarding the tree-shaking process when using environment variables.

Lastly, I made the necessary changes to have the example work in production mode as well, because there is no real backend. Of course there is a comment explaining what should be changed in a real world app.
2020-10-08 18:19:29 +00:00
Henrik Wenz
a79bcfb73a
Fix with-apollo example (#17686)
# Issue

The cache updates are performed in a wrong way, resulting in a duplicate collection:

**Error:**

```log
webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:88 Warning: Encountered two children with the same key, `6f3f7265-0d97-4708-a3ea-7dee76dc0a0a`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.
```

**Video:**

![broken](https://user-images.githubusercontent.com/1265681/95336501-0c170180-08b1-11eb-9273-6ac9e37ceb41.gif)

# Fix

**Video:**

![fixed](https://user-images.githubusercontent.com/1265681/95336538-15a06980-08b1-11eb-8d5e-6acc07e16138.gif)
2020-10-08 03:45:28 +00:00
Tantan Fu
4c38e3ed8e
fix typo (#17653) 2020-10-06 15:31:40 +00:00
Rafael Zerbini
d32b195539
Fixes #16431 (#17610)
Fixes #16431
* Added `.babelrc` with `next/babel` to remove the need of the React import on the `with-storybook` example.
2020-10-05 06:27:43 +00:00
Riccardo Di Maio
10f7b8f941
Improve formatting in examples (#17571) 2020-10-02 21:25:29 +00:00
Dylan Jhaveri
2a047a8f17
update README for vercel.app, stream.new (#17539) 2020-10-01 22:46:17 -04:00
Philihp Busby
f06c589115
with-google-analytics-amp needs <Head /> in Document component (#17462)
If this component is missing, an error will be printed to the console

```
Expected Document Component Head was not rendered. Make sure you render them in your custom `_document`
See more info here https://err.sh/next.js/missing-document-component
```

Additionally, any components which use CSS modules will fail with an error.

This is documented in https://nextjs.org/docs/advanced-features/custom-document
2020-09-30 08:41:05 +00:00
Amandeep Singh
02d7504670
Fixed minor typo (#17456) 2020-09-29 19:31:43 +00:00
Tim Feeley
b009ebbec6
Fix a small typo in index.css (#17399) 2020-09-27 22:17:03 +00:00
Rishi Raj Jain
92fc260e4c
Update README.md (#17347)
As clear from [#14233](https://github.com/vercel/next.js/pull/14233#issuecomment-645997757) that the 'with-algolia example is not SSR', I've updated the documentation to clear the confusion caused, as visible in #17229 

Fixes #17229
2020-09-25 01:55:11 +00:00
Antonio Pitasi
c388048f3e
fix(examples/with-redux-wrapper): wrong initial state (close #17299) (#17335)
Wrong variable was being checked for the hydrate action on redux. This was causing the count to be reset to 0 instead of being 1 when initially loading index.js page.

Fixes #17299
2020-09-24 19:35:46 +00:00
Sébastien Vanvelthem
f3eadac467
Example: with-next-auth updated to v3 (#17266)
Update [`next-auth`](https://github.com/iaincollins/next-auth) from `^2.1.0` to `^3.1.0` and minor sqlite bump to `^5.0.0`.
2020-09-21 19:51:52 +00:00
Kazuma Furuhashi
31ab12aaf7
Add project name to examples/with-three-js create command (#17256)
This is a change to add the project name as in the other examples.
When we run with the current create command, we are asked for the project name.
As follows:

```
$ npx create-next-app --example with-three-js
? What is your project named? › my-app
```
2020-09-21 17:02:25 +00:00
paulogdm
3400052cbb
Delete vercel.json from "yarn workspaces" example (#17263)
This PR removes "vercel.json" from the Yarn workspaces example. Since the release of [monorepos](https://vercel.com/blog/monorepos) support, there is no need to use the "builds" property or "vercel.json".
2020-09-21 16:39:51 +00:00
tomasdisk
3dee6097cd
Add with-chakra-ui-typescript example (#16561)
This PR adds an example Next.js project with chakra-ui as its component library using TypeScript.
![image](https://user-images.githubusercontent.com/11686408/91192736-a8ec5980-e6cc-11ea-8f95-b9180defbf47.png)
Both libraries has built-in TypeScript declarations. Will help to encourage typed projects, so why not?

It's a combination of two existing examples [with-chakra-ui](https://github.com/vercel/next.js/tree/canary/examples/with-chakra-ui) and [with-typescript](https://github.com/vercel/next.js/tree/canary/examples/with-typescript).

All credits for their contributors.
2020-09-21 04:54:15 +00:00
Nghiệp
111d2df90c
[Examples] Optimize with-docker (#17116)
* Fix missing yarn.lock
* Add --frozen-lockfile flag to speed up install deps
* Make sure node_modules do not contains devDependencies
* Add --targe stage docker build
2020-09-21 04:09:37 +00:00
Ilya Lebedev
db82f9ce6d
[Example] with-react-intl: fix doubling messages (#17175)
Because `import()` for .json files return object like this:

```json
{
  "default": {
     "some": ...
  },
 "some": ...
}
```

![image](https://user-images.githubusercontent.com/2598671/93468826-4156b200-f8f8-11ea-8e39-42df2df83057.png)
2020-09-21 03:47:58 +00:00
Ilya Lebedev
231016f69f
[Example] with-react-intl: fix getInitialProps props ordering (#17174)
Invalid ordering in Promise.all and in receiving destruction.

Now appProps receives result of polyfill(supportedLocale) call.
2020-09-21 03:26:47 +00:00
Devin Ekadeni
4f1ccda5bd
[Example] With TS Eslint Jest - unnecessary package (#17170)
As mentioned in [here](https://www.npmjs.com/package/@types/testing-library__react), the package has been deprecated and not necessary to be installed.
By removing this from `package.json` will give other devs have more understanding when learning typescript with eslint and jest about what need to be installed on the project.
2020-09-21 03:06:21 +00:00
Austin Huang
2e87e22731
Fix for missing babel dependencies in with-rebass example (#16839)
Pull request for (Issue: Fix or remove the with-rebass example #16828). Just added some missing dependencies to the package.json of the example

Fixes #16839
2020-09-21 02:16:15 +00:00
Mohamed Akram
eaea7a8793
Update PatternFly example to v4 (#17241)
`esModule: false` required for fonts to load.
2020-09-20 22:00:41 +00:00
Long Ho
67b67b28b2
feat(examples/with-react-intl): add locale negotation to client side (#16806)
fix #16752

cc @thuringia
2020-09-16 23:01:21 +00:00
Jens Meindertsma
a3c47721a1
Include all files in Prettier (#17050)
This uses the "Expand directories" feature introduces in Prettier 2.0 to automatically format all supported file types.

Also, I fixed some badly formatted files.
2020-09-14 02:53:19 +00:00
Fran Zekan
0f41062db0
Examples blogs: fix spelling (#17049)
Throughout some of the blog examples word `formatter` is spelled as `formater`, this PR changes all of them to `formatter`
2020-09-13 13:06:29 +00:00
Artem Zakharchenko
260814cc04
Updates "msw" package to version 0.21.0 (#17012) 2020-09-12 01:15:59 -04:00
Sakito Mukai
7efa3babb7
Security upgrade node-fetch (#17009)
There was a security update for node-fetch.

> This is an important security release. It is strongly recommended to update as soon as possible.
https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md#v261
2020-09-11 09:01:48 +00:00
Arthur Maverick
91b4a2b37e
Adding globalStyled with styled components (#16783)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-09-10 16:05:59 -04:00
Henrik Wenz
c42ee58ccb
Update with-slate example (#16959)
## Changelog

- Updated slate.js to version 0.58.4
- Removed unused packages (immutable & slate-plain-serializer)
- Simplified example (we don’t need to demonstrate the multi editor case anymore, since this issue is now handled by slate internally)
- Remove deprecated `KeyUtils`
- Removed deprecated Components

## Related:

- https://github.com/ianstormtaylor/slate/issues/870
2020-09-09 18:00:09 +00:00
Borek Bernard
99998f0b49
Ignore .next also in subfolders (#16962)
As the example is about Yarn workspaces, it should gitignore `.next` recursively.
2020-09-09 16:13:13 +00:00
Sashank Thupukari
4ba3607dcb
Fix typo in Pet mongoose model (#16943)
s/applicale/applicable/
2020-09-08 17:00:25 +00:00
Piotr Zarycki
6935a93868
Fix extension name for example app (#16906) (#16916)
Fixes: https://github.com/vercel/next.js/issues/16906
2020-09-08 07:21:52 +00:00
Anders Kjær Damgaard
2058c9f8de
Fix Three.js example's BoxesPage variable name (#16900)
The BirdsPage name seems to have been copy/pasted from `pages/birds.js` and forgotten by mistake.
2020-09-07 10:12:59 +00:00
Mohsen Azimi
e2cdf215bc
Remove path specific switch statement from http2 example (#16558)
Is this switch necessary
2020-09-06 00:08:20 +00:00
Luis Alvarez D
b5cf3e4c94
Update dynamic-import docs (#16803)
Goals of this PR:

- Explain `import()` first without mentioning `next/dynamic`, because `next/dynamic` in our API and **Dynamic Import** is a ES feature. This should avoid a common confusion in our users thinking that one can't be used without the other.
- Mention how `next/dynamic` can be used with **Dynamic Imports** to load react components.
- Updated example to include fuzzy search using a dynamic import.

Potential change: Leave the page to be about `import()` and move `next/dynamic` to the API reference (alongside `next/link`, `next/router`, etc.)

Closes https://github.com/vercel/next.js/pull/16299
Closes https://github.com/vercel/next.js/issues/15711
2020-09-05 23:45:30 +00:00
Adityo Pratomo
a7a6aa54ef
update nextjs-auth0 versionfor auth0 example (#16871)
While running the current [auth0 example](https://github.com/vercel/next.js/tree/canary/examples/auth0), I bumped into this error while trying to access an API route from a page.

```
{
  "error": "_lib_auth0__WEBPACK_IMPORTED_MODULE_1__.default.tokenCache is not a function"
}
```

After checking the [nextjs-auth0](https://github.com/auth0/nextjs-auth0) repo, I realize that they're using version 0.8.0 of the SDK. Changing the package.json to the appropriate version fixes this error.

Signed-off-by: Adityo Pratomo <pratomo.adityo@gmail.com>
2020-09-05 23:24:09 +00:00
Eugene C
134bcf8d4c
[EXAMPLE] with-cssed (#16735)
Adding an example with [cssed](https://github.com/okotoki/cssed). A custom styling solution, which extracts CSS from template literals into separate files.
2020-09-05 23:02:31 +00:00
Kristoffer K
2acb53bd30
chore: update example names to match their folders (#16268)
**What's the problem this PR addresses?**

A decent amount of the examples don't have a `name` field in `package.json` that matches their folder name, meaning they either lack a name or the names are duplicated.

I was testing Yarn 2 workspaces using the entire examples directory and needed to get rid of the duplicates.

**How did you fix it?**

Updated the names to match the names of their folders
2020-09-05 21:23:51 +00:00
Shu Uesugi
1c7cc60b8a
Use useRouter over Router for with-google-analytics example (#16846)
Updating `with-google-analytics` example to be in line with [our documentation recommending `useRouter`](https://nextjs.org/docs/api-reference/next/router#userouter). Verified that it works.
2020-09-04 16:22:59 +00:00
Peng Jie
3c99206313
chore(examples): fix missing document components error messages (#16802)
Thanks vercel team create multiple examples for much use cases, I found some error messages and fixed it.
2020-09-03 21:13:12 +00:00
Luis Alvarez D
4162e39696
Undo unrequired readme changes done to examples (#16831)
Related to https://github.com/vercel/next.js/pull/16678#issuecomment-684962496
2020-09-03 19:11:58 +00:00
Pedro Duarte
0e843e6001
Update with-stitches example (#16827)
Hi 👋 

[Stitches](https://stitches.dev) `v0.0.1` beta was recently released. This PR updates the existing examples to the latest packages and API.

Notes:
- Remove `with-stitches-styled` example, that's no longer needed
- Update `with-stitches` example
  - Update dependency
  - Example done with Typescript
- Updated README

Thanks ✌️ 

![CleanShot 2020-09-03 at 18 23 09@2x](https://user-images.githubusercontent.com/372831/92141867-52d98d80-ee13-11ea-91ed-001cd46989f1.jpg)
2020-09-03 17:38:13 +00:00
Gianmarco
4048d29896
Minor spelling fix in zones example's readme (#16822) 2020-09-03 16:08:54 +00:00
Ting-Hsiang Hsu
064917682f
[Example] Fix relay network request (#16525)
* fix(with-react-relay-network-modern): fix README.md typo error

* fix(with-react-relay-network-modern): should not use store cache for create environment

* fix(with-react-relay-network-modern): should not request api again

* feat(with-react-relay-network-modern): add relay-hooks package

* feat(with-react-relay-network-modern): use new RelayEnvironmentProvider

* feat(with-react-relay-network-modern): add useQuery hook

* fix(with-react-relay-network-modern): fix cache error

* fix(with-react-relay-network-modern): fix server loading

Co-authored-by: Luis Alvarez <luis@vercel.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-09-02 14:31:02 -05:00
John Doe
2280031915
Create _document.js to include current language in HTML tag (#16360)
* Create _document.js

 Includes the lang attribute with current language inside the <html> tag.

* Lint fix

Co-authored-by: Luis Alvarez D <luis@vercel.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-09-02 09:50:08 -05:00
WeichienHung
aa568a549e
force persistor persist again after persistStore bootstrap done (#16085)
This PR is to fix "[Examples] Problem with query parameters in with-redux-persist (#15484)"
The root cause is 
persist/rehydrate action will issue twice when query parameter is set. But persistStore initial bootstrap is not ready yet. So i add a bootstrap callback and force persistor to persist again to make overall state correct. I also modify the loading prop to a `<div>loading</div>` because it's confuse to set Component in loading prop. 

Attached the GIF
![demo](https://user-images.githubusercontent.com/1462027/89922530-bec04000-dc31-11ea-9831-12cd9d436d96.gif)

Closes #15484
2020-09-01 23:48:56 +00:00
Yichi Zhang
9e4bb5a129
Add Fast Refresh Demo (#16576)
Closes #16538 

Basically reverts #16497 and some minor changes. Also adds a link in the docs.

This reverts commit ec281df70b.
2020-09-01 23:27:57 +00:00
Joris
808d6b94eb
[EXAMPLE] with-framer-motion: fix broken images (#16714)
* refactor: remove useless console.log

* fix: replace broken images

* Updated title

Co-authored-by: Luis Alvarez <luis@vercel.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-09-01 13:03:41 -05:00
Long Ho
6f60a22377
fix: fix hashing algo and locale value hydration (#16692)
- Fix hashing algo for extraction so it's the same as babel config
- Fix locale persistence issue
fix #16689
2020-09-01 01:33:24 +00:00
Jesse Jafa
ce994365b7
Add cross-env to ensure examples work on Windows 10 (#16694)
Closes https://github.com/vercel/next.js/issues/16693
2020-08-30 06:53:29 +00:00
Patrick Krawczykowski
ba2fbc2b65
Update _app.js to use a function component. (#16683)
This PR updates the `_app.js` file to remove the `next/app` import. It's not needed with the latest versions of Next
2020-08-30 03:23:42 +00:00
Joe Haddad
f17d435166
Ensure all examples are MIT licensed (#16691) 2020-08-29 22:32:35 -04:00
NorbertLuszkiewicz
c03d4931de
Simplify example usage instructions (#16678)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-08-29 22:22:02 -04:00
Sakito Mukai
97d8e07f95
[Example] fix with-firebase-hosting (#16577) 2020-08-29 22:17:16 -04:00
Jesse Jafa
694ccc7ca0
Upgrade typescript to 4.0 (#16673) 2020-08-29 22:17:02 -04:00
Soichi Takamura
04c990678e
Update with-typescript-graphql (#16101) 2020-08-29 22:15:50 -04:00
Joe Haddad
624b748de2
Add missing gitignore files 2020-08-29 21:55:58 -04:00
NorbertLuszkiewicz
7e731a8db2
Update README.mb (#16676)
Remove the manual download option
2020-08-30 00:42:40 +00:00
Daniel Eden
a2d83952c1
Add with-mdx-remote example (#16613)
This change adds a new example, `with-mdx-remote`, which leverages [`next-mdx-remote`](https://github.com/hashicorp/next-mdx-remote) to use MDX files as content for a dynamic route.

In addition to the basic functionality, the example adds a note about somewhat advanced usage that allows the use of conditionally-loaded custom MDX components.

cc @jescalan
2020-08-29 01:22:35 +00:00
Vic Vijayakumar
48b3f8e899
Update with-tailwindcss example (#16370)
Updated `examples/with-tailwindcss` to the newest TailwindCSS, and opted in to future-facing breaking changes.

Also created a jsconfig.json so that files can be imported without traversing up relative paths.
2020-08-27 23:54:12 +00:00
Long Ho
5a478b4eef
feat: upgrade react-intl workflow in example (#16215)
Changes:
- Migrate to TypeScript. `react-intl` natively supports TypeScript now.
- Upgrade corresponding `formatjs` packages.
- Dynamically polyfill Intl API per locale since those polyfills are huge.
- Migrate to recommended workflow per https://formatjs.io/docs/getting-started/application-workflow
2020-08-27 22:59:33 +00:00
Hyeon Kim (김지현)
35a90d0e0c
examples/with-styled-components: Fix missing peerDependency (#16532)
styled-components requires 'react-is' as a peerDependency

###### Reference
- https://github.com/styled-components/styled-components/blob/b19d17f/packages/styled-components/package.json#L78
2020-08-25 04:56:03 +00:00
Luis Alvarez D
dd4b9dab63
Update environment variables example (#16536)
Should be able to help with: https://github.com/vercel/next.js/discussions/16530
2020-08-24 23:37:56 +00:00
Ondřej Chrastina
a856097402
Add Kontent example (#16034)
Hello everyone!

I would like to add the example using [Kentico Kontent](https://kontent.ai) as a data source for your example.
I have tried to be consistent with the other examples and showcase the preview as well.

I have tried to keep up with [Contribution guidelines](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples).

Thank you.
2020-08-24 22:58:53 +00:00
Luis Alvarez D
333a9ea8ab
Documentation updates (#16503)
Fixes https://github.com/vercel/next.js/issues/16502

Check the issue for more details.
2020-08-24 02:23:12 +00:00
WeichienHung
c97e53efe1
basePath should also append in urlPrefix (#16376)
Fix https://github.com/vercel/next.js/issues/16197

See my screenshot. Testing url is changed to http://localhost:3000/test and can find the source map.
<img width="826" alt="圖片" src="https://user-images.githubusercontent.com/1462027/90737991-d74eeb00-e300-11ea-9675-f25aef6a4062.png">
2020-08-24 02:00:43 +00:00
Luis Alvarez D
ec281df70b
Remove experimental example (#16497)
@Timer This example seems to not be needed anymore
2020-08-23 18:33:34 +00:00
Diego Gennaro
85d58298a3
Add example: Unsplash integration (#16142)
* nextjs with unsplash initial commit

* update demo link

* remove isomorphic-unfetch

* remove ssr on collection page

* fix style issues

* fix import/no-anonymous-default-export

* usign fetch instead of request

* remove credits

* improve instructions

* improve instructions

* Updated readme steps and images

* Updated readme

* Updated gitignore

Co-authored-by: Luis Alvarez <luis@vercel.com>
2020-08-22 16:02:49 -05:00
Todor Totev
b0d2a80a18
[Examples] Remove horizontal scroll in CMS examples (#16295) 2020-08-18 11:31:20 -04:00
Vishnu Sankar
17aa4b458e
Added next-sitemap example (#15997)
Co-authored-by: Luis Alvarez <luis@vercel.com>
2020-08-18 00:16:42 -04:00
Kristoffer K
2e6bc8eba4
ci: add pnp test (#16255) 2020-08-17 13:39:57 -04:00
Rafael Almeida
521cc621d8
Update Storybook examples to v6.0 (#16139)
* Update with-storybook example

* Delete with-storybook-typescript example

* Add TypeScript section to the README

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-08-15 15:42:17 -05:00