Commit graph

32 commits

Author SHA1 Message Date
Vitaly Baev
562640dbb4
(examples/with-webassembly) fixed for webpack 5 (#26440)
## Documentation / Examples

- [x] Make sure the linting passes

Fixes #26436

As mention in #25854 `with-webassembly` example doesn't work anymore after switching to webpack 5.
This PR adds webpack experimental configuration.
2021-06-21 16:45:16 +00:00
Nick Babcock
5629223407
Update examples to use React 17 (#26133)
[With next 11 requiring react 17](https://nextjs.org/blog/next-11#upgrade-guide), most of the examples
need to be updated, so the following snippet updated all the examples to
a compatible react version.

```bash
cd examples/
fd -g 'package.json' | xargs sed -r -i 's/"react": ".*"/"react": "^17.0.2"/
fd -g 'package.json' | xargs sed -r -i 's/"react-dom": ".*"/"react-dom": "^17.0.2"/'

# exclude experimental react version
git checkout with-reason-relay/package.json
```
2021-06-16 16:43:26 +00:00
Dominic Elm
d2caaeab64
docs: add 'Open in StackBlitz' buttons to various examples (#25853)
This PR adds a `Preview` section and a `Open in StackBlitz` button to various examples. I have tested all examples and omitted the ones that require third party API keys, or didn't work. Some examples don't work locally either.

Here's an example:
![image](https://user-images.githubusercontent.com/12571019/121027783-88971280-c7a7-11eb-851a-0ad30cf74b42.png)

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [x] Examples updated
- [ ] Telemetry added. In case of a feature if it's used or not.

## Documentation / Examples

- [x] Make sure the linting passes
2021-06-08 20:45:02 +00:00
Nick Babcock
6c59b77702
Switch to stable rust for with-webassembly example (#22582)
Since Rust 1.30 (released Oct 2018), the wasm target is supported on stable.

ref: https://rustwasm.github.io/book/game-of-life/setup.html#the-rust-toolchain
2021-02-27 21:48:49 +00: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
Davidson Nascimento
7820468401
chore: updated react to v17 on with-webassembly example (#18916) 2020-11-07 13:13:24 -05: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
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
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
Tanmay Laud
f00ad581a1
Added .gitignore to examples that are deployed to vercel (#15127)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-07-16 10:52:23 -04:00
Joe Haddad
4a12fb0a5f
Normalize example gitignores (#13768)
This removes a bunch of unnecessary `.gitignore`s and fixes some CMS examples that don't ignore `node_modules` etc.
2020-06-04 20:39:52 +00:00
Joe Haddad
7d038dfef1
Suggest npx over npm init (#13637)
This updates old examples to the more universal `npx` command.

Fixes https://github.com/vercel/next.js/discussions/12103
2020-06-01 17:36:57 +00:00
Joe Haddad
b7e17e09e5
Update references to zeit/next.js (#13463) 2020-05-27 17:51:11 -04:00
JJ Kasper
1f6ce106ae
Update codeload and deploy links for org rename (#13141)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-05-27 14:11:39 -04:00
Joe Haddad
86160a5190
Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
Tim Neutkens
483bd3ddda
Rename ZEIT to Vercel (#12075)
* Find/replace

* Update more URLs

* More rename

* Fix remaining examples

* More updates

* Update create-next-app

* Update remaining text

* Update

Co-authored-by: Shu Uesugi <shu@chibicode.com>
2020-04-21 11:47:12 +02:00
Tim Neutkens
ac34a9f960
Clean up examples directory (#11169)
* Remove outdated examples

* Remove outdated example

* Remove outdated example that doesn't show best practices

* Remove outdated example

* Remove outdated example

* Remove outdated example

* Update preact example

* Update using-router to use useRouter

* Remove outdated example

* Remove outdated example

* Remove outdated example

* Remove outdated example

* Remove outdated example

* Remove outdated example

* Combine examples

* Simplify offered examples

* Remove outdated example

* Add link to new example

* Removed outdated example

* Markdown example has been improved

* Remove example that showed bad practices

* Remove outdated example

* Update polyfills example

* Remove outdated example

* Remove outdated example

* Remove outdated example

* Removed outdated example

* Remove outdated example

* Remove outdated example

* Remove outdated example

* Remove outdated example

* Update webassembly example

* Move example
2020-03-18 13:45:31 +01:00
Shu Uesugi
c57cdbb31d
Rename zeit.co/new → zeit.co/import (#10674)
* Replace zeit.co/new → zeit.co/import

* Update deployment.md
2020-02-24 19:08:34 -05:00
Shu Uesugi
5f041447bc
Remove Now CLI reference from examples (#10501)
* Find/Replace "Deploy it to the cloud..."

* Find/Replace "Deploy it to the cloud..." (no colon)

* Find/Replace "Deploy it to the cloud..." for firebase

* Convert remaining ones

* Storybook deployment

* Update with-stripe-typescript

* Update contributing.md

* Remove `now`

* Update examples/with-stripe-typescript/README.md

Co-Authored-By: Luis Alvarez D. <luis@zeit.co>
2020-02-12 17:14:57 -05:00
Shu Uesugi
6804039e94 Make example READMEs more consistent (#10124)
* npx create → npm init

* Fix inconsistent instructions

* Update amp-first

* Update with-graphql-react

* with-firebase-cloud-messaging

* Update with-higher-order-component

* change create-next-app url

* Update create-next-app instruction

* Update instructions to use npm instead of npx

* Move "the idea behind the example" to top

* Rename

* Rename

* Update contributing.md with a README template
2020-01-16 23:23:56 +01:00
Luis Alvarez D
7edf0da0c4 Add the deploy button to compatible examples (#9547) 2019-11-27 11:40:58 -05:00
Joe Haddad
18a9c7e371
Improve linting rules to catch more errors (#9374)
* Update `packages/`

* Update examples

* Update tests

* Update bench

* Update top level files

* Fix build

* trigger
2019-11-10 19:24:53 -08:00
Luis Alvarez D
f10f3304fe Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
Joe Haddad
f152c745da
Update remaining examples to latest Next.js 2019-07-08 19:37:58 -04:00
Lukáš Huvar
c156e0c889
Helpers update (#7686)
* Update helper function to invoke only on get

* Tests for body parsing

* Update api-utils.ts

* Update next-server.ts

* Update packages/next-server/server/next-server.ts

Co-Authored-By: JJ Kasper <jj@jjsweb.site>
2019-06-28 11:31:32 +02:00
Connor Davis
3fa04620e7 Remove Deploy To Now buttons (#7126)
* Remove Deploy To Now buttons

* Remove remaining buttons
2019-04-24 10:53:58 +02:00
HelloRusk
414e8fab6c Update link in wasm example (#6389)
I renewed Rust installation Link.
2019-02-21 15:34:20 +01:00
Juan Olvera
7e12997af6 Test updater script on examples folder (#5993)
I wrote a [script](https://github.com/j0lv3r4/dependency-version-updater) to update dependencies recursively in `package.json` files, e.g.:

```
$ node index.js --path="./examples" --dependencies="react=^16.7.0,react-dom=^16.7.0"
```

This PR contains the result against the examples folder.
2019-01-05 12:19:27 +01:00
Tim Neutkens
9c4eefcdbf
Add prettier for examples directory (#5909)
* Add prettier for examples directory

* Fix files

* Fix linting

* Add prettier script in case it has to be ran again
2018-12-17 17:34:32 +01:00
Julien Bouquillon
cfcff160de doc: fix deploy link (#5223) 2018-09-20 11:30:23 +02:00
Tim Neutkens
ee3a73f80b Add WebAssembly example 2018-09-17 21:48:06 +02:00