Commit graph

1286 commits

Author SHA1 Message Date
Shu Uesugi
a63ac3e715
CMS TakeShape Example (#11038)
* TakeShape Example

* Fix preview logic

* Update README

* Fix broken link

* Be more clear with the relationship field

* Use latest next.js for cms examples

* Only show enabled items

* Ignore current slug

* Fix queries

* Add takeshape demo

* Added link to blog-starter

Co-authored-by: Luis Alvarez D <luis@zeit.co>
2020-03-19 17:30:37 -05:00
Luis Alvarez D
7d42b07b79
[Example] with-passport (#10529)
* Added basic layout with login page

* Updated styles

* Added form component

* Added signup page

* Added login/signup API endpoints

* Bug fixes

* Set the cookie

* Added logout route

* Added more auth

* Updated signup

* Added profile page

* Added useUser

* Fix link

* Updated redirect path

* Renaming some files

* Added README

* Apply suggestions from Shu

Co-Authored-By: Shu Uesugi <shu@chibicode.com>

* Add useUser to the header

Co-authored-by: Shu Uesugi <shu@chibicode.com>
2020-03-19 11:40:13 -05:00
JJ Kasper
756b365adf
Add CMS example for Sanity (#10907)
* Add start of Sanity CMS example

* Update cover-image

* Clean up example

* Apply suggestions from code review

Co-Authored-By: Shu Uesugi <shu@chibicode.com>

* Make changes from review

* Remove extra style

* Apply suggestions from code review

Co-Authored-By: Shu Uesugi <shu@chibicode.com>

* Make tweaks for preview mode and normalize env naming

* Update viewing preview step

* Delete author.jpg

* Delete image.jpg

* Update README

* Fix environment variable names

* Project ID is needed by lambda

* Improved steps

* Fixed issue with the project URL example

* Clarify line

* Get the preview post correctly

* preview = false

* Get unique posts

* Show preview mode on index page

* typo fix and use next latest

* Added related examples section

Co-authored-by: Shu Uesugi <shu@chibicode.com>
Co-authored-by: Luis Alvarez <luis@zeit.co>
2020-03-18 18:39:37 -05:00
Shaswat Saxena
43c11904d3
Updated with-typescript example to SSG (#11081)
* Update with-typescript example to SSG

* Fixed usage of localhost inside SSG methods

Co-authored-by: Luis Alvarez <luis@zeit.co>
2020-03-18 15:15:04 -05:00
Zhe Zhang
14efae931a
[Examples] fix remark link in blog-starter's README (#11177) 2020-03-18 17:36:04 +01:00
Tim Neutkens
1c170c946a
Remove react-ssr-prepass alias as it's not longer needed (#11170) 2020-03-18 13:47:28 +01:00
Tim Neutkens
ac34a9f960
Clean up examples directory (#11169)
* Remove outdated examples

* Remove outdated example

* Remove outdated example that doesn't show best practices

* Remove outdated example

* Remove outdated example

* Remove outdated example

* Update preact example

* Update using-router to use useRouter

* Remove outdated example

* Remove outdated example

* Remove outdated example

* Remove outdated example

* Remove outdated example

* Remove outdated example

* Combine examples

* Simplify offered examples

* Remove outdated example

* Add link to new example

* Removed outdated example

* Markdown example has been improved

* Remove example that showed bad practices

* Remove outdated example

* Update polyfills example

* Remove outdated example

* Remove outdated example

* Remove outdated example

* Removed outdated example

* Remove outdated example

* Remove outdated example

* Remove outdated example

* Remove outdated example

* Update webassembly example

* Move example
2020-03-18 13:45:31 +01:00
Tim Neutkens
88a6bb36ba
Update blog-starter example (#11071)
* Update blog-starter example

* Updated content

* Updated readme

* Updated readme

* static → assets

* Add bottom margin

* Add to docs

* Add excerpt

* Update docs/advanced-features/preview-mode.md

Co-authored-by: Luis Alvarez <luis@zeit.co>
Co-authored-by: Shu Uesugi <shu@chibicode.com>
2020-03-18 09:43:09 +01:00
Tim Neutkens
7e2d476e44
Update examples to use getStaticProps where possible (#11136)
* Remove micro example

* Remove page that uses getInitialProps

* Update with-docker example

* Update dynamic import example

* Update Fela example

* Update Flow example

* Update framer motion example

* Remove freactal example

* Remove with-higher-order-component

* Remove with-immutable-redux-wrapper as it shows avenues to performance issues

* Remove example that doesn't have usage

* Update with-kea

* Remove example that is not used

* Update next-page-transitions example

* Remove next-routes example as dynamic routes are supported by default

* Add link to documentation

* Update Overmind example

* Update pretty-url-routing example

* Remove update with low usage

* Update with-react-ga example

* Update React Helmet example

* Remove mobile-detect from carousel example

* Remove react-useragent as it shows a bad practice

* Remove react-uwp example as it has low usage

* Remove recompose example as it shows outdated practices

* Remove refnux example as it has low usage

* Remove example that can be created using api routes

* Update with-segment-analytics

* Update socket.io example

* Remove socket.io example as it's shows bad practices

* Update static export example

* Update universal configuration example
2020-03-17 15:07:27 +01:00
Kenta Moriuchi
bfab9907b1
Move public directory for development in examples/with-firebas… (#11085) 2020-03-17 11:30:59 +01:00
Sangwon Lee
22e3b93913
Update with-react-multi-carousel example to use GSSP (#11069) 2020-03-17 11:28:59 +01:00
Carlos Pavanetti
bb3cce2315
Update ssr-caching example with getServerSideProps (#11032)
* Replace getInitialProps by getServerSideProps

* Replace getServerSideProps getStaticProps
2020-03-14 10:14:14 +01:00
Tom Dohnal
e6b4cdd665
update form handler example (#11059) 2020-03-13 16:57:12 -05:00
Jazib Jafri
31a6410bb2
Update with-loading example to SSG (#11050)
* Update getInitialProps to getStaticProps

* Updated example

Co-authored-by: Luis Alvarez <luis@zeit.co>
2020-03-13 16:48:32 -05:00
Shu Uesugi
b596c2167d
Upgrade next.js version on datocms example (#11039)
* Remove unused files

* Update next

Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-03-13 15:03:29 -04:00
matamatanot
13bfb9a73d
Update custom-server-express example with getServerSideProps (#11035)
* use getServerSideProps

* run Prettier

* update react

* use getStaticProps

* delete query

* Remove data fetching requirements

Co-authored-by: “kosuke_matano” <kosuke_matano@cyberagent.co.jp>
Co-authored-by: Luis Alvarez <luis@zeit.co>
2020-03-13 13:48:07 -05:00
Luis Alvarez D
7bf7c232ea
Use getServerSideProps (#11057) 2020-03-13 11:54:32 -05:00
akhila-ariyachandra
f78c36f686
Updated analyze-bundles example (#11031)
* Updated analyze-bundles example

* Updated react and react-dom (for hooks)
2020-03-13 11:00:10 +01:00
Patrick Dahms
f75c37fcac
Update custom-server-fastify example to not use internal fn (#11040) 2020-03-13 10:53:57 +01:00
Sarbast Mohammed
6997b0236b
Update next-sass example to use built-in sass support (#11015)
* update next-sass example to use built-in sass support

* Update README.md

Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-03-12 23:42:21 -04:00
Rui Saraiva
9d9496e4a9
Update with-zeit-fetch example to use SSG (#11026) 2020-03-12 23:32:50 -04:00
JIMMY ムン (MOON)
b092ff72b9
Update amp-first example to use GSSP (#11028) 2020-03-12 23:30:47 -04:00
Josiah Wiebe
fe4da73469
feat: update api-routes example to SSG (#11019)
* feat: update api-routes example to SSG

* Update examples/api-routes/components/Person.js

Co-authored-by: Luis Alvarez D <luis@zeit.co>
2020-03-12 17:55:24 -05:00
Alejandro
0f0013b9e4
Update data-fetch example to SSG (#11017)
* Update to SSG

* Change to getServerSideProps

* Fix lint

* Update
2020-03-12 17:21:18 -05:00
Joe Haddad
39ed664966
Fix Lint 2020-03-12 09:09:12 -04:00
Brad Larson
3b5029fb92
cms-datocms SerializableError fixes (#10986) 2020-03-12 13:07:57 +01:00
Petr Messner
76a08c9671
Fix examples with relay-compiler (#10976)
* Example with-react-relay-network-modern: update dependencies

* Example with-react-relay-network-modern: move relay __generated__ out of pages dir

* Example with-react-relay-network-modern: fix some errors

- Without checking if props.allBlogPosts exists it fails sometimes on
  "TypeError: Cannot read property 'edges' of undefined"

- I have no idea how it could work before with Component.query().params.name,
  but maybe some dependent library API has changed

* Example with-relay-modern-server-express: update dependencies

* Example with-relay-modern-server-express: move relay __generated__ out of pages dir

Fixes Error: Build optimization failed: found page without a React Component as default export in
pages/__generated__/pages_indexQuery.graphql

* Example with-relay-modern: update dependencies

* Example with-react-relay-network-modern: fix prettier errors
2020-03-11 20:35:17 +01:00
Shu Uesugi
745494a9a3
Add demo URL for the DatoCMS example (#10901) 2020-03-09 17:47:21 +01:00
Shu Uesugi
bf0ea49b02
DatoCMS Example (#10891)
* Copy cms-datocms

* Update package.json

* Desktop design

* Tablet support

* Mobile styles

* Update titles

* Add article page

* Minor tweaks

* Fix height issue

* Improve text colors

* Extract Alert and Footer components

* Extract avatar

* Add Date

* Extract container

* Fix capitalization

* Make it work with no backend

* Add paragraph styles

* Extract PostPreview

* Extract h2

* Extract more stories

* Refactor into more components

* Update tags

* Add missing key

* Add custom document for lang="" support

* Add dotenv

* Load data for the index page

* Limit posts

* Show post page

* Add markdown processing

* Forgot margin

* Add links

* Remove files and add fallback

* Add og:image

* Add favicon

* Add aria-label

* Fix prerender

* Learn more → read documentation

* Fix links and footer

* Desaturate using imgix

* Add preview secret

* Add preview support

* Fix preview code

* Exit preview mode

* Extract getAllPostsWithSlug

* Extract getAllPostsForHome

* Extract getPreviewPostBySlug

* Extract getPostAndMorePosts

* Extract constants

* Extract markdownToHtml

* Fix markdown styles

* Fix imgix for author

* Add README

* Add links to docs
2020-03-09 11:51:08 +01:00
Tim Neutkens
744b50d5d4
add example for why-did-you-render (#10662)
* add example for why-did-you-render

* Load whyDidYouRender from _app.js

To avoid custom webpack main entry modifications
as this can cause [hydration errors](https://github.com/zeit/next.js/pull/10662#pullrequestreview-365188433)
2020-03-05 23:43:58 +01:00
Tim Neutkens
6679694a1e
Update Custom Server README's (#10843)
* update custom server readmes

* remove deploy buttons
2020-03-05 16:30:48 +01:00
Max Thirouin
644a1ef187
examples: react-native-web: fix config to prefer .web.* exts (#10774)
* [examples/with-react-native-web] fix config to get .web.* extensions resolved before other

Simple issue if you have `Compo.js` & `Compo.web.js` (eg 1st for iOS/android & second for web): with current config, .web are resolved after.
My change change this situation so web extensions are resolved before the others.

I removed the `defaultLoaders` since it was not used. Tell me if that was intentional so I can add it back.

* lint-fix

Co-authored-by: Joe Haddad <timer150@gmail.com>
2020-03-01 12:32:48 -05:00
JJ Kasper
c9d9f1131c
Remove unstable_ prefix from new methods (#10723)
* Rename getServerProps to getServerSideProps

* Remove unstable_ prefix from new methods

* Add error when legacy methods are detected

* Add legacy methods for babel transform

* Add unstable_getServerSideProps also

* Apply suggestions from code review

Co-Authored-By: Joe Haddad <joe.haddad@zeit.co>

* Update types import

Co-authored-by: Joe Haddad <timer150@gmail.com>
2020-02-27 11:57:39 -06:00
JJ Kasper
2789e7e0c2
Rename getServerProps to getServerSideProps (#10722) 2020-02-27 11:04:30 -06:00
Henrik Wenz
a81913f1ba
Fix apollo example (#10696) 2020-02-25 16:16:34 -05:00
Soichi Takamura
ccb42b0ed5
Update example "with-typescript-graphql" (#10637)
* add peerDeps of graphql-let

* ncu -u && typesync

* Use resolver types for resolver implementation
2020-02-25 01:44:09 -05:00
Shu Uesugi
c57cdbb31d
Rename zeit.co/new → zeit.co/import (#10674)
* Replace zeit.co/new → zeit.co/import

* Update deployment.md
2020-02-24 19:08:34 -05:00
Evgeniy Kumachev
18ecaa9d6b
Update with-mobx-keystone-typescript example (#10638) 2020-02-24 09:33:01 -05:00
Rafael Almeida
ee7ea03a59
Remove deprecated static folder (#10632) 2020-02-21 19:09:23 +01:00
Adith Widya Pradipta
fb7298236d
remove next/link (#10625) 2020-02-21 11:00:02 +01:00
Vincent Voyer
f0c823000b
upgrade next-transpile-modules to latest everywhere (#10607)
Following #10492 and comment from @timneutkens I went ahead and updated all
examples relying on next-transpile-modules.
2020-02-20 12:43:55 +01:00
Quinn Turner
1c64c1e93c
fix: Improve grammar of apollo.js comments (#10601) 2020-02-19 14:17:14 -05:00
Fabian Mastenbroek
72a461f913
Do not cache 404 SSR responses (#10596)
This change updates the _ssr-caching_ to not cache the response when a
404 status code has been returned.
2020-02-19 10:59:37 -05:00
Gordey
5e23e35456
Add missin create permission for faunadb example (#10575) 2020-02-18 10:24:57 -05:00
Thor
d5222f8521
Add global CSS styles to example/with-stripe-typescript (#10520)
* Update stripe-node.

* Update casting.

* Add global CSS styles 💅

* Remove emojies from README.

* Add twitter meta.

* Add demo gifs to README.

* Solid card icon.

* lint fix

Co-authored-by: Luis Alvarez D. <luis@zeit.co>
2020-02-13 13:08:18 -05:00
Henrik Wenz
1a50d99fbd
Update withApollo example (#10451)
* Make withApollo work with _app.js components

* Support wrapping functional _App

* Add apolloClient to NextPageContext & NextPageContext

* Propertly call App.getInitialProps if used in NextAppContext

* Add Automatic Static Optimization warning

* Update deps

* Reduce API surface

* Move back to singleton client

* Improve documentation

* Remove Head.rewind()
We can get rid of .rewind by now as the latest next/head no longer uses legacy context.

* Add extra docs

* Reuse apolloState coming from previous hocs

Co-authored-by: Joe Haddad <timer150@gmail.com>
2020-02-13 00:26:22 -05:00
Joe Haddad
3e7cfd1f9f
Remove with-data-prefetch Example (#10514) 2020-02-12 23:11:27 -05:00
Shu Uesugi
5f041447bc
Remove Now CLI reference from examples (#10501)
* Find/Replace "Deploy it to the cloud..."

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

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

* Convert remaining ones

* Storybook deployment

* Update with-stripe-typescript

* Update contributing.md

* Remove `now`

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

Co-Authored-By: Luis Alvarez D. <luis@zeit.co>
2020-02-12 17:14:57 -05:00
Vincent Voyer
189fc985a7
Upgrade next-transpile-modules in workspace examples (#10492)
The latest major release of next-transpile-module (v3) changed the way the
module is used, see: https://github.com/martpie/next-transpile-modules/releases/tag/3.0.0
2020-02-11 22:45:36 +01:00
Luis Alvarez D
fe5c9072df
Update README.md (#10487) 2020-02-10 22:49:54 -05:00