Commit graph

1792 commits

Author SHA1 Message Date
S M Mahmudul Hasan
09b2a66f49
Tailwind config: also look for .tsx .jsx and .ts (#14621)
Closes: #14595
2020-06-27 11:08:10 +00:00
JJ Kasper
61b68730f8
De-experimentalize custom-routes (#14602)
This moves the custom-routes configs outside of the experimental section to prepare them for being made stable

Fixes: https://github.com/vercel/next.js/issues/14184
2020-06-27 09:18:18 +00:00
matamatanot
87bb11c98c
Remove next-cookies and prop-types (#14579) 2020-06-26 14:55:32 +02:00
Hyeungshik Jung
c8dbc7e572
Add [with-storybook-typescript] example (#14398)
Basically this PR adds Next.js 's default TypeScript setting and integrates [@storybook/preset-typescript](https://github.com/storybookjs/presets/tree/master/packages/preset-typescript) into original [with-storybook](https://github.com/vercel/next.js/tree/canary/examples/with-storybook) example. 

However, I thought it may save time for someone who are planning to use storybook with next.js and TypeScript :)
2020-06-25 15:26:47 +00:00
Nico Domino
fe529c49bf
Add 'with-next-auth' example (#14530)
I accidentally deleted the repo the original PR was based upon haha. 

Anyway, the code was still on my computer so here's a new PR with the same content. 

I addressed the latest comments from @lfades in the old PR (https://github.com/vercel/next.js/pull/14180)

I also updated `next-auth` to `2.1.0` and updated the `<Provider />` component in `_app.js` that needed updating since the latest release.

Let me know if I missed anything else, otherwise I think this should be good to go 👍
2020-06-24 22:24:02 +00:00
Oğuzcan Köse
c690a68b3c
Update index.js (#14528)
* Update index.js

* Update index.js

* Update examples/with-firebase-authentication/pages/index.js

Co-authored-by: Luis Alvarez D <luis@vercel.com>
2020-06-24 16:53:04 -05:00
Vinci Rufus
afa9bab11a
fixing the docker multi-stage build failures (#14513)
It looks like the docker multi-stage file wasn't building, so fixed that and also cleaned up some of the steps
2020-06-24 03:56:41 +00:00
Steven Bell
a9bfe13ae5
Remove unused package in with-apollo-and-redux example (#14507)
Usage of `apollo/react-ssr` was removed when the example moved to SSG.
2020-06-24 01:33:09 +00:00
Luis Alvarez D
b90fa0a3e1
[Examples] Use the vercel CLI for with-zones (#14480)
[ch3480]

Fixes https://github.com/vercel/next.js/issues/14242
Closes https://github.com/vercel/next.js/pull/14264

Updated the readme of the `with-zones` example to use `vercel dev` instead, starting the app independently has some routing issues that don't happen on production (due to `vercel.json`), with `vercel dev` the app will match the production deployment on localhost.
2020-06-23 09:04:34 +00:00
JJ Kasper
051481c55c
Add example for proxying upstream with custom routes (#14374)
As discussed this adds an example to demonstrate how you can achieve proxying upstream requests that didn't match any pages/assets in Next.js which can be helpful in achieving incremental migration
2020-06-22 00:44:04 +00:00
Andres Alvarez
6424e1f1d9
Add A/B Tests and Feature Flags example (#13629)
## Summary
This PR adds a basic example of how [Tesfy](https://tesfy.io/) could be integrated with Next.js. Tesfy is a project that I've working on during quarantine weekends, mainly to learn new stuff and provide **free** and **unlimited** A/B Tests and Feature Flags while keeping a good performance and the library [size](https://bundlephobia.com/result?p=react-tesfy@1.2.1) as small as possible.

The configuration file could be set up using a [web application](https://app.tesfy.io/) (hosted in Vercel 🎉 ) or by your self.

## Implementation
- Created `with-tesfy` folder
- Added two pages `index.js` and `features.js` to show how experiments and features could be used
- The only thing that must be persisted is the `userId`. Used a cookie to save it.
- Uses `getServerSideProps` to fetch the configuration file and get/create the `userId`.

## Screenshots

There are some screenshots from the web application. Where you can easily configure experiments and audiences per project. Teams and features will soon be added.

![Screenshot 2020-06-01 at 15 40 49](https://user-images.githubusercontent.com/6877967/83414811-60e7ce80-a41e-11ea-9e5c-887c66e80c65.png)
![Screenshot 2020-06-01 at 15 41 02](https://user-images.githubusercontent.com/6877967/83414823-66451900-a41e-11ea-885b-b58e78b042bb.png)
![Screenshot 2020-06-01 at 15 41 11](https://user-images.githubusercontent.com/6877967/83414828-6a713680-a41e-11ea-90a8-8d39a17f19a1.png)

This is my first PR! sorry if I made something wrong 😞 . Any feedback is more than welcome. Also I want to thank you all for the awesome work with Next.js ❤️
2020-06-21 23:59:53 +00:00
Sebastian Sycz
76673fd880
Update graphql-hooks with memcache (#14364)
Today the cd4178b53e of graphl-hooks and graphl-hooks-memcache has been released, which fixes the problem with Safari.
2020-06-20 19:40:15 +00:00
Todor Totev
5bed435176
[Examples] Remove getInitialProps from with-cookie-auth-fauna (#13887)
* Remove getInitialProps

* added swr

* Update examples/with-cookie-auth-fauna/pages/profile.js

Co-authored-by: Luis Alvarez D. <luis@vercel.com>

* Update examples/with-cookie-auth-fauna/pages/profile.js

Co-authored-by: Luis Alvarez D. <luis@vercel.com>

* no longer needed

* new .env support

* redirect if not found

* always use latest next version

* no longer needed

* Updated readme

* Updated profile page

* Fixed readme and added deploy button

Co-authored-by: Luis Alvarez D. <luis@vercel.com>
2020-06-20 10:59:53 -05:00
Bing Quan
ca49c547d0
Update Algolia's Instant Search Example (#14233)
* Update Algolio's Instant Search Example
- Moved from `getInitialProps` to `getServerSideProps`
- Update Algolio libraries

Co-authored-by: Arsalan Khattak <akkhattak65@gmail.com>

* Shift from SSR to CSR

Co-authored-by: Arsalan Khattak <akkhattak65@gmail.com>
2020-06-18 19:23:02 -05:00
Thor 雷神
0d6b7e95ed
Thor/stripe/add use shopping cart example (#14239)
r? @lfades 
cc @timothyis @dayhaysoos @ChrisBrownie55

* Add [use-shopping-cart](https://github.com/dayhaysoos/use-shopping-cart) example to stripe sample
* Refactor how we instantiate Stripe across the different pages with a `getStripe` singleton pattern.
2020-06-18 22:49:31 +00:00
stefanprobst
279ae19c7e
docs: update links to docs site (#14305)
this updates some links to the docs site to their new location
2020-06-18 09:54:07 +00:00
Darsh Patel
42c309ad37
fix csp errors in with-strict-csp-app example (#14262)
Added proper content security policies in the dev environment 
fixes: #14221
2020-06-18 04:25:15 +00:00
Shu Uesugi
a841d10954
Add c=1 to deploy buttons on CMS Examples (#14293)
Fixes #14291
2020-06-17 23:25:11 +00:00
Vorathep Sumetphong
4152e0cee4
(fix) Missing props key from getServerSideProps (#14255)
Crashes the site
This change fixes the example
examples/with-cookie-auth-fauna/pages/profile.js
2020-06-17 05:59:48 +00:00
Gourav Goyal
335e9d4e8d
Added missing .env.local.example file for with example firebase-authentication-app (#14235)
Added missing .env.local.example file for with example firebase-authentication-app.
I've tested it personally and it is working fine.
2020-06-16 17:30:10 +00:00
João Pedro Schmitz
0e8ed87d20
chore(examples): update next to latest on cms examples (#14230)
Hey guys, thanks for the amazing job you are doing 💜 

This PR fixes a small error I faced when starting a project with Prismic + Next.js.

Since the version on the `cms-prismic` example was fixed to `9.2.3-canary.26` I was having the following error because the example uses the environment variables feature that is for Next.js 9.4+

<img width="1256" alt="Screen Shot 2020-06-16 at 12 13 38" src="https://user-images.githubusercontent.com/26466516/84793626-bc43c000-afcb-11ea-8823-b1dee30dbb00.png">

After updating to the latest version, I could run it successfully.

ps: I also realized that the `cms-contentful` example was also not using the `latest` version, so I decided to update it (I have not tested, but the error certainly will happen).

ps2: if you want to reproduce the error, just create a project using the example and add dummy data on the environment variables, then start the server and access `http://localhost:3000`.
2020-06-16 16:25:20 +00:00
James Mosier
d75da7d91f
Using cross-spawn for cross platform use in with-react-intl (#14231)
[In this Discussion](https://github.com/vercel/next.js/discussions/14220) it appears that trying to build the `with-react-intl` example with a Windows machine throws an error. So instead of using `execFileSync` to execute the command, I used [`cross-spawn` ](https://www.npmjs.com/package/cross-spawn) for better cross platform compatibility.
2020-06-16 15:59:59 +00:00
Darsh Patel
a3ffa2e65f
switch to function component with-react-intl example (#14217)
The example was using class-based component for custom _app, switched to functional component approach.


**Sidenote:** The existing code didn't gave an error when navigated to a new page using the navbar
![Screenshot 2020-06-16 at 2 47 52 PM](https://user-images.githubusercontent.com/11258286/84760988-6cbebd80-afe6-11ea-9b7f-98aca7404895.png)
2020-06-16 11:27:20 +00:00
Ty Mick
725376a9d7
Fix GraphQL Hooks Example Safari bug (#14205)
Fixes #14187, where the [GraphQL Hooks Example](https://github.com/vercel/next.js/tree/canary/examples/with-graphql-hooks), when opened in Safari, doesn't respond to events in production and doesn't load at all in the dev server.

This is caused by [a bug in graphql-hooks-memcache@1.3.2](https://github.com/nearform/graphql-hooks/issues/496), which they've fixed but haven't released the fix yet. So this example fix just temporarily downgrades graphql-hooks-memcache by changing its version range to `1.3.1 || ^1.3.3`.
2020-06-16 08:33:57 +00:00
Arsalan Khattak
8cfa51878a
Update Data Fetching Method (#14190) 2020-06-16 09:59:46 +02:00
Jesse
d3704a66f8
added graphcms (#14026)
* added graphcms

* Updated readme and environment variables

* Removed gitignore

* Updated tailwind config

* Some fixes in pages

* Updated api endpoints

* lint fix

* Updated readme

* Updated og image

* Updated cms examples to include this one

* Added example to docs

* Added preview demo link

* Updated step

Co-authored-by: Luis Alvarez <luis@vercel.com>
2020-06-15 12:03:34 -05:00
Darsh Patel
d68afed6ab
Fix: validatePassword function logic [Fixes 14174 ] (#14183)
Updated the `validatePassword` function as mentioned in https://github.com/vercel/next.js/issues/14174#issue-638626374

also fixed the password validation logic in `signIn` function 

Fixes: https://github.com/vercel/next.js/issues/14174
2020-06-15 12:39:12 +00:00
Todor Totev
e4f0848c81
[Example] remove getInitialProps from aws-amplify (#13896)
* Remove getInitialProps

* update package

* Applied requested changes.

* thats essential so im bringing it back

* make sure getstaticprops doesnt throw

* proper versioning

* requested changes

* Updated readme and package.json

* Updated pages

Co-authored-by: Luis Alvarez D <luis@vercel.com>
2020-06-14 18:50:54 -05:00
Robert Valmassoi
05f61b22ad
Fix broken link (#14158) 2020-06-13 23:48:14 +00:00
Alexej Dyschelmann
6163f30ad8
[with-recoil example] use functional form of state updaters for simplicity (#14014)
This is probably a pretty subjective change, but one might argue it less complex and may have minimally less overhead.
2020-06-13 09:04:34 +00:00
Li Ming
c16e0e2be1
fix(example): needs TypeScript support (#14115)
Example:  with-ant-design-pro-layout-less needs TypeScript support.

![image](https://user-images.githubusercontent.com/1228449/84468957-ee4ade80-acba-11ea-9438-e1a0e40493f2.png)
2020-06-12 06:35:00 +00:00
Shu Uesugi
e781c44682
Use envLink for deploy buttons (#14110)
This is a quick fix for https://github.com/vercel/next.js/pull/14053 - the deploy buttons on CMS examples should be using `envLink` for the links.

## Before

<img width="565" alt="Screen Shot 2020-06-11 at 7 23 58 PM" src="https://user-images.githubusercontent.com/992008/84458119-21d52c80-ac19-11ea-9659-df6830fc7584.png">

## After

<img width="570" alt="Screen Shot 2020-06-11 at 7 23 33 PM" src="https://user-images.githubusercontent.com/992008/84458089-1255e380-ac19-11ea-81ff-bc2b58af3ea4.png">
2020-06-12 02:51:19 +00:00
Luis Alvarez D
3f5737eccd
Use the expected import (#14111) 2020-06-11 21:29:26 -05:00
Luis Alvarez D
85543a45f1
Update deploy button in the userbase example (#14107)
Fixes readme updates added in https://github.com/vercel/next.js/pull/14100
2020-06-12 02:23:52 +00:00
Mileta Dulović
f343410773
Fixed Avatar.js component where Strapi CMS would fail when fetching an image (#14084)
I tried creating CMS with ```Strapi``` by following [this README.MD](https://github.com/M1ck0/next.js/tree/canary/examples/cms-strapi). After configuring everything I noticed that app isn't working.

This is error that occured on ```yarn dev```

![image](https://user-images.githubusercontent.com/19279947/84417177-8d1cff80-ac15-11ea-942a-4acf9b9b8bcb.png)

After logging data that is sent to ```<Avatar/>``` component I noticed that ```picture``` is actually an ```Array```.

![image](https://user-images.githubusercontent.com/19279947/84417337-c05f8e80-ac15-11ea-9cf5-a6890bc1744b.png)

After modifying code bellow everything works as it should and CMS works properly.
2020-06-12 01:48:27 +00:00
Matthew Sweeney
7e16f7f43b
Update with-userbase Example (#14100)
This PR updates the `with-userbase` example with the following changes:

- Removes the `vercel.json` file, this is no longer needed with [recent changes](https://vercel.com/docs/v2/build-step#environment-variables).
- Changes the URL of the Deploy Button to use `?env`, `?envLink`, and `?envDescription` query strings, these prompt for environment variables upon import.
- Updates the instructions to reflect the changes made to the import and deployment process.
2020-06-12 01:20:52 +00:00
Jason Miller
d23c22c544
[Examples] Fix using-preact dev mode issues (#14098)
Should fix https://github.com/vercel/next.js/pull/13976#issuecomment-641677695

/cc @monsonjeremy - let me know if this work for you.
2020-06-12 00:59:03 +00:00
Luis Alvarez D
2cd691050a
Add new import flow to CMS examples (#14053)
[ch2502]

- Added new import flow to every CMS example, using the deploy button, and removed `vercel.json`
- Replaced `dotenv` with the new env support in outdated examples
2020-06-11 23:44:23 +00:00
HYUNSANG HAN
7e1d174e8e
Fix route in custom-server-koa example (#14080)
Links of the example about `custom-server-koa` were wrong, so I fixed them.
2020-06-11 18:44:29 +00:00
Todor Totev
c337db8d7e
[Example] remove getInitialProps from aws-amplify-typescript (#13898)
Related to [11014](https://github.com/vercel/next.js/issues/11014)
2020-06-11 18:02:58 +00:00
Todor Totev
6c8b7cde7d
[Examples] remove getInitialProps from with-firebase-authentication (#13895)
Related to [11014](https://github.com/vercel/next.js/issues/11014)
2020-06-11 17:38:29 +00:00
Cristian
1ffc7af36a
[Examples] Update with-chakra-ui (#14035)
* [Examples] Update with-chakra-ui

* Pass theme prop to ThemeProvider

Co-authored-by: Cristian Dominguez <cristiand391@users.noreply.github.com>
2020-06-11 01:34:41 -05:00
Shu Uesugi
30f30af320
Storyblok CMS Example (#13993)
[ch2842]

- Demo: https://next-blog-storyblok.now.sh/
- Preview Mode: https://next-blog-storyblok.now.sh/api/preview?secret=5nnybHTKlbzkOa6r&slug=draft-post-test
2020-06-10 22:23:28 +00:00
Shu Uesugi
dea4c2cbf4
ButterCMS Example (#13908)
[ch2580]

**Demo:** https://next-blog-buttercms.now.sh/
**Preview Mode:** https://next-blog-buttercms.now.sh/api/preview?secret=CdEAKMRT4tAwzqiD&slug=draft-post-test
2020-06-10 17:13:10 +00:00
Darsh Patel
f24eb4fd4a
Added .next folder to gitignore for examples/blog-starter (#14003)
```.next``` folder wasn't in the gitignore file causing .next folder to be tracked by git
2020-06-10 10:09:42 +00:00
Dylan Jhaveri
d5f5b5f29b
with-mux-video update (#13992)
* function rename
* update package.json dependencies to use `^` for semver. I noticed the package-lock.json is not committed in these examples, which seems to be intentional. Is it advisable to use semver for dependencies? This could actually break if someone clones, installs and a newer version of something has a breakage, but in general it might be nice to have folks installing the latest patch releases for deps.
* use Upchunk 2.0.0. with 1000x [better progress reporting on uploads](https://github.com/muxinc/upchunk/releases/tag/v2.0.0)

**Notice the progress %**

Upchunk pre 2.0:

![before-loading](https://user-images.githubusercontent.com/764988/84232581-70fa5080-aaa5-11ea-8db8-2cfe50339b43.gif)

Upchunk 2.0:

![after-loading](https://user-images.githubusercontent.com/764988/84232620-85d6e400-aaa5-11ea-82cc-b348ead1f5de.gif)
2020-06-10 07:05:14 +00:00
Luis Alvarez D
43271821f2
[Examples] Move with-typescript-graphql to SSG (#13854)
Related to https://github.com/vercel/next.js/issues/11014
2020-06-10 04:14:53 +00:00
Luis Alvarez D
9dc902835c
[Examples] Move api-routes-apollo-server-and-client-auth to SSG (#13849)
Related to https://github.com/vercel/next.js/issues/11014

The authentication method has been replaced with an improved version of the passport example.
2020-06-10 03:46:11 +00:00
James Mosier
aed8b37529
Fix variable shadowing in blog-starter example (#13988)
Sorry for the super trivial PR. I noticed this while working with the example and figured it might be worth fixing.
2020-06-10 03:30:22 +00:00
Luis Alvarez D
3a9fbd8396
[Examples] Move with-apollo-and-redux to SSG (#13779)
Ref: https://github.com/vercel/next.js/pull/13742
2020-06-09 21:11:45 +00:00
Jason Miller
f2e29f6ade
[Examples] using-preact: add Prefresh, DevTools & chunking fix (#13976)
This adds [prefresh](https://github.com/JoviDeCroock/prefresh) and [preact/debug + DevTools](https://preactjs.com/guide/v10/debugging/) during development. It also fixes the chunking/splitting configuration for production builds by creating a `preact` chunk based on the existing framework chunk.

I'm still considering publishing the config here as a plugin, since I worry about the copy-paste effect on this much regex-foo.

/cc @jovidecroock
2020-06-09 20:35:52 +00:00
Jayden Seric
9fea9dbe6d
Update the with-graphql-react example (#13928)
- Removed the manual `fetch` polyfill as that is handled automatically by Next.js now.
- Updated dependencies, including [`graphql-react`](https://github.com/jaydenseric/graphql-react) and [`next-graphql-react`](https://github.com/jaydenseric/next-graphql-react).
- Removed `next.config.js` as it’s no longer required for [`next-graphql-react`](https://github.com/jaydenseric/next-graphql-react).
- Renamed the index page component from `Home` to `IndexPage`.
- Tweaked the [`graphql-react`](https://github.com/jaydenseric/graphql-react) bundle size mentioned in the readme.
2020-06-09 18:06:19 +00:00
Wilbert Abreu
d3f0aee0ee
Adding Example: with-recoil (#13380)
Co-authored-by: Wilbert Abreu <wilbert.a.abreu@aexp.com>
Co-authored-by: Luis Alvarez <luis@vercel.com>
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-06-08 21:33:08 -04:00
Todor Totev
47e2beba20
[Example] Deprecate with-sentry in favor of with-sentry-simple (#13904)
Co-authored-by: Luis Alvarez D <luis@vercel.com>
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-06-08 21:32:23 -04:00
Shyam Gupta
506116c7d0
chore: remove-redundant-example-react-import (#13907)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-06-08 21:31:56 -04:00
Luis Alvarez D
258f8c0e4e
[Examples] Move with-react-relay-network-modern to SSG (#13878)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-06-08 21:31:22 -04:00
Luis Alvarez D
b4ec992815
[Examples] Move with-graphql-hooks to SSG (#13858)
Related to https://github.com/vercel/next.js/issues/11014

The setup is very similar to the one used for Apollo examples.

@Joezo I've removed the demo example that you added to the readme (https://github.com/vercel/next.js/pull/6482) as it will be outdated after this PR is merged.
2020-06-08 16:23:34 +00:00
Luis Alvarez D
154c4958b0
[Examples] Move with-relay-modern to SSG (#13882)
Related to https://github.com/vercel/next.js/issues/11014
2020-06-08 15:41:47 +00:00
Akindolie Oluwatayo
b922fe8abf
Update README.md (#13899)
Few text corrections.
2020-06-08 14:12:38 +00:00
not
319b858e77
fix typo in comment (#13883) 2020-06-08 01:03:38 +00:00
Simon Goldin
c61fd50419
update test snapshot in with-typescript-eslint-jest (#13847)
Updating snapshot for https://github.com/vercel/next.js/pull/13732 where the `toMatchSnapshot` expectation moved to another test.
2020-06-07 23:54:16 +00:00
Todor Totev
2ede86ffa9
[Examples] Remove getInitialProps from with-rematch (#13834)
Related to [11014](https://github.com/vercel/next.js/issues/11014)
2020-06-06 16:57:16 +00:00
Luis Alvarez D
792a113d48
[Examples] Move api-routes-apollo-server-and-client to SSG (#13782)
Ref: https://github.com/vercel/next.js/pull/13742
2020-06-06 13:04:52 +00:00
Shu Uesugi
1935196e5e
Prefer docs site for documentation links in CMS examples (#13826)
[ch579]

Some README files in `examples/cms-*` were linking to a documentation markdown file inside the repo (e.g. `/docs/basic-features/pages.md`) instead of the documentation website. We should always link to the documentation website from an example README file because (1) the website has better UX and (2) as we’re creating the examples pages on `next-site` (https://github.com/vercel/next-site/pull/672), we’d like to avoid extra processing of markdown content.
2020-06-06 00:23:20 +00:00
Dan Williams
2c8ab89e37
Fixed graphql-hooks example data prefetch (#13799)
- Fixes the Next.js `with-graphql-hooks` example so that data is prefetched during SSR:
    - The example was using an old version of `graphql-hooks` where SSR was broken
    - It had a bug where the `graphql-hooks` client passed in to the `AppTree` as a prop was not being used (instead was creating a new client every time)

This resolves https://github.com/nearform/graphql-hooks/issues/439 for `graphql-hooks`.
2020-06-05 17:11:40 +00:00
Todor Totev
b12f5a2669
[Examples] Remove React.FC from with-stripe-typescript (#13803)
Related to [this](https://github.com/facebook/create-react-app/pull/8177).

Let me know if you want me to change something.
2020-06-05 16:17:36 +00:00
Todor Totev
097287489f
[Examples] Refactor with-electron-typescript (#13802)
Related to [11014](https://github.com/vercel/next.js/issues/11014).

Removed getInitialProps in favor of getStaticProps and getServerSideProps. Refactored one of the components from class to functional. Removed redundant imports. Removed React.FC/FunctionComponent. Added two build files to gitignore.

Let me know if you want something to be changed.
2020-06-05 16:00:10 +00:00
Luis Alvarez D
2d2c7626e3
[Examples] Move with-apollo to SSG (#13742)
Based on https://github.com/vercel/next.js/pull/13607 - I created a new PR as I can't push changes to the initial PR.

Migrated the Apollo client to use SSG, also removed the link to the live demo because I don't know who the owner is or how to update the deployment.

The implementation is pretty simple and will be added to all the other Apollo examples
2020-06-05 15:41:42 +00:00
Todor Totev
22b2920aac
enhance-with-redux-saga (#13764)
[11014](https://github.com/vercel/next.js/issues/11014)

Removed getInitialProps from _app
2020-06-05 14:59:13 +00:00
Todor Totev
4d7b3fdf98
[Examples] Refactor with-electron (#13800)
Not much happening, the main page was converted from class to functional component.
2020-06-05 14:41:03 +00:00
Todor Totev
88fd6cf31d
[Examples] Removed React.FC/FunctionComponent from with-typescript (#13798)
Related to [this](https://github.com/facebook/create-react-app/pull/8177).

Let me know if you want me to change something.
2020-06-05 10:40:37 +00:00
Todor Totev
0175b98928
[Examples] Removed React.FC from blog-starter-typescript (#13797)
Related to [this](https://github.com/facebook/create-react-app/pull/8177).

Let me know if you want me to change something.
2020-06-05 10:15:55 +00:00
Adam Zacharski
f37c00279b
Fix sample command (#13789)
dev doesn't seem to exist
2020-06-05 03:18:48 +00:00
Allen Hai
87f9f91187
Update to modern env handling for userbase example (#13774)
This PR removes the `next.config.js` file and renames the environment variable in `vercel.json` to use the new `NEXT_PUBLIC` prefix.
2020-06-05 00:50:56 +00: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
Jazib Sawar
6ce7a0378e
CMS Cosmic Example (#13499)
* Add Cosmic CMS Example

* with native .env support, this file isn't needed anymore

* FIX use path alias

* Add cosmicjs package

* Fix alias import in pages/api/preview

* Added: react-imgix & lazysizes package

* Load lazysizes in layout

* Used imgix image with lazyloading

* Added avatar imgix optimizations

* EDITED: steps to install content, preview

* EDITED: demo link

* EDITED: Install step

* EDITED: preview link steps

* Edited: demo link

* FIXED: object_slug

* Screenshots

* Fixed object_slug link

* Update README.md

* Fix: formatting issue

* Updated readme and renamed .env to env.local

* Sanity checks

* Handle fallback data when expected

* Added link to the example in other examples

* Updated demo deployment

* Added example to docs

* minor lint fix

* Remove manual download step

* use vercel.json

Co-authored-by: Tony Spiro <tspiro@tonyspiro.com>
Co-authored-by: Luis Alvarez <luis@vercel.com>
2020-06-04 15:18:11 -05:00
Joe Haddad
8287ed233d
Replace dotenv example (#13770)
This removes the `with-dotenv` example in favor of a README that directs users to the docs.
2020-06-04 18:18:09 +00:00
Vincent Voyer
d8f2f8166e
examples(iron-session): update fetch, env, UI, deps, and docs (#13756) 2020-06-04 13:12:52 -04:00
Todor Totev
dbe5973fae
[Example] with-typescript-types (#13746)
Closes [7882](https://github.com/vercel/next.js/issues/7882).
Created as requested by @timneutkens 

I'm unsure if that's exactly what you wanted, so let me know what you want me to change and I'll do it asap.
2020-06-04 16:25:28 +00:00
Timothy
d1c16124b5
Update instances of Now to Vercel where applicable (#13760)
This pull request renames various instances of `now` to `vercel` etc. in order to match content that's being updated on the Vercel platform.
2020-06-04 14:57:17 +00:00
Shu Uesugi
c02d86ec52
Docs: Add supported browsers and features (#13741)
[ch1981]

Add the “Supported Browsers and Features” page. The content is taken mostly from the blog posts: [9.4](https://nextjs.org/blog/next-9-4), [9.3](https://nextjs.org/blog/next-9-3), and [9.1.7](https://nextjs.org/blog/next-9-1-7).

- This page is added under “Basic Features” on the sidebar.
- It still links to `with-polyfills` example, but [this example was updated recently](04fbe0b756). I simplified the README.
- Removed the FAQ section on supported browsers.
- On ["Customizing Babel Config"](https://nextjs.org/docs/advanced-features/customizing-babel-config), remove the list of presets which were outdated and instead link to [the preset file](https://github.com/vercel/next.js/blob/canary/packages/next/build/babel/preset.ts) so it’s always up to date.
2020-06-04 10:15:34 +00:00
Giulio Fagioli
00eef1720c
Update Firebase Auth Example for New Env Support (#13587)
Prefixed variables name with NEXT_PUBLIC_.

Solving #13585 issue related to get undefined from process.env.VARNAME inside .env* files.

I'm not secure if SESSION_SECRET_* need the prefix.
2020-06-04 07:01:22 +00:00
Todor Totev
16300db182
with-videojs fix (#13745)
Closes [13730](https://github.com/vercel/next.js/issues/13730)

Brought back the ref implementation.
Added another component that uses just the videojs-youtube package
2020-06-04 06:41:46 +00:00
Filipe Marins
42140bd1d8
Update test description of with typescript eslint jest example (#13732)
The tests was with description changed
2020-06-03 21:43:53 +00:00
Todor Totev
34f82a996b
Refactor with redux observable (#13615)
Related to [11014](https://github.com/vercel/next.js/issues/11014)

1. Moved the reducer into the store and created new store file
2. The example was using a server that was no longer available, now it uses JSON placeholder instead.
3. Moved from getInitialProps to getStaticProps
4. Refactored all the classes to functional components, using the new redux hooks API.
5. Upgraded all the packages and using custom redux wrapper instead of next-redux-wrapper, which I have removed from the example.
6. Upgraded all the other packages.

Please, let me know if I should change anything.
2020-06-03 09:23:16 +00:00
Tyler Evans
066f694133
example(chakra-ui): pass through pageProps in custom app (#13690)
Took me a while to figure out why the simple data fetching examples weren't working in my project, which I based off this template. Here's the fix.
2020-06-03 02:44:25 +00:00
Luis Alvarez D
ef22a8b7c5
[Examples] Add missing cms links (#13683)
This was a change that I forgot to push into the Agility CMS example PR, adding it now.
2020-06-02 17:36:12 +00:00
Joe Haddad
d650da0623
Remove refs to old css experiment (#13673)
Removes some dangling references to non-existent experimental options.
2020-06-02 16:57:35 +00:00
Tim Neutkens
31b3e46b8f
Use inclusive naming for variables / examples (#13657)
https://twitter.com/vercel/status/1267650234236252161

The variables for the launchEditor feature were kept consistent with Create React App so it's probably a good idea for them to change them too: https://github.com/facebook/create-react-app/search?q=WINDOWS_FILE_NAME_WHITELIST

Prior discussions on this topic:
- https://github.com/hashicorp/consul/issues/7901
- https://github.com/styled-system/styled-system/issues/391
- https://github.com/go-sql-driver/mysql/pull/1116
- https://github.com/lagom/lagom/issues/2532
- https://github.com/grafana/grafana/issues/18841
2020-06-02 13:52:41 +00:00
James Vidler
7c203b80c9
Added Agility CMS example 🏆 (#12788) 2020-06-02 01:49:04 +00:00
Kirill Konshin
65f0574c16
Update with-redux-wrapper example (#13649)
Follow up for #11802

Makes sure app is not opted out of Automatic Static Optimization.
2020-06-02 00:13:38 +00:00
Shu Uesugi
d60fada097
CMS Strapi Example (#12701)
* Strapi Example

* Fix og image URL

* Remove next.config.js

* Apply updates

* Remove API_URL

* Bugfixes

* Finish Strapi README

* Deploy Strapi

* Add strapi examples

* now →  vercel [ch1796]

* Use npx

* Minor readme update

* Prettier fix

Co-authored-by: Luis Alvarez <luis@vercel.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-06-01 18:49:43 -05:00
Luis Alvarez D
ad24a0c855
[Examples] Add WordPress Blog (#13194)
* Added most of the stuff

* Updated pages

* Removed unrequired deps

* API fixes

* Fixes fixes and updated readme

* Updated og image

* Added demo and links to example

* Updated packages

* update name. bump dependencies

* Renamed .env.example to .env.local.example

* Added node_modules to .gitignore

* use recommended config

* enable absolute import/alias support

* remove jsconfig.json

* allow HTML entities in post titles

* add underline to content links

* add basic ul & ol styles

* add code block styles

* add basic text alignment

* add basic image alignment styles

* adjust pre font-size and figcaption

* indent ul,ol lists to line up with grid

* add basic button styles

* add basic file styles

* add basic blockquote style

* add basic audio styles

* add h4 and enhance blockquote styles

* add basic cover block styles

* add basic verse styles

* add basic two-column block styles

* add tags

* add categories

* Only ignore .vercel

The rest is injected by create-next-app

* now → vercel

* npm init → npx

* Wordsmith

* Wordsmith

* Wordsmith

* Wordsmith

* Improve issue link

* Wordsmith

Co-authored-by: Greg Rickaby <greg@gregrickaby.com>
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
Co-authored-by: Shu Uesugi <shu@chibicode.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-06-01 17:17:20 -05:00
Rafael Almeida
2bf8153c27
[with-typescript] Remove React.FC (#13643)
The motivation for this PR is well explained here: https://github.com/facebook/create-react-app/pull/8177
I can expand it to the other examples too if you agree with the change
2020-06-01 20:41:56 +00:00
Todor Totev
795d9319a6
Fix with antd ssg (#13611)
Closes #12664 
Closes #13604 

The culprit was not only changing the library directory, but also having the icons version past 4.0.6. Also, the components which used the library had to be adjusted according to the new changes.

Confirmed that it works both in production and development. Confirmed that it builds on dev and production.

![Alt Text](https://media.giphy.com/media/dZ46aA1Rs7Oi1wSQKU/giphy.gif)
2020-06-01 19:08:59 +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
Akhila Ariyachandra
032ca0364d
Updated with-magic example with new Environment Variables Support in Next.js 9.4+ (#13623) 2020-06-01 19:19:48 +02:00
Luis Alvarez D
7a1724f326
[Examples] Remove unused file from with-redux (#13570)
Leftover from a past PR
2020-05-31 21:11:35 +00:00
Martin Bavio
f8f308d6dd
Fix examples using __NEXT_DATA__ (#13567)
This PR fixes https://github.com/vercel/next.js/issues/4883.

It introduces a new global variable (`window.__REHYDRATE_IDS`) only when necessary.

In the case of the `with-react-with-styles` example, rehydration isn't happening, so I removed the creation of the variable. 

In the case of the `with-react-intl` example, the information doesn't seem to be set anymore on `__NEXT_DATA__`, so I just removed the default reference to it.
2020-05-31 20:20:01 +00:00
Todor Totev
11597655d9
Enhance with redux thunk example (#13576)
* Refactored the store so that it doesnt use getInitialProps

* Applied the changes in the _app file

* Refactored the wrapper so that it uses the new store flow

* Removed the old redux syntax

Instead of passing the state from the parent component, I have used the new redux hooks to retrieve the current state.

* The clock no longer requires state to be passed too

* Updated the variable names

* forgot to bring back hot reloading

* Applied requested change.
2020-05-31 11:53:01 -05:00
Todor Totev
bb23d37b28
Enhance with redux persist (#13577)
* Moved the state to the clock component

* Refactored the store according to the new requirements

* Refactored _app so it uses the new store

* This file is no longer needed

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-05-30 13:00:37 -05:00
Thor 雷神
ca816df4de
Stripe example updates (#13581)
- Update to latest stripe-node version and pin the exact version so the Types won't go out of sync
- Add the env var changes for next 9.4.4 (https://nextjs.org/blog/next-9-4#new-environment-variables-support)
  - Remove `next.config.js` as no longer needed.
- Add the Deploy to Vercel button
2020-05-30 17:32:36 +00:00
MichelleLucero
3dbddfa02a
[ EXAMPLES ] Added with-mongodb example (#13028)
* created with-mongodb, Next.js + MongoDB

Co-authored-by: Shania Dhani <31454777+sdhani@users.noreply.github.com>
Co-authored-by: Michelle Lucero <31500626+MichelleLucero@users.noreply.github.com>
Co-authored-by: Chi Shing Lee <60354073+chislee0708@users.noreply.github.com>

* Update examples/with-mongodb/README.md

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>

* modified for dotenv and environment var setup

* removed extra instructions on readme, linked it to the MongoDB guides

* changes to environment var

* replaced document with react logic

* removed Pet header

* removed isomorphic-unfetch

* replaced getInitialProps with getStaticProps (SSG)

* removed console log

* deleted next.config.js file

* fixed prettier styling

* fixed link 404 server rendering issue

* modified server path for delete/edit

* fixed prettier styling

* fixed a typo

* change .env to .env.local

Co-authored-by: Joe Haddad <timer150@gmail.com>

* fixed typo, change .env to .env.local

Co-authored-by: Joe Haddad <timer150@gmail.com>

* change .env to .env.local

Co-authored-by: Joe Haddad <timer150@gmail.com>

* Update examples/with-mongodb/package.json

Co-authored-by: Joe Haddad <timer150@gmail.com>

* removed dotenv dev dependency

Co-authored-by: Joe Haddad <timer150@gmail.com>

* cleaned up code and instructions

* Update examples/with-mongodb/.gitignore

Co-authored-by: Luis Alvarez D. <luis@vercel.com>

* minor changes to code style and logic

* Updated index page and .env.local.example

* Updated new page

* Don't use SSG for the edit page

* Fixed revalidation issue

* Use es6 for the model

* Updated edit page

* Removed VERCEL_URL

* Updated readme and renamed env

* Added temporal vercel.json

* Removed seed until added with a script

* Updated package.json

* Renamed example in readme

* Renamed example

* Lint fix

Co-authored-by: liulanz <zhengliulan@gmail.com>
Co-authored-by: Shania Dhani <31454777+sdhani@users.noreply.github.com>
Co-authored-by: Chi Shing Lee <60354073+chislee0708@users.noreply.github.com>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: sdhani <shania.dhani46@myhunter.cuny.edu>
Co-authored-by: liulanz <37808313+liulanz@users.noreply.github.com>
Co-authored-by: Joe Haddad <timer150@gmail.com>
Co-authored-by: Luis Alvarez D. <luis@vercel.com>
2020-05-30 12:15:00 -05:00
Martin Bavio
2a473ab42c
Make Linaria great again (#13568)
This PR fixes https://github.com/vercel/next.js/issues/7769.

However, I would like for @jayu to confirm that it's ok to use the latest Linaria 2.0 alpha release. I can confirm from my local testing that it's working as expected.
2020-05-30 00:05:49 +00:00
Michael Albertz
44fbc24ccd
[Example] Add with-web-worker example (#13444)
Resolves: https://github.com/zeit/next.js/issues/12545

This PR adds an example which show how to bundle and use WebWorkers in a next.js app.

The issue mentions Typescript, but adding typescript to the example should be fairly simple by following the documentation and seems out of scope for a web-worker example.
2020-05-28 23:07:23 +00:00
Aral Roca Gomez
6b65efb624
Fix typo (#13523)
Fix a typo.
2020-05-28 22:29:54 +00:00
Rubén Sospedra
8d97353d38
Add example with next-translate (#13511)
Motivated by the need to deploy static sites while having a good i18n support¹ ² @vinissimus developed [next-translate](https://github.com/vinissimus/next-translate).

Here's the example ;)

References:
1. https://github.com/vercel/next.js/discussions/10651
2. https://github.com/vercel/next.js/pull/12535#issuecomment-624317275
2020-05-28 21:31:05 +00:00
Mathis Chenuet
16d2235882
Update proxy example to http-proxy-middleware ^1 (#13507)
The current example doesn't work if one try to reproduce it with a recent version of http-proxy-middleware.
2020-05-28 21:00:58 +00:00
Joe Haddad
db5b5a76a8
Update some examples to Vercel (#13477)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-05-28 13:32:29 +02:00
Chandu
5eafc1e92a
refactor(with-redux): update example to use getStaticProps (#13378)
@lfades hope this works. I have updated the example to show differences between client/ssr/ssg initial state in redux. Let me know if something needs to be changed.
2020-05-28 05:12:27 +00:00
Joe Haddad
b7e17e09e5
Update references to zeit/next.js (#13463) 2020-05-27 17:51:11 -04:00
Jimmy Merritello
001230e0a8
Add Route as Modal Page Example (#12945)
### Add dynamic routes to _with-route-as-modal_ example

This PR adds [dynamic routes](https://nextjs.org/docs/routing/dynamic-routes), [getStaticPaths](https://nextjs.org/docs/basic-features/data-fetching#getstaticpaths-static-generation), and [getStaticProps](https://nextjs.org/docs/basic-features/data-fetching#getstaticprops-static-generation) to the **with-route-as-modal** example. This change might also clear up some confusion here on https://github.com/zeit/next.js/issues/11971

Additionally this PR makes sure each modal route is also a modal **page.**

This is an important distinction and makes sure the experience is the same should the URL (route) be shared as a link. In other words, `index.js` need not be the only "entrypoint" to browsing the website.

With the additions in this PR, each post page is an actual page, so if you were to share the link for **Post 3** you'd get this:

<img src="https://user-images.githubusercontent.com/7191639/82058282-25ad7780-968a-11ea-94f1-9b4a36abccf9.png" width="200px" />

(clickable outer region brings you back to the 'gallery')

**Update:** I have also included the `pathname` to signal the difference in which page component is rendered

Rather than this (previously):

<img src="https://user-images.githubusercontent.com/7191639/82058199-0878a900-968a-11ea-97d2-e9e20c9267fc.png" width="200px" />

I have used a similar approach [here 🔗](https://hashiconf.com/digital-june/schedule/the-hitchhikers-guide-to-terraform-your-infrastructure)
2020-05-27 21:22:33 +00:00
Stephen Cefali
d98cd8ad31
Add release argument to SentryWebpackPlugin (#13459)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-05-27 14:28:02 -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
TodorTotev
710997d494
refactor(with-sentry): example (#13434)
1. I updated all the packages.
2. Refactored the home component from class to functional
3. Example now uses getServerSideProps instead of getInitialProps
2020-05-27 16:11:46 +00:00
Benjamin Pearson
aef7f27072
Example: Static Generation of local Apollo GraphQL schema (#13202)
## What

An example to show how you can create a static generated build of Next.js (using the new `getStaticProps` and `getStaticPaths` functions) with data fetched from a local GraphQL schema. The same schema is used to host a GraphQL endpoint using the API Route `/api/graphql`.

## Why

I was setting up a static hosted website whereby data is stored in a set of local JSON files (pulled from a backend server at build time). I wanted to consume the content using the developer benefits that GraphQL provides and using a consistent interface the GraphQL API consumers would be using.

Within my page components I initially made GraphQL `fetch` calls to the locally running `/api/graphql` endpoint which worked well with `npm run dev`, however when it came to `npm run build` that endpoint was inaccessible (I tried both VERCEL_URL and localhost:3000) - which is now understandable given I read further the "[Write server-side code directly](https://nextjs.org/docs/basic-features/data-fetching#write-server-side-code-directly)" documentation.

This example may or may not be useful for others so please feel free to close, but I thought I would contribute incase it assisted others.

## Related Discussions

It looks as though this PR may help with some of the following discussions:
  - https://github.com/zeit/next.js/discussions/12785
  - https://github.com/zeit/next.js/discussions/10946
  - https://github.com/zeit/next.js/discussions/12182
  - https://github.com/zeit/next.js/discussions/11285

## Related Examples

The end solution for this PR was a combination of web discussions and seeing the `api-routes-graphql` example. Perhaps this PR should just update that example to use the new methods? Or maybe it is worth having both?
- https://github.com/zeit/next.js/blob/canary/examples/examples/api-routes-graphql

This is also similar to this example, although that example has more code in order to provide isomorphic Apollo Client for client side code use.
- https://github.com/zeit/next.js/blob/canary/examples/api-routes-apollo-server-and-client

## Errors Recieved
I've included the below errors as they are the ones I faced when figuring out the end solution. These may just help with SEO for others googling the same issue.

### Error when trying to use localhost:3000
```
> Build error occurred
{ FetchError: request to http://localhost:3000/api/graphql failed, reason: connect ECONNREFUSED 127.0.0.1:3000
    at ClientRequest.<anonymous> (/vercel/7cf60e2b/.next/serverless/pages/content.js:1999:147829)
    at ClientRequest.emit (events.js:198:13)
    at Socket.socketErrorListener (_http_client.js:401:9)
    at Socket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
    at process._tickCallback (internal/process/next_tick.js:63:19) type: 'system', errno: 'ECONNREFUSED', code: 'ECONNREFUSED' }
```

### Error when trying to use VERCEL_URL
```
> Build error occurred
{ FetchError: invalid json response body at https://vercel.com/login?next=%2Fdeployments%2Fprojectnamehere.now.sh%3Fhost%3Dprojectnamehere.now.sh%26redirect%3D1%26section%3D reason: Unexpected token < in JSON at position 0
    at /vercel/3d91c11/node_modules/next/dist/compiled/node-fetch/index.js:1:133590
    at process._tickCallback (internal/process/next_tick.js:68:7) type: 'invalid-json' }
```
2020-05-27 06:05:10 +00:00
TodorTotev
4a02dc5a17
Refactor class components to functional @ examples (#13398)
**Affected examples**

with-segment-analytics
with-slate
with-portals-ssr ( _with-portals-ssr is based on a package not being updated in the last year_)
with-videojs
with-next-page-transitions
with-firebase-cloud-messaging
with-dynamic-app-layout
with-dynamic-import
with-next-transition
with-carbon-components
with-cerebral
with-custom-babel-config

Here and there I have removed some redundant imports as well. I believe with this PR, there are only 1 or 2 examples left using class-based components. If by any chance you find any, let me know and I'll refactor them too.

If you don't like anything or you want me to change something, please let me know.

**If there is anything else you'd like me to help with, I would be honored to assist.**
2020-05-27 05:14:26 +00:00
Jesse Jafa
2e5a7c8cc8
Removed redundant react imports from with-overmind (#13422)
Per https://github.com/zeit/next.js/issues/12964

Removed redundant react imports from next.js/examples/with-overmind
2020-05-27 04:12:07 +00:00
Joe Haddad
dcfa35faa6
Fix with-sentry-simple example (#13404)
Previous referencing the incorrect `Error` global.
2020-05-26 16:58:03 +00:00
Jesse Jafa
2828b01950
Fixing Redundant React imports on next.js/examples (#13384)
Per https://github.com/zeit/next.js/issues/12964

* with-ant-design
* with-dynamic-import
* with-iron-session
* with-monaco-editor
* with-next-page-transitions
* with-react-with-styles
* with-style-sheet
* with-why-did-you-render

Tested each example, working as intended, no additional issues presented
2020-05-26 15:03:58 +00:00
TodorTotev
7ec57c6c93
Refactor with rematch example (#13392) 2020-05-26 08:24:36 -04:00
Jesse Jafa
658e0f8d34
with-overmind server error because of incorrect getStaticProps return statement (#13385)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-05-26 11:06:46 +02:00
Jesse Jafa
5eac7cc042
Fixed with-iron-session to work on Windows systems (#13386)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-05-26 10:57:56 +02:00
Daniel Paz
599d6f71bb
Update Monaco Editor Example (#13369)
Changed the URLs inside the Monaco Editor Example: https://github.com/zeit/next.js/tree/canary/examples/with-monaco-editor

Converted the worker URL to start with the base URL.

The reason is if you use the Monaco example anywhere but in the main `pages` folder, it won't work since it uses a relative URL instead.

For example if we'll move the code to `pages/room/index.js` it won't work since it will try to search for the files inside `room/_next/_static/` instead of `_next/_static/`.

The base URL I added fixes the problem.
2020-05-25 22:22:28 +00:00
Erik
268d3572bc
[examples] with-ts-eslint-jest example app (#12025)
* set up with-ts-eslint-jest example app

* eslint ignore new app bc it has a conflicting eslintrc

* make eslint + husky setup manual

* clarify app README setup notes

* move page tests out of pages/ dir

* Simplifying configs

* extend "prettier"

* format fix

* Updated rules

* Added husky configs and removed debug option

* Removed notes and configuration

* Updated pages

* Added links to readme

* Added example to .prettierignore

* Updated snap

* Make the lint work

Co-authored-by: Luis Alvarez D <luis@vercel.com>
2020-05-25 13:16:06 -05:00
TodorTotev
5a5e6004d7
Refactor with redux persist example (#13338)
Related to [11014](https://github.com/zeit/next.js/issues/11014)

First and most important, removed the getInitialProps and used getStaticProps.

Then, I refactored Counter, DataList and Examples components.
I have refactored them from class-based components to functional. Also in each component the redux implementation was refactored using the new hooks API, which resulted in ~40% less code.

If you want me to change anything or you are not satisfied with any given change, I'm open to suggestions.
2020-05-25 17:28:39 +00:00
Giuseppe
73c8b8ca92
Update with-style-sheet example (#13323) 2020-05-25 17:11:50 +00:00
TodorTotev
f3ea363df7
Refactor with redux thunk example (#13336)
Related to [11014](https://github.com/zeit/next.js/issues/11014)

1. I have changed the component from class to functional.
2. I have removed the getInitialProps and used getStaticProps instead.
3. I have removed the redundant connect to redux @ the index page, due to the fact that now we can dispatch the action with the required hook.

If you want me to change anything or you are not satisfied with any given change, I'm open to suggestions.
2020-05-25 16:55:33 +00:00
TodorTotev
cc4b0c7b40
Refactor with redux saga (#13342)
Related to [11014](https://github.com/zeit/next.js/issues/11014)

Upgraded all the packages from package.json, removed the saga-wrapper package since it is totally outdated to today's use.

I have refactored the whole example using the new API of the next-redux-wrapper package, using their new support of "getStaticProps".

All of the class components were converted to functional, using the new redux hooks API.

If you want me to change anything or you are not satisfied with any given change, I'm open to suggestions.
2020-05-25 16:21:35 +00:00
Takumasa Sakao
43a54fb338
Fix wrong README of blog-starter-typescript example (#13330)
* Replace blog-starter to blog-starter-typescript

* Fix unnecessary replacement
2020-05-25 08:57:17 +02:00
Mohsen Azimi
9fb2432b14
Add ThemedStyleSheet.registerInterface to react-with-styles example (#13284)
My [draft PR was merged](https://github.com/zeit/next.js/pull/13193) so let's at least keep the code in canary in a working state.
2020-05-23 22:12:24 +00:00
Koji Sugimoto
dc1658f107
[Examples] Added blog-starter-typescript (#12981)
* feature: add blog-starter-typescript

* chore: edit tailwind.config

* Fix linting

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2020-05-23 20:34:35 +02:00
Joseph Knowles
83827f76d3
Uncomment private key (#13277) 2020-05-23 11:19:28 -05:00
Sam Bokai
6ca26bd960
Rename import to solve conflicting usage of Error constructor (#13256) 2020-05-22 17:54:32 -05:00
Shu Uesugi
94e20be204
With mux video readme updates (#13253)
* Add demo and note to with-mux-video

* Update README.md
2020-05-22 16:47:39 -05:00
Dylan Jhaveri
32dece149e
Add example: with-mux-video (#13120)
* yarn create next-app

* create an upload show page

* create upload page to handle in-progress upload and asset when it is ready

* move things to a layout component

* add some button styling

* poll for updates intelligently by dynamically setting refreshInterval on SWR hook

* better title

* edit gitignore, add MIT license use next 'latest'

based on feedback from https://github.com/zeit/next.js/pull/12723

* add some messages and spinner to make this a little nicer

* update README with environment variables info and Mux account info

* add .now to gitignore

* cleaner uploading state - redirect to /v/:playback_id when complete

* hardset image width in footer

* remove unused styles

* adjust title font size on mobile and adjust footer height on mobile

* use upchunk 1.0.8 so we don't have to dynamically load it

* cleaner error message handling

* fix brief error from returning Router on the render

* yarn lint-fix

* update README with note about .env.local

* add min height so the layout doesn't shift after selecting a file

* set poster attribute at video element

* use getStaticProps and fallback:true to render meta tags for social sharing

* create a pages/asset/:id route that we can be on while in the preparing state

* add copy about Mux, add twitter share widget

* add flash message about video ready for playback

* call it pre-rendered instead of server-side rendered

* pre-rendering, not server-side rendering

* Next.js not NextJS

* handle asset creation errors in the UI

* call hls.destroy() when the component is unmounted

* Updated readme and renamed .env.local

* Updated description

* add suggested patch with links to source code https://github.com/zeit/next.js/pull/13120#issuecomment-632858572

* Added vercel.json

* Updated some links

* Removed Prerequisites

Co-authored-by: Luis Alvarez <luis@vercel.com>
2020-05-22 16:13:12 -05:00
TodorTotev
cb1d744151
with-monaco-editor-example-fix (#13186)
* Modified nextjs config so that it works with all types of fonts and images.

* Update next.config.js

* Fix code

Co-authored-by: Tim Neutkens <timneutkens@me.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-05-22 20:11:01 +02:00
Mohsen Azimi
c67908c9a5
Upgrade react-with-styles to version 4 (#13193)
Currently failing because `withStyles` can't read the interface from context:


```
Unhandled Runtime Error
TypeError: Cannot read property 'createLTR' of undefined
webpack-internal:///./node_modules/react-with-styles/lib/withStyles.js (150:33)
```

Manually registering the interface resolves the issue:

```diff
diff --git a/examples/with-react-with-styles/pages/_app.js b/examples/with-react-with-styles/pages/_app.js
index 91d09a2a9..a393572b8 100644
--- a/examples/with-react-with-styles/pages/_app.js
+++ b/examples/with-react-with-styles/pages/_app.js
@@ -2,11 +2,16 @@ import App from 'next/app'
 import React from 'react'
 import WithStylesContext from 'react-with-styles/lib/WithStylesContext'
 import AphroditeInterface from 'react-with-styles-interface-aphrodite'
+import ThemedStyleSheet from 'react-with-styles/lib/ThemedStyleSheet'
 
 import defaultTheme from '../defaultTheme'
 
 class MyApp extends App {
+    constructor(props) {
+        super(props);
+        ThemedStyleSheet.registerInterface(AphroditeInterface)
+    }
   render() {
     const { Component, pageProps } = this.props
```

But that's not how it is documented. I'm following up with react-with-styles to see if this is a bug.
2020-05-22 17:54:36 +00:00
Jack Moore
ed2ca820b0
Created Expo TypeScript example project (#13182) 2020-05-22 19:21:46 +02:00
Alejandro Ñáñez Ortiz
71d899f128
Add urql to the examples list (#13006)
* Install UrQL dependencies

- Created the examples folder `with-urql`
- Installed the dependencies
- Got a simple index.js page setup

* Basic UrQL example

- Connects to Pokemon GraphQL API

* Loading Pokemon list + Pokemon page

- Using `isomorphic-unfetch` because `urql` uses `window.fetch` to get data because we need to query the GraphQL API using Node (in `getStaticProps`)
- Deleted `_app.js` since we're not using UrQL to query data on the clientside
- Put all GraphQL related code in `/graphql`

* Update README for UrQL example

* Update urql casing

* Update examples/with-urql/graphql/client.js

Co-authored-by: Joe Haddad <timer150@gmail.com>

* Update examples/with-urql/pages/index.js

Co-authored-by: Joe Haddad <timer150@gmail.com>

* Update examples/with-urql/pages/pokemon/[name].js

Co-authored-by: Joe Haddad <timer150@gmail.com>

* Fix linting

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: Joe Haddad <timer150@gmail.com>
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-05-22 18:56:34 +02:00
xliusstk
6c5efd7b09
Fix ssr-caching example (#12180)
cacheable-response.get expects a get(req, res) method signature:
https://www.npmjs.com/package/cacheable-response#get

Before the change:
```
curl -s  -v http://localhost:3000/blog/first 2>&1 | grep HTTP/1.1
> GET /blog/first HTTP/1.1
< HTTP/1.1 404 Not Found
```
After the change:
```
curl -s  -v http://localhost:3000/blog/first 2>&1 | grep HTTP/1.1
> GET /blog/first HTTP/1.1
< HTTP/1.1 200 OK
```

This is a partial fix of https://github.com/zeit/next.js/issues/12019 to make the example work. However it doesn't fix the error 
```
(node:62360) UnhandledPromiseRejectionWarning: Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
``` , which will need a change at server/next-server.ts

See related issue:
https://github.com/zeit/next.js/discussions/11525 
https://github.com/zeit/next.js/issues/11665
2020-05-22 16:29:37 +00:00
Marcus Silva
0b9475624f
chore: remove-redundant-example-import (#13175)
This issue is related to #12964 

**I changed the following examples:**
`with-zeit-fetch` 
`with-why-did-you-render`
`with-styletron`
`custom-server-fastify`
`custom-server-express`
`with-why-did-you-render`
`custom-server-hapi`
`custom-server-koa`
`custom-server-polka`
`custom-server-typescript`
`progressive-render`
`ssr-caching`
`svg-components`
`using-preact`
`with-ant-design`
2020-05-22 16:13:37 +00:00
Willian Justen
44d74e399f
chore: Remove react redundant imports on examples (#13169)
* Remove React redundant import on `analyze-bundles` example

 Co-authored-by: Marcus Silva <mvfsillva@gmail.com>

* Remove React redundant import on `api-routes-apollo-server-and-client-auth` example

Co-authored-by: Marcus Silva <mvfsillva@gmail.com>

* Remove React redundant import on `custom-server` example

    Co-authored-by: Marcus Silva <mvfsillva@gmail.com>

* Remove React redundant import on `custom-server-actionhero` example

Co-authored-by: Marcus Silva <mvfsillva@gmail.com>

Co-authored-by: Marcus Silva <mvfsillva@gmail.com>
2020-05-22 17:37:09 +02:00
TodorTotev
8618ab85ad
More redundant imports @ examples (#13190)
Again, related to [12964](https://github.com/zeit/next.js/issues/12964)

After checking all the other examples and the ongoing pull requests, I believe that with this PR being merged, all the examples should be free of redundant react imports.
Let me know if you want me to edit anything that you don't like.

Regards

with-typescript
with-atstroturf
with-atlaskit
with-styletron
with-styled-components-rtl
with-stylesheet
with-stomp
with-stitches-styled
with-stitches
with-slate
with-sentry-simple
with-sentry
with-segment-analytics
with-rematch
with-relay-modern
with-reflux
with-redux-wrapper
with-react-relay-network
with-react-native
with-react-multi-carousel
with-react-jss
with-react-helmet
with-react-ga
with-quill-js
with-prefetching
with-google-analytics-amp
with-google-analytics
with-framer-motion
with-flow
with-firebase-hosting
with-firebase-cloud-messaging
with-firebase-authentication
with-expo
with-dynamic-app-layout
with-draft-js
with-cxs
with-cerebral
with-ant-design-mobile
with-algolia-react-instantsearch
using-preact
progressive-render
2020-05-22 15:33:04 +00:00
Tim Neutkens
e4d22cec63 Fix formatting of older PR that passed tests 2020-05-22 14:36:01 +02:00
Arnar Kári Ágústsson
6ac2f4b74d
With reason relay example (#12080)
* Add with-reason-relay example

* update gitignore

* Add missing components

* Add _app.js wrapper

* Move records to wait for results

* Update readme

* Upload schema

* Add call to query hook to get viewerData with getFragmentRefs

* Move relay env setup to seperate module

* remove unused code

* lint fixes

* prettier fix
2020-05-22 12:13:44 +02:00
Tim Neutkens
b91e570a33
Move csp examples (#13221)
Fixes #12042
2020-05-22 11:35:27 +02:00
TodorTotev
7cf3c3d28d
Feat/remove redundant imports from examples (#13062)
The issue is related to [12964](https://github.com/zeit/next.js/issues/12964)

Let me know if there are any changes you want me to make.

Affected examples:

**with-glamor
with-graphql-hooks
with-graphql-react
with-grommet
with-http2
with-jest
with-cookie-auth-fauna
with-context-api
with-cerebral
with-aphrodite
with-apollo-and-redux
basic-css
with-carbon-components
amp-first**

I would love to help more, so let me know if there is anything specific I can contribute to.
2020-05-20 17:50:03 +00:00
Piotr Kuczynski
e28ce34ccb
Fix the link for Custom Server documentation (#13137) 2020-05-20 16:50:06 +02:00
Kirill Konshin
b8284d9a86
Upgrade Next Redux Wrapper to version 6 in examples (#11802)
Fixes https://github.com/zeit/next.js/issues/12920
2020-05-20 12:22:10 +00:00
Christian Alfoni
cc9e2526e4
With stitches (#12677)
split into two examples
2020-05-20 06:22:50 +00:00
jmgr2996
993b78de0b
chore: Remove some redundant imports (#13066)
This issue is related to [12694](https://github.com/zeit/next.js/issues/12964). I covered the following examples


- with-zeit-fetch
- with-yarn-workspaces
- with-why-did-your-render
- with-video-js
- with-universal-configuration-runtime
- with-typestyle
- with-three-js

If you have a suggestion or change I'd appreciate it
2020-05-20 05:23:16 +00:00
Michael Albertz
99ee63e110
[Examples] Fix with-yarn-workspaces Vercel deploy button (#12867)
Fixes: https://github.com/zeit/next.js/issues/10734
Related: https://github.com/zeit/now/discussions/4320

This fixes the **Deploy your own** button for the with-yarn-workspaces example. Currently the deployment fails with the following error.

```
Module not found: Can't resolve 'bar' in '/zeit/3ad1f9cd/pages'
```

I also added a dynamic api route to the example, because I had problems configuring vercel to redirect to dynamic routes.

This will be the new Vercel-Import-From link: [Deploy](https://vercel.com/import/project?template=https://github.com/Prioe/next.js/tree/fix-with-yarn-workspaces-deploy/examples/with-yarn-workspaces)
2020-05-20 04:39:38 +00:00
taye
53b478ccd7
example(contentful): set up content types with required fields (#12591)
The example app expects all fields of Post and Author entries to be present and fails to build if any are missing. This PR adds a "required" validation to fields of both content types to avoid bulid errors.

CC @stefanjudis
2020-05-20 04:23:28 +00:00
Luis Alvarez D
a1b46817eb
[Examples] Update with-sentry-simple (#13074)
Moved from `getInitialProps` to the new data fetching methods. Updated the readme and simplified the implementation for pages.
2020-05-20 02:57:07 +00:00
Greg Rickaby
58c7265ba0
Update DatoCMS Example (#13008)
👋🏻 This PR updates the Datocms example:

- [x] Next.js 9.4 absolute import and aliases support
- [x] Next.js 9.4 native `.env` support
- [x] Tailwind 1.4 native PurgeCSS support
- [x] Chore: bump other dependencies, like React, Remark, and DateFNS 

I've tested this PR here: 

- 💻 https://github.com/gregrickaby/datocms-next-js-blog-demo-2392
- 👀 https://datocms-next-js-blog-demo-2392.now.sh/
2020-05-19 23:13:35 +00:00
Jimmy Chion
f61a2e7a45
[Example] Unsubscribe Router.on.events (#13102) 2020-05-19 12:37:54 -04:00
Tommy Ljungberg
a44ab5d0c1
fix(examples): align with-absolute-imports with next 9.4 (#13090) 2020-05-19 18:11:33 +02:00
Jaime Leonardo Suncin Cruz
d16fb63c1b
Improve Redux Toolkit example (#12858) 2020-05-19 09:27:30 -04:00
TodorTotev
fd55ef9aaf
Remove redundant code from with-portals-ssr example (#13060)
* removed redundant imports and replaced the fragment with the shorthand syntax

* Brought back the component import

Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-05-19 11:16:24 +02:00
Joe Haddad
dbad9db68c
Update Examples for Fast Refresh (#13068) 2020-05-18 17:44:18 -04:00
Joe Haddad
86160a5190
Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
TodorTotev
7c68d0c7f6
Removed redundant code from the with-portals example (#13059) 2020-05-18 14:17:02 -04:00
Elliot Hesp
5610af012a
Add monaco-editor example (#11232) 2020-05-18 13:21:13 -04:00
Guilherme de Andrade
c334a2751e
chore: use function component on with-typescript example (#12695) 2020-05-18 13:13:01 -04:00
Byron Polley
0b7ebc69fe
docs: add prismic locale note (#12862) 2020-05-18 13:10:32 -04:00
Tom Evans
6802805010
[Examples] Added public folder to with-docker example (#12879) 2020-05-18 13:08:28 -04:00
Lukas Böcker
36ddadae3a
Fix with-emotion examples (#13005) 2020-05-18 13:07:07 -04:00
jmgr2996
dd264f582f
chore: Remove redundant imports in several examples (#13030) 2020-05-18 13:02:23 -04:00
Nikolay
5cdb408ec8
[Examples] Chakra UI - Move CSSReset inside ColorModeProvider (#13044) 2020-05-18 12:03:38 -04:00
jmgr2996
fedc662f25
feat: Remove redundant imports in XState example (#13020) 2020-05-17 17:52:00 -04:00
none23
de516957b2
Remove unused babel-preset-react dep from babel-macros example (#12990) 2020-05-16 17:52:11 -04:00
Willian Justen
18dc1f66c6 Remove isomorphic-unfetch from examples (#12948)
Since 9.4 release, fetch is pollyfilled by default from #12353,
so the import is not needed anymore.
2020-05-15 22:23:55 +02:00
Henrik Wenz
b280c82a5e
[Examples] Fix active-class-name (#12931) 2020-05-15 12:44:46 -04:00
Bruno Crosier
f840e1fe68
Stop tracking changes in .next folder (#12924)
The .next folder doesn't need to be tracked
2020-05-15 10:07:14 -05:00
Evan Bacon
33800de9f8
add Expo example (#12805)
* Created Expo example project

* Update examples/with-expo/README.md

* Updated usage guide

* Update README.md

* Lint fix

Co-authored-by: Luis Alvarez <luis@vercel.com>
2020-05-14 18:33:45 -05:00
Raphael Chaula
5fdf3b8a46
Update package.json (#12865)
Without babel-core, "lingui extract" gives TypeError: Api.call... function is undefined
2020-05-14 21:07:13 +02:00
Dylan Jhaveri
aef282ffac
Add example with-hls-js (#12723)
* npm init next-app

* add example video-player component with HLS.js

* add README for example with HLS.js

* update name in package.json

* Update examples/with-hls-js/.gitignore

Co-authored-by: Luis Alvarez D. <luis@vercel.com>

* Update license to MIT

Co-authored-by: Luis Alvarez D. <luis@vercel.com>

* Update next version to latest

Co-authored-by: Luis Alvarez D. <luis@vercel.com>

* remove unused pages/api

Co-authored-by: Luis Alvarez D. <luis@vercel.com>
2020-05-13 21:47:28 -05:00
Joe Haddad
b41f9baaa4
Fix up CMS examples (#12840) 2020-05-13 14:13:14 -04:00
João Pedro Schmitz
5d201dce9b
docs(ssr-caching): remove link to react-esi example (#12789) 2020-05-13 01:58:15 -04:00
Timothy
9cb75d556d
Add contentful as a related example link to each CMS example (#12796) 2020-05-12 14:15:53 -05:00
Tomas Dabašinskas
c0edf06d8f
sort posts by date in descending order (#12303)
* sort posts by date in descending order

Hi, I'm extending getAllPosts function to sort posts array by date in descending order. 
Any feedback is appreciated

* sort posts by date timestamp in descending order

* Lint fix

Co-authored-by: Luis Alvarez <luis@vercel.com>
2020-05-12 12:40:51 -05:00
dpyzo0o
29b110009a
fix logout in with-iron-session example (#12704) 2020-05-11 08:54:50 -04:00
Luis Alvarez D
f0220e6a9d
[Examples] Update firebase authentication (#12687) 2020-05-10 21:32:20 -04:00
Shu Uesugi
cc139b8d89
More renaming ZEIT → Vercel (#12649) 2020-05-09 17:21:53 +02:00
Luis Alvarez D
5d70b2a06f
[Examples] Update data-fetch example (#12617) 2020-05-08 11:53:47 -04:00
liwenzhi
4a8b896122
[Examples]: With react bootstrap (#12421)
* add new example with-react-bootstrap

* use vanilla react-bootstrap components to implement index page

* clear unnecessary comments

* remove private property in package.json

* Updates

Co-authored-by: Luis Alvarez <luis@vercel.com>
2020-05-07 17:13:59 -05:00
Ty Mick
a7b0e8a786
Fix DatePicker Day.js bug in Ant Design example (#12580)
* Fix DatePicker Day.js bug in Ant Design example

* Lint fix

Co-authored-by: Luis Alvarez <luis@vercel.com>
2020-05-07 16:29:42 -05:00
Juan Silupu Maza
63bfbfff54
Add cross-env package (#12581)
* add notes

* add cross-env package, for stability in different SO

* fix: move cross-env package from Dependencies at devDependicies
2020-05-07 11:16:36 +02:00
Max Schmitt
71a5b5803e
example: added Ant Design Pro Layout less (#12408) 2020-05-06 18:00:48 -05:00
AlexanderVishnevsky
960368eed5
Resolve bug with Prismic Locales (#12132)
* Resolve bug with Prismic Locales

add configuration for not default locale

* Resolve bug with Prismic Locales

Add configuration for Prismic locale.
More information about bug:

* Fixes and removed unrequired changes

Co-authored-by: Luis Alvarez <luis@zeit.co>
2020-05-06 13:30:23 -05:00
Jiachi
1fdadbb18b
fix: hello world missing default exports (#12551) 2020-05-06 11:33:41 +02:00
Matthias Lorthiois
c81cabeae8
Update blog-starter to use Tailwind CSS v1.4's new built-in purge option (#12452) 2020-05-06 11:27:21 +02:00
Amandeep Singh
1aa2e0cfe6
Fixed typo (#12497) 2020-05-05 00:06:55 -04:00
Soichi Takamura
790800305b
[examples/with-typescript-graphql] Add "createResolverContext" hook, etc. (#11681)
* Update deps

* Run "node-check-update -u"
* "graphql" keeps ^14 since other libs expect it
* Install apollo-link and apollo-cache because @apollo/react-common
wants it as peer-deps

* Add graphql-let/schema/loader

* This enables HMR from modifying *.graphqls.

* Add resolver context

* Remove JSDoc, respect TypeScript defs

* ncu -u

* Keep using graphql@^14.6.0 for the other deps

* fix: Migrate to graphql-let@0.10.0

* Removed duplicated deps

* Updated check

Co-authored-by: Luis Alvarez <luis@zeit.co>
2020-05-04 17:09:39 -05:00
Taylor Bryant
5e80999c04
Clean up styles in with-tailwindcss example (#12458) 2020-05-03 19:45:57 -04:00
Vincent Voyer
f38eb70207
docs(examples): with-iron-session update (#12418) 2020-05-02 23:18:23 -04:00
Taylor Bryant
96f8455a03
Add names to components in amp example (#12415) 2020-05-02 15:09:21 -04:00
Taylor Bryant
f13ca3055c
Add names to components in hello-world example (#12416) 2020-05-02 15:08:56 -04:00
Taylor Bryant
a59a15dd78
Add name to component in with-tailwindcss example (#12417) 2020-05-02 15:08:23 -04:00
Marko Djordjevic
a2b9f2484c
Fix 'user undefined' error with ssr profile in auth0 example (#11934) 2020-05-02 01:25:34 -04:00
Joe McCann
2e0f52acba
upgrade from deprecated url.parse() since Node 11 (#11825)
Co-Authored-By: Tim Neutkens <tim@timneutkens.nl>
2020-05-02 01:24:58 -04:00
Jon Espen Kvisler
b516c4ea23
Transpile packages in react-intl example (#11849) 2020-05-02 01:22:25 -04:00
Ronie
a7bd2db963
Example: update netlify-cms to use SSG (#12072) 2020-05-02 01:18:04 -04:00
David Sally
945c1fac9f
Update with-emotion-11 example to use functional _app component (#12183) 2020-05-02 01:15:02 -04:00
Connor Mcgarty-Wood
daa7f821a9
Docs: Add req.body to custom express server example (#12211) 2020-05-02 01:14:04 -04:00
Marcus Koh
6a8aef71fe
Updated with-firebase-authentication to fix errors (#12204) 2020-05-02 01:13:08 -04:00
lncls
ae1857ef33
#12314 add auth to with-sentry-simple example (#12316) 2020-05-02 01:07:31 -04:00
Robin Weser
b5b8cd8642
[example-with-fela] CSS imports compatibility (#12237) 2020-05-02 01:04:42 -04:00
mit123suki
2dcd4e9509
example: antd-4 with built-in css support (#11837) 2020-05-02 00:59:56 -04:00
Hossam Magdy
e19023d672
Update with-firebase-hosting[-and-typescript] examples (#11685) 2020-05-02 00:56:40 -04:00
Stefan Judis
98233b914e
[Examples] Improve Contentful example starter and docs (#12351) 2020-05-02 00:52:39 -04:00
dalibor-123
5808221f0d
gitignore graphql-let generated .d.ts files (#12381) 2020-05-02 00:48:28 -04:00
Christian Alfoni
a6791abf9c
example: new with-stitches (#11924) 2020-05-02 00:30:39 -04:00
Luis Alvarez D
82596124c6
Add cors example and update API routes docs (#12390) 2020-05-02 00:06:23 -04:00
Vincent Voyer
9590a8a977
docs(examples): upgrade next-iron-session to v4 (#12398) 2020-05-02 00:04:03 -04:00
Amandeep Singh
6dc28cff6d
Rectified typo (#12366) 2020-05-01 10:52:07 +02:00
Joe Haddad
fbea795ad9
[Fast Refresh] Redesigned Runtime Error Experience (#12222) 2020-04-30 10:50:25 -04:00
Taylor Bryant
0050432690
Update with-tailwindcss to use Tailwind CSS v1.4.0's new built-in purge option (#12327) 2020-04-30 09:51:37 +02:00
Aemiro Allison
c1aeaa482b
Fix typo (#12224) 2020-04-29 15:08:33 -05:00
Luis Alvarez D
1a7a14e5e2
[Examples] add Contentful example (#12323)
* Added example

* Readme fixes

* Preview mode fix

* Added rich test post content

* Added demo

* Apply suggestions from code review

* Update examples/cms-contentful/README.md

* Apply suggestions from code review

* Apply suggestions from code review

* Now → Vercel

Co-authored-by: Shu Uesugi <shu@chibicode.com>
2020-04-29 13:19:49 -05:00
Tim Neutkens
5d8968f64a
Remove launched experimental options (#12197) 2020-04-25 21:00:41 +02:00
Arthur Petrie
e97cf15d58
[Example] update with-tailwindcss-emotion to tailwind 1.3.3 and emotion 11 + tailwind-ui plugin (#11611)
* [Example] update to tailwind 1.2.0 and emotion 11

* fix lint error

* Used different ways to style components

* update @tailwindcssinjs/macro package
remove clear cache script
update component comments

* update tailwindcss package to 1.3.3

* update dependencies

* update dependencies

* Updated readme, package.json, and removed unrequired imports

Co-authored-by: Luis Alvarez <luis@zeit.co>
2020-04-24 18:27:43 -05:00
Johan Nilsson
f3e6545bf5
Remove unnecessary export to make usage clearer. (#12167)
The method initializeStore is only being used locally by useStore.
By having this exported I initially thought the consumer would have to call this as setup globally and then call useStore as well for each consuming component.

Downloading the sample I saw it's only useStore that is being used by the consuming app and this could be made clear by not exporting initializeStore.
2020-04-24 11:31:03 +02:00
Aleksander
f42055ccb0
Update snapshot in with-jest example (#12157) 2020-04-24 11:21:48 +02:00
Shania
c601c9413d
Added a link to the next.config.js docs for the with-env-next-… (#12153) 2020-04-24 11:20:13 +02:00
Allen Hai
0c6ee2c760
Add userbase example (#12150)
* add userbase example

* update readme and add now.json with build.env

* update deploy button import path for testing

* update readme

* update readme with canary tree path for deploy button

* remove prepopulated test username + password

* Apply lint-fix

* add deployed demo link

* remove merge conflict arrows

* fix lint errors

* run yarn lint-fix

* add .env.example and update readme with config steps

* add dotenv and update next.config.js

Co-authored-by: Matthew Sweeney <mail@msweeneydev.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2020-04-23 19:56:42 -05:00
Sean Li
91adb8661d
Add example with Magic authentication (#11810)
* Add example with Magic and Passport.js

* Tweaked wording on README

* Fixed lint error

* Fixed prettier error

* Update examples/magic/README.md

Removed Download manually section from README

Co-Authored-By: Joe Haddad <timer150@gmail.com>

* Removed dependency on passport and express + cleanup

* Changed ZEIT brand to Vercel

* Updated readme instructions and secrets

* Renamed example

* Changed db comment

Co-authored-by: Joe Haddad <timer150@gmail.com>
Co-authored-by: Luis Alvarez <luis@zeit.co>
2020-04-22 18:15:12 -05:00
Oxicode
7d2ff81207
fix variable (#12114) 2020-04-22 20:32:41 +02:00
Vania Kucher
39d9476992
Avoid bugs with native Date class (#12098) 2020-04-22 11:43:07 +02:00
dzigg
06f379ffad
Fix typo in example (#12094)
Line 4: "...special configuration file `next.js.config` and..."
Is it meant to be `next.config.js`?
2020-04-22 01:19:53 -04:00
Dustin Deus
d28ad8805a
Rosetta i18n example (#11841)
* add rosetta example

* add comment

* add example for ssr

* add debug example, rerender when i18n keys are added

* output active locale, fix interpolation, fix cases for SSR and CSR

* add useful comments

* address pr issues

* update name in readme

* improve wording

* rename folder

* fix prop typo, add redirects

* load specific i18n json file in getStatisProps
Dashboard dont use any ssr technique

* use ext

* improve example

* Updated example

Co-authored-by: Luis Alvarez <luis@zeit.co>
2020-04-21 12:49:18 -05:00
Joe Haddad
3fe4cbc677
Add Experimental React Refresh Example (#12081)
* Add Experimental React Refresh Example

* add basic readme
2020-04-21 12:28:09 -04:00
David Pike
600b78c098
fix postcss.config.js warnings (#12070)
* update postcss.config.js to fix warnings

Return empty array if the condition is not met to avoid a null/undefined PostCSS plugin.

Related PR: https://github.com/zeit/next.js/pull/11366

* style: correct linting error
2020-04-21 14:51:16 +02: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
James Mosier
dc4e5695aa
(examples) Fix link in with-passport example README (#12056)
* Fix incorrect link in with-passport example

Closes #11961

* hardcode link for with-passport README

* fix link

Co-Authored-By: Luis Alvarez D. <luis@zeit.co>

Co-authored-by: Luis Alvarez D. <luis@zeit.co>
2020-04-20 20:28:12 +02:00
退之
5592e64c36
Fix with mobx (#11907)
* fix: with-mobx

* refactor: up link

* refactor: npm run prettier-fix

* refactor: server side render

* Updated store implementation and pages

* Updated readme

Co-authored-by: wangcheng <wangcheng@deepblueai.com>
Co-authored-by: Luis Alvarez <luis@zeit.co>
2020-04-20 13:05:10 -05:00
coktopus
a6beed01eb
bug: error when using transition property in tailwindcss + emo… (#12027) 2020-04-20 11:12:13 +02:00
Rounak Agarwal
2c0ed5e80c
[Examples] Update draft-js to v0.11.5 and add editorKey prop i… (#12011) 2020-04-20 11:05:09 +02:00
Francisco Pizarro
4b3967fa10
examples/with-react-helmet: upgrade react-helmet to v6.0.0 (#12000) 2020-04-18 13:09:10 -05:00
Justin
fe686b30b4
with-iron-session: fix link to next-iron-session (#11974) 2020-04-17 17:18:50 -05:00
Luis Alvarez D
42a328f3e4
Improved steps for examples/cms-prismic (#11935)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2020-04-16 09:15:43 -05:00
Vincent Voyer
90ffdcc33b
docs(auth): add with-iron-session to the alternatives list (#11903)
Following https://github.com/zeit/next.js/pull/11865#issuecomment-613663718
2020-04-15 02:01:40 -04:00
Matt Carlotta
ffa4089b18
Update with-redux-thunk example to include HMR (#11816)
* Update with-redux-thunk example to include HMR

* Update README

* Fix clock component

* Fix example component

* Fix README
2020-04-14 18:36:50 -05:00
Luis Alvarez D
4094dfeff9
Remove with-cookie-auth (#11865) 2020-04-14 11:58:26 +02:00
Tim Neutkens
f0422f2119
Revert "minor change in hello-world/package.json" (#11874)
This reverts commit 287961ed91.
2020-04-14 10:11:15 +02:00
Luis Alvarez D
20f6429643
Replaced express with next-connect (#11747) 2020-04-13 18:11:41 -05:00
Hoang Vo
ee372f472f
feat(example): add CRUD example with next-connect and passport (#11359)
* Add with-next-connect example

* Update README

* Fix code and lint

* Fix typo

* Run prettier

* Include username

* Rename example

* Match with-passport styling

* Add comments in code

* Run prettier

* Rewrite example

* Add some comments

* Update README.md

* keys -> secret

* Updated package.json and readme

* UX changes

* Securely encrypt cookie with @hapi/iron

* Update README

* Abstract db related actions and update README

* security: add note on password hashing

* remove unused dep

* Updated readme

Co-authored-by: Luis Alvarez <luis@zeit.co>
2020-04-13 18:07:54 -05:00
Yuki Takemoto
65335155d1
chore(example): Update styled-components to v5 in with-typescript-styled-components (#11766) 2020-04-13 17:30:17 -05:00
a14m
0ccce7271d
Update sentry example (#11701)
* Fix the with-sentry-simple example configuration code

This fixes the following issues:
- https://github.com/zeit/next.js/issues/8873
- https://github.com/zeit/next.js/issues/11642

* Update the README with the info about uploading to sentry configurations

* Fix the typo in SENTRY_DNS -> SENTRY_DSN
2020-04-13 14:08:56 -04:00