Commit graph

1770 commits

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