Commit graph

1661 commits

Author SHA1 Message Date
Stephen Cefali
59924967f1
remove broken server example (#15653)
This removes the server 4 example which breaks all server code since the error will happen when the file is sourced.
2020-07-29 23:58:11 +00:00
Luis Alvarez D
63ea2d8297
Add CSS Modules examples to docs (#15601)
Fixes https://github.com/vercel/next.js/issues/15595

- Updated the tailwindcss and tailwindcss-emotion examples to the latest version of tailwindcss
- Added a new `with-styled-jsx` example
- Updated the `basic-css` example to use CSS Modules instead of styled-jsx
- Added the examples to the documentation page for built-in css support
2020-07-29 14:43:48 +00:00
laiso
2c9c07f96d
Update Electron, Typescript example (#15524)
It seems like the error occurs with `next export` when building the current example.

```
$ cd examples/with-electron-typescript
$ yarn && yarn build

Error occurred prerendering page "/detail". Read more: https://err.sh/next.js/prerender-error
Error: Error for page /detail: pages with `getServerSideProps` can not be exported. See more info here: https://err.sh/next.js/gssp-export
Error: Export encountered errors on following paths:
        /detail
    at exportApp (/Users/kstg/src/github.com/zeit/next.js/examples/with-electron-typescript/node_modules/next/dist/export/index.js:22:1166)
error Command failed with exit code 1.   
```

I changed routes to statically resolve pages generating from `pages/detail.tsx` and added `getStaticPaths` and `getStaticProps`. so then it will export as follows

```
yarn run v1.22.4
$ next build renderer && next export renderer
Creating an optimized production build...

Compiled successfully.

Automatically optimizing pages...

Page                            Size     First Load JS
┌ ○ /                           336 B          62.6 kB
├ ○ /404                        2.54 kB        61.6 kB
├ ○ /about                      338 B          62.6 kB
├ ● /detail/[id]                440 B          62.7 kB
├   ├ /detail/101
├   ├ /detail/102
├   ├ /detail/103
├   └ /detail/104
└ ● /initial-props              530 B          62.8 kB
+ First Load JS shared by all   59.1 kB
  ├ static/pages/_app.js        983 B
  ├ chunks/commons.9facbe.js    10.9 kB
  ├ chunks/framework.b76773.js  40.3 kB
  ├ runtime/main.800476.js      6.22 kB
  └ runtime/webpack.c21266.js   746 B

λ  (Server)  server-side renders at runtime (uses getInitialProps or getServerSideProps)
○  (Static)  automatically rendered as static HTML (uses no initial props)
●  (SSG)     automatically generated as static HTML + JSON (uses getStaticProps)

> using build directory: /Users/kstg/src/github.com/zeit/next.js/examples/with-electron-typescript/renderer/.next
  copying "static build" directory
> No "exportPathMap" found in "next.config.js". Generating map from "./pages"
  launching 7 workers
Exporting (0/4)
Exporting (1/4)
Exporting (2/4)
Exporting (3/4)
Exporting (4/4)

Export successful
Done in 11.47s.
```
2020-07-28 23:00:56 +00:00
Joe Haddad
5b4274a590
De-experimentalize redirects for rosetta example (#15554)
Fixes #15552
2020-07-28 08:36:34 +00:00
Joe Haddad
e73faa187b
Update revalidate examples for 9.5 (#15551) 2020-07-28 01:25:50 -04:00
Omkar Yadav
bf9b96bd81
Update Apollo example for 9.5 (#15546) 2020-07-28 01:16:08 -04:00
ywppp
fc942865bf
[update] 'yo' to 'you' (#15545)
that's really all there is - it just bugged me.
2020-07-28 04:00:22 +00:00
Tim Neutkens
a3eec3bf03
Update custom webpack config docs to mention existing features (#15517) 2020-07-27 11:46:17 +02:00
David Stotijn
ebe4bb1ee4
Upgrade Apollo Client to 3.0 in examples/api-routes-apollo-server-and-client-auth (#15272) 2020-07-25 16:16:20 -05:00
Karl Horky
c983667654
Link with-polyfills example to updated polyfill docs (#13943)
* Link to updated polyfill docs

Ref: https://github.com/vercel/next.js/pull/13766

* Update examples/with-polyfills/README.md

Co-authored-by: Joe Haddad <timer150@gmail.com>
2020-07-24 23:28:18 -04:00
Robin Tom
1a34b237b6
Example for Rewrites (Custom routes) (#15403)
This PR adds example for #15073  
> - [ ] `rewrites` For [docs/api-reference/next.config.js/rewrites.md](https://github.com/vercel/next.js/blob/canary/docs/api-reference/next.config.js/rewrites.md)
2020-07-25 02:38:58 +00:00
Arsalan Khattak
cc541fb252
Add Sitemap Example (#15047)
* Add with-sitemap Example

* Update README

* Update examples/with-sitemap/scripts/generate-sitemap.js

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

* Update examples/with-sitemap/package.json

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

* Update examples/with-sitemap/public/sitemap.xml

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

* Update README

* Add .env Info to README

* Update examples/with-sitemap/README.md

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

* Update examples/with-sitemap/README.md

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

* Update examples/with-sitemap/README.md

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

* Update examples/with-sitemap/README.md

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

Co-authored-by: Luis Alvarez D. <luis@vercel.com>
2020-07-24 11:35:39 -05:00
Colleen O'Rourke
23ebe3e4aa
Update Sentry example for use with Sentry/Vercel integration (#15349)
* Update Sentry example for use with Sentry/Vercel integration

* update linting

* Update link in readme

* Update readme, add comment

* Add step about commit SHA

* Updated readme

* Use if

* dont call sentry webpack plugin w/o a commit sha present

* Update examples/with-sentry/README.md

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

* update release value

* prettier readme

* Updated note

Co-authored-by: Luis Alvarez <luis@vercel.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-07-23 16:32:44 -05:00
Ado Kukic
0152dac87f
MongoDB Example (#15029)
* MongoDB Example

* Apply suggestions from code review

* Add changes based on feedback.

* clean up code with more descriptive props

* Use MongoDB in ServerSideProps instead of separate API route

* Update examples/with-mongodb/README.md

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

* Update examples/with-mongodb/README.md

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

* Update examples/with-mongodb/README.md

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

* Update examples/with-mongodb/README.md

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

* Update examples/with-mongodb/README.md

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

* Update examples/with-mongodb/README.md

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

* Update examples/with-mongodb/README.md

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

Co-authored-by: Luis Alvarez D <luis@vercel.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-07-22 20:03:18 -05:00
Bruno Bernardino
ef637b38cb
Fixes Hapi custom server example (#15292) 2020-07-21 13:27:39 -04:00
Tony Spiro
0eff1be77a
EDITED: Cosmic demo updates (#15308)
Co-authored-by: Luis Alvarez D <luis@vercel.com>
2020-07-21 15:55:35 +02:00
Nyasha (Nash) Nziramasanga
b5ca544dcc
Updated typo (#15357) 2020-07-21 13:53:33 +00:00
Joe Haddad
5cd5a0e62d
Update api-routes-graphql README Link (#15350) 2020-07-20 21:11:04 -04:00
Obed Marquez Parlapiano
5a00d62242
Correct order of packages in Sentry example explanation (#15334) 2020-07-20 14:46:25 -04:00
Darsh Patel
8f888c9f90
Update react-md url for with-react-md (#15325)
Low hanging fruit 🍎 
Resolves: #15321

`https://react-md.mlaursen.com/` -> `https://react-md.dev/`
2020-07-20 13:36:23 +00:00
Joe Haddad
b8bd3c3309
Add missing gitignore files 2020-07-19 02:02:40 -04:00
Necmettin Karakaya
c2f38f2af0
[Fix] common misspelling errors (#15288)
For reference: https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines
2020-07-19 04:38:20 +00:00
Ayush
eb6589ab16
Updated import filename to the correct one (#15298) 2020-07-19 04:20:58 +00:00
João Pedro Schmitz
25488f4a03
chore(examples): update prismic-javascript to 3.0.1 (#15263)
This PR updates Prismic libraries to their latest version. 

Since the `previewSession` method was deprecated on version 3.0.1 we need to use `getPreviewResolver`. 

[Docs for in-Website Preview in Javascript
](https://prismic.io/docs/javascript/beyond-the-api/in-website-preview#17_0-processing-the-preview-token-with-getpreviewresolver-method)

ps: I have tested it and it works correctly.
2020-07-18 16:43:02 +00:00
Luis Alvarez D
a866937b47
[Examples] Remove with-universal-configuration-runtime (#15268) 2020-07-17 17:09:12 -04:00
David Stotijn
48621b3c7e
Update to 3.0 in api-routes-apollo-server-and-client example (#15270) 2020-07-17 16:25:41 -04:00
kevin sproles
5e9f3102b8
Update MST typescript example to use hooks (#15237)
1. Switched from class components to functional components with hooks (https://reactjs.org/docs/hooks-effect.html)
2. Removed inject pattern (which is obsolete) in favor of hooks (https://mobx-react.js.org/recipes-migration)
3. Switched to mobx-react-lite
2020-07-17 18:42:36 +00:00
Luis Alvarez D
a475480745
[Examples] Remove broken demo from with-graphql-faunadb (#15267)
Fixes https://github.com/vercel/next.js/issues/15219

This is better than replacing the demo as having a demo could allow users to post any kind of comments that we can't control.
2020-07-17 16:44:32 +00:00
Sarbast Mohammed
279da6317c
Update with-universal-configuration-build-time example (#15228)
Co-authored-by: Luis Alvarez <luis@vercel.com>
2020-07-17 11:24:23 +02:00
Balint Lendvai
f3f4ca3ef5
Update examples/with-carbon-components (#15190)
The example used an outdated version of carbon components v9.

The latest got a huge facelift, new components and a lot of optimizations.
I updated the example with carbon-components v10.
2020-07-17 01:17:58 +00:00
Luis Alvarez D
14eb907c60
[Examples] Improve with-sentry readme (#15205)
The current readme has wrong instructions and it's not clear enough about how to get the app running, also added deploy to Vercel buttons.
2020-07-17 00:58:43 +00:00
anotherjsguy
5d2e960c6c
(chore) Add with-filbert as example (#15161)
This PR adds an example for [filbert-js](https://filbert-js.vercel.app/docs/introduction) 🖌️
I have locally run the example & it's working as expected.
2020-07-16 23:05:04 +00:00
Tanmay Laud
f00ad581a1
Added .gitignore to examples that are deployed to vercel (#15127)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-07-16 10:52:23 -04:00
Nikolay Stoynov
58aa576bc1
Update README.md (#15198)
Continuation of #15177
2020-07-15 15:03:19 -05:00
Ruslan Dzyubanov
893e57d29e
Update examples/with-apollo (#15178)
apollo-client 2.6.8 -> 3.0.0
2020-07-15 18:23:22 +00:00
Jacky Efendi
fc082b923e
Mark preact as externals for server bundle (#15110)
Co-authored-by: Jason Miller <developit@users.noreply.github.com>
2020-07-15 11:55:43 -04:00
Midnight
987d29a5b4
fixed prettier --write args in package.json (#15187)
prettier --write **/*.{js,ts,tsx} does not work as intended, it never does traverse all files with js,ts,tsx extension. For it to work as intended, extension args should be wrapped in quotes like this "**/*.{js,ts,tsx}"
2020-07-15 14:39:27 +00:00
Nikolay Stoynov
283a0d9a90
Fix with-expo-typescript install command (#15177)
It was using the non-typescript version
2020-07-15 14:20:32 +00:00
Lukas Polak
b088881a5d
update/with-react-jss (#15156)
Use hooks with jss
2020-07-14 13:26:30 +00:00
Jesse Jafa
cb96da13a0
Removed React import from pages/index.js (#15144)
This should close https://github.com/vercel/next.js/issues/12964 but I'm leaving it up to one of the Tims (or if there are other maintainers) to close the issue as they see fit.
2020-07-14 04:59:24 +00:00
abhik-b
583d1a0a02
Updated useUser.js (#14974)
UPDATE I ADDED:
setUser() 
AFTER REMOVING cookie IN return STATEMENT OF logout ARROW FUNCTION

There might be some cases where you do not want to redirect users after logout rather let them remain in that same page BUT let them know they have logged out by some UI changes .

For that cases you might need the 'user' hook to update when users logs out .

CURRENTLY the 'user' hook DOES NOT UPDATE AUTOMATICALLY when the user logs out . 
PAGE REFRESH NEEDED to update that.

So i propose that we might add setUser() to update user so that  user never returns true until user is set some value again
2020-07-13 23:43:21 +00:00
Anthony Morris
5460abf2d4
[Examples] Add .next to .gitignore (#15088)
The TypeScript blog starter didn't have `.next` in the `.gitignore` file.
2020-07-12 20:01:59 +00:00
Jens Meindertsma
164896503c
Update dependencies for with-iron-session example (#15065)
Co-authored-by: Joe Haddad <timer150@gmail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-07-12 21:24:52 +02:00
Cristian Bote
f3f9950b3c
(chore) Add with-goober as an example (#15070)
* (chore) Add with-goober as an example

* (chore) Added better documentation

* Updated package json

Co-authored-by: Luis Alvarez <luis@vercel.com>
2020-07-10 19:39:35 -05:00
Steph Query
b92ef63314
Update README.md in Emotion starter example (#15035)
Sorry if I'm mixed up here. Was trying to install this and realized the folder is just `/with-emotion`. Guessing this was merged to overwrite the pre-v10 example project.
2020-07-10 18:11:14 +00:00
Ricky Abell
a1f7186658
Fix download instructions in with-next-auth example (#15028)
Download instructions in examples/with-next-auth/README.md currently fail because they refer to next-auth instead of with-next-auth.
2020-07-09 21:23:24 +00:00
JP Lew
f53ee47b73
[cms-wordpress] Nest one-to-one relationships (#15007)
There is a bug in the cms-wordpress example due to a Wordpress plugin dependency. After running `npm install`, then either `npm run dev` or `npm run build`, the following errors appear in the console:

```shell
> cms-wordpress@1.0.0 dev /Users/jplew/Sites/projects/next.js/examples/cms-wordpress
> next

ready - started server on http://localhost:3000
info  - Loaded env from /Users/jplew/Sites/projects/next.js/examples/cms-wordpress/.env.local
event - compiled successfully
event - build page: /
wait  - compiling...
event - build page: /next/dist/pages/_error
event - compiled successfully
[
  {
    message: 'Cannot query field "name" on type "NodeWithAuthorToUserConnectionEdge". Did you mean "node"?',
    extensions: { category: 'graphql' },
    locations: [ [Object] ]
  },
  {
    message: 'Cannot query field "firstName" on type "NodeWithAuthorToUserConnectionEdge".',
    extensions: { category: 'graphql' },
    locations: [ [Object] ]
  },
  {
    message: 'Cannot query field "lastName" on type "NodeWithAuthorToUserConnectionEdge".',
    extensions: { category: 'graphql' },
    locations: [ [Object] ]
  },
  {
    message: 'Cannot query field "avatar" on type "NodeWithAuthorToUserConnectionEdge".',
    extensions: { category: 'graphql' },
    locations: [ [Object] ]
  }
]
Error: Failed to fetch API
    at fetchAPI (webpack-internal:///./lib/api.js:31:11)
```

The reason for this is `wp-graphql` released version v0.10.0 ten days ago which introduced a number of breaking changes (https://github.com/wp-graphql/wp-graphql/releases/tag/v0.10.0). Specifically, this is the change that breaks the current example:

> - One to One relationships are now nested. For example post.author and post.featuredImage now return an edge/node instead of the node directly.

More info about this change can be found here: https://github.com/wp-graphql/wp-graphql/issues/347#issuecomment-639071772

After my changes, `npm run dev` and `npm run build` succeed without errors.
2020-07-09 10:03:13 +00:00
Luis Alvarez D
731cfa46f9
[cms-sanity] Expose the project id to the browser (#14941)
Fixes #14792
Closes #14814

The project id is currently used by Sanity's image builder, which is used in a React component.

@maybac It was faster for me to create a new PR but the credit goes to you, thank you!.
2020-07-08 15:01:20 +00:00
Darsh Patel
1cd6bb5b92
Fix: Destructuring error in the cms-contenful example (#14970) 2020-07-08 13:40:19 +02:00
Christian Alfoni
913d23bf8d
with-stitches-styled: Update package.json (#14958) 2020-07-08 09:46:04 +00:00