Commit graph

1916 commits

Author SHA1 Message Date
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