Commit graph

1084 commits

Author SHA1 Message Date
Joe Haddad
8e3c5c2be0
Improve TypeScript package install experience (#7548)
This change will prompt the user about missing packages using the same DX instead of two separate code paths.
2019-06-10 10:53:35 -04:00
Allen
3d3855093a Fix sentence in with-context-api example (#7542) 2019-06-09 21:46:03 -07:00
JJ Kasper
fa45fa0a60
Add export const config support and make withAmp a no-op (#7525)
* Add export const config support and make withAmp a no-op

* Use babel plugin for PageConfig

* Fix serverless-loader exports

* Add backwards compatibility for withAmp
2019-06-09 17:16:14 -07:00
Kévin Dunglas
3f8dd6b665 with-cookie-auth: don't rely on the Host header (#7435)
* with-cookie-auth: don't rely on the Host header
2019-06-07 13:18:41 -05:00
Luc
3b5f18495b Replace recursive-copy with own implementation (#7263)
* replace recursive-copy with own implementation

* update yarn.lock

* do not filter out not directories

* do not fail if folder already exists

* replace `\` by `/` when sending pathes to filter

* use fs-extra only in tests

* investigate and test recursive-copy npm module

* improve test by creating fixtures programmatically

* remove recursive-copy npm module test

* add recursive-copy to bench

* add bench:recursive-copy script

* fix Sema import in recursive-copy.ts

* small improvements
2019-06-06 12:33:11 +02:00
Teal Hobson-Lowther
2153789358 fix create command - react-relay-network-modern (#7502)
looks like the readme still contained the old react-relay-modern example creation commands 🤷‍♂
2019-06-05 13:11:46 +02:00
JJ Kasper
725f8c2b64 Update ant design examples (#7490)
* Update with-ant-design example to not
need require.extensions hack

* Update other ant-design examples to not
use require.extensions hack
2019-06-04 11:13:10 +02:00
Joe Haddad
b3170d2648
Format missed files (#7464)
* Format missed files

* Remove unnecessary rule

* Fix type error
2019-05-29 18:19:32 -07:00
Tim Neutkens
3e51ddb8af
Move syntax formatting to prettier (#7454)
* Run prettier over packages/**/*.js

* Run prettier over packages/**/*.ts

* Run prettier over examples

* Remove tslint

* Run prettier over examples

* Run prettier over all markdown files

* Run prettier over json files
2019-05-29 13:57:26 +02:00
Matthew Webb
9ccbb1f5bf Correctly pass props down in with-lingui example HOC (#7445)
* correctly pass props down in Lingui example HOC

The WithLang HOC provided as part of the with-lingui example does not pass props down to the wrapped component.
This means that the result of getInitialProps is not passed to the page component.
This commit passes all props which aren't specific to the HOC implementation down to the wrapped component.

* remove semicolon to satisfy lint rules
2019-05-29 10:43:47 +02:00
Joe Haddad
c7276bcbef
Run lint-fix 2019-05-28 16:06:13 -07:00
Matthew Sweeney
0cd2732c7f
Remove deploy to now button from all examples (#7101) 2019-05-27 12:22:05 -07:00
msheakoski
2c7be96daa Update Tailwind CSS to v1.0 (#7421) 2019-05-27 13:22:26 +02:00
JJ Kasper
77b23264bb Opt out of cache header if _app has custom getInitialProps (#7409)
* Opt out of cache header if _app has custom
getInitialProps to match autoExport behavior

* Fix wrong component

* Add test for cache header
2019-05-23 20:24:02 -07:00
Nathan Sculli
43dcb594c2 New Example: with-reasonml-todo(#7346) 2019-05-23 16:48:13 -05:00
Nathan Sculli
5c678537d6 [with-reasonml] Show both internal and shared state managment. (#7312)
* Show both internal and shared state managment in example.
* Add a global state custom hook.
2019-05-23 16:46:42 -05:00
James Russo
ae8363c33e Create with-redux-persist example (#7375) 2019-05-23 15:13:48 -05:00
Lukáš Huvar
bf294ee494
Types description (#7217)
* App, Document, Page, Error types description

* Router description

* Added head changed router

* Additions

* Fix examples

* Push and replace details

* Update packages/next-server/lib/head.tsx

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

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

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

* Update packages/next/types/index.d.ts

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

* Update packages/next/pages/_document.tsx

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

* Update packages/next/pages/_document.tsx

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

* Update packages/next/pages/_app.tsx

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

* Update packages/next/pages/_document.tsx

Co-Authored-By: Luis Fernando Alvarez D. <luis@zeit.co>
2019-05-23 21:31:22 +02:00
Resi Respati
ed0e17503e [custom-server-typescript] fixed custom server build issues (#7385) 2019-05-23 14:08:03 -05:00
Joe Haddad
f9f80dffe5
Upgrade dependencies (#7412)
* ⬆️ Upgrade workspace dependencies

* Run new prettier against examples

* Upgrade some next-server packages

* Upgrade Next.js dependencies

* Upgrade webpack deps

* Upgrade async sema

* Fix compilation

* Revert broken plugin
2019-05-23 00:52:36 -07:00
Resi Respati
28b020538a [with-typescript] Remove obsolete TypeScript plugin and updated readme (#7368)
* [with-typescript] Remove obsolete TypeScript plugin and update readme
2019-05-21 12:30:17 -05:00
Steven Yung
bdf8da6a23 Remove outdated "extras" section in with-tailwindcss example README (#7379) 2019-05-18 21:07:39 +02:00
Lee Robinson
84f8addf7c Add with-sentry-simple example. (#7360) 2019-05-16 23:37:15 -05:00
Mike Rispoli
69ef5d43d6 [custom-server-typescript] remove outdir line from tsconfig.server.json (#7362) 2019-05-16 12:28:53 -05:00
John Elijah Spraul
3bdcdd1b90 [with-loading] changed non-existent-page link to <a> tag (#7350) 2019-05-15 21:56:40 -05:00
Resi Respati
a275ad0922 Updated typescript examples (#7337)
* Updated with-typescript example
2019-05-15 21:04:08 -05:00
Lukáš Huvar
d7152f6ae4 Update typescript example to reflects out of box usage (#7235) 2019-05-14 13:31:46 -05:00
Vojtech Miksu
693ba44ae8 Update with-styletron example, add debug mode and useStyletron (#7290) 2019-05-14 12:46:39 -05:00
Jayden Seric
0770470b40 Update the with-graphql-react example. (#7317)
- Update dependencies, especially graphql-react.
- Use the graphql-react v8.2.0 API.
- Use a /* GraphQL */ comment template string tag so text editors can syntax highlight, lint and format the GraphQL query.
2019-05-13 09:40:13 -05:00
Natalie Marleny
0846ed2df7 fix:7271 with-rematch - make sever rendered user list persist (#7308)
* Simplify with-rematch example by removing unnecessary code

Functionality has remained the same.

* Use correct store initialization (from with-redux)

Previous implementation didn't initialize the correctly. Since the `with-redux` example implements this correctly, this solution has been copied over almost verbatim.
2019-05-12 11:13:02 +02:00
AnsonT
8b6627ab87 Demonstrate how to use kea actions in getInitialProps for server side rendering with state transferred to client-side (#7298) 2019-05-11 14:09:58 -05:00
Natalie Marleny
9f09299548 fix:5049 Make Count in with-reasonml persist in runtime (#7302)
This replicates the functionality of the shared-modules example with ReasonML.
2019-05-11 00:46:34 +02:00
Khoi Le
3641f79a0f Removed unusable React importing in _document.tsx and added esModuleInterop:true in tsconfig.json (#7232) 2019-05-08 11:51:05 -05:00
Sam Washburn
70aa2b5821 Merged with-jest and with-flow examples into a new with-jest-flow example. (#7224)
* Merged with-jest and with-flow examples into with-jest-flow.

* Removed semicolons linter was complaining about.
2019-05-08 14:41:34 +02:00
大钊
1c20a9bfdd Add example with babel-plugin-react-css-modules (#7219) 2019-05-06 20:05:42 -05:00
Prithvi Raju M
5782651e92 Fix FOUC issue on with-fela example (#7229) 2019-05-06 19:57:34 -05:00
nabiltntn
4f49f0844f With apollo auth proxy (#7165)
* Added optional fetch agent to with-apollo-auth
2019-05-06 16:46:44 -05:00
Luis Fernando Alvarez D
3a5c1ebe04 Add docs to public (#7239)
* New example: public-file-serving

* Updated sitemap-and-robots examples
2019-05-06 15:42:54 +02:00
Anthony Mittaz
7f471a4463 Tweak ReasonML example (#7254)
* Lock bs-platform to 5.0.3 (avoiding issues with reason language server)

https://github.com/jaredly/reason-language-server/issues/275

* Reformat code

* Ask bucklescript to use es6 instead of commonjs

* Rework getInitialProps (can now use a promise)

* Ignore .bsb.lock
2019-05-05 13:02:27 +02:00
Keanu Lee
d120f14d1c Use modern syntax in Next client code (e.g. async await) (#7014)
* Use async/await in build output

* Run next client libraries through plugin-transform-modules-commonjs

* Fix missing includes
2019-05-01 19:16:52 +02:00
Tomek
8cdd539f98 add theme to styled-components example (#7206) 2019-05-01 14:26:58 +02:00
Connor Davis
3fa04620e7 Remove Deploy To Now buttons (#7126)
* Remove Deploy To Now buttons

* Remove remaining buttons
2019-04-24 10:53:58 +02:00
Nathan Sculli
e3ddca4784 Update the recommendation section in examples/with-reasonml (#7089) 2019-04-19 15:28:28 -05:00
Nathan Sculli
44f7d1fbc4 Upgrade with-reasonml example to Reason React 0.7 and JSX 3 (#7078)
- Use the new [@react.component] decorator for all of the react
  components and bindings.
- Use the new react hook integrations for the counter component.
- Add a `npm run dev:reason` and `npm run dev:next` commands to make
  running the build processes in separate terminals easier.  I didn't
  update the README because I'm unsure if this is something that would
  be desired.
- upgrade to reason react 0.7.0
- upgrade to react and react-dom 16.8.6
- upgrade to bs-platform 5.0.3
- upgrade to @babel/core 7.4.3
2019-04-20 02:57:08 +09:00
Yuki Takemoto
8e5ef48822 Fix broken link (#7087) 2019-04-19 12:12:31 -05:00
Jonathan Pollak
90e455791e Update fela example (#7051)
* feat(fela-example): replace old API with new ones
2019-04-18 10:05:09 -05:00
Koen Punt
362d2b0603 with-apollo example: explicitly pass fetch to HttpLink (#7072)
instead of letter apollo rely on a global variable, we pass it explicitly to the HttpLink constructor.
2019-04-18 09:46:42 -05:00
Andy O'Brien
a7e89eea4d update dependency to fix with-next-page-transitions example (#7049) 2019-04-17 11:18:32 -05:00
Joe Haddad
5499652820 Update AMP example to AMP-first wording 2019-04-17 10:41:20 +09:00
Joe Haddad
3b6aeaae82
Update AMP example (#7056) 2019-04-17 10:34:33 +09:00
JJ Kasper
dbb849e90c
Remove un-needed config from example (#7055) 2019-04-17 10:23:32 +09:00
JJ Kasper
cf889d6094 Re-add experimental amp config (#7030)
* Update amphtml and canonical rels, put amp behind
experimental flag again, and update checking for amp query

* Fix typescript error

* Re-add flag to next.config.js
2019-04-15 18:26:23 +09:00
Tim Neutkens
1a53ca7474
Add x-powered-by (#7029)
* Add x-powered-by

* Remove ampEnabled type
2019-04-15 16:48:14 +09:00
Connor Davis
e4ceb903a1
Update README.md 2019-04-15 02:19:37 -05:00
Connor Davis
3363f26a42
Fix missing dash 2019-04-14 20:35:03 -05:00
Javier Alcala
8a326345b9 Enable strict type checking on custom-server-typescript example (#7025) 2019-04-13 19:56:12 +02:00
Frieder Bluemle
9281f4651a Fix GitHub spelling (#7024)
Just a minor typo fix: `Github` -> `GitHub`.
2019-04-13 17:36:07 +02:00
JJ Kasper
09a2fe5c38
Amp page level reload (#6971)
* Only refresh the page when the active
page is updated in AMP mode

* Update handling of page reload to make sure it
still refreshes after a change to another page

* Update checking to be more accurate

* Fix amp-dev not being loaded without
experimental.amp and remove next.config from amp example

* Remove old with-amp example and
rename experimental-amp to with-amp

* update example name

Co-Authored-By: ijjk <jj@jjsweb.site>

* Update comment wording

Co-Authored-By: ijjk <jj@jjsweb.site>

* Use document for reload to keep scroll position

Co-Authored-By: ijjk <jj@jjsweb.site>

* fallback to reloading on error

Co-Authored-By: ijjk <jj@jjsweb.site>

* Update with-amp example readme
2019-04-12 20:54:27 -05:00
Alex Parish
5ed51c0049 Update with-graphql-hooks example to exclude SSR library from commons chunk (#7015) 2019-04-11 17:59:42 -05:00
JJ Kasper
e5111745b5
Replace .amp.js with withAmp(Comp) (#7009)
* Add WithAmp to enable AMP support for
pages instead of .amp.js

* Update handling for exporting AMP

* Fix ampPath in export for / path and
revert isAmp logic to handle right

* Update amphtml test suite

* Add handling for noDirtyAmp during
export and update amp-export test suite

* Update serverless and export-default-map
test suites

* Update require-page tests
2019-04-11 13:59:26 -05:00
Juan Olvera
c564c1416a add package.json to example (#7004) 2019-04-11 11:26:18 +02:00
Kyle Holmberg
139b1487b2 Update root-static-files example (#6967) 2019-04-09 19:08:39 -05:00
Khoi Le
d943d40ed8
Added cross-env package for using on Windows (#6877)
Added [cross-env](https://www.npmjs.com/package/cross-env) package for using the command `npm start` on Windows environment.

Tested on:
- [x] Windows version 1809
- [x] Node.js 10.15.3 (LTS version)
2019-04-09 15:37:17 -04:00
Ivan Jovanovic
f4c160ee46
Custom hapi server example handle static files (#6822)
While implementing hapi as a custom server, I found a minor issue. The example provided isn't showing that we also need to serve static files using next. This change should fix that. Thanks!
2019-04-09 15:37:14 -04:00
Tev
9c8d7290df Custom ReasonML Server (#6970)
- A typesafe custom server built in reasonml.
2019-04-09 15:15:41 -04:00
yi
3e7f836c28 Added example with react-multi-carousel for rendering items on the server-side (#6820)
* Simplified format function in with-redux (#6518)

* Update README.md (#6749)

- fix runtime configuration example to use `customKey`
- standardize warning callouts to use a block quote and bold "**Warning:**" text. Previously there were different ways a warning was mentioned on the docs page:
  - A warning emoji. The warning emoji didn't render in the actual site. 
    <img width="770" alt="Screen Shot 2019-03-21 at 9 22 21 AM" src="https://user-images.githubusercontent.com/1103708/54759302-c655f380-4bbb-11e9-9116-b0fdc2467bc3.png">
  - Italicized "Warning" text. Imo, does not stand out on the page.
    <img width="663" alt="Screen Shot 2019-03-21 at 9 24 43 AM" src="https://user-images.githubusercontent.com/1103708/54759376-f604fb80-4bbb-11e9-85c6-6589b7738dee.png">

* Adde example on how to rendering muiltiple items carousel on server-side with nextjs
2019-04-03 12:58:59 +02:00
Lucien PESLIER
49fd5990a1 Update Sentry to v5 and add @sentry/integrations (#6873)
Hi everyone :)
I just updated Sentry to v5 and added @sentry/integrations due to breaking changes :)
I also fix the documentation. npm commands were in yarn section.
2019-04-03 12:32:36 +02:00
Corbin Crutchley
c120d6b9fb Fastify example dep update (#6714)
This merge request updates `fastify` package from v1 to v2 and adds the `cross-env` package so `NODE_ENV=` can work on Windows as well as OSX/Linux. Also adds example build output to GITIGNORE

Worth mentioning that pressing `a` will bring up a page that says `b` and vice-versa, but this seems to be the logic from the previous example as well. Can change if wanted
2019-04-03 11:56:39 +02:00
Shahzeb K
c97617fdf5 Added an HTTP2 server example (#6856)
As requested in this issue: https://github.com/zeit/next.js/issues/6850

This is a basic HTTP2 server which can handle the `/` and `/about` routes. 

The Readme includes [specific instruction](31877720f0/examples/with-http2/README.md (download-manually)) about how to generate the public/private keys used for this demo server.
2019-04-03 11:31:45 +02:00
Danil Shashkov
2f325e0f69 Add example with astroturf (Zero runtime CSS-in-JS) (#6821)
* Add example with astroturf (Zero runtime CSS-in-JS)
2019-03-28 15:41:05 -05:00
Corbin Crutchley
0f2bd19216 with apollo and redux example: Update deps and fix build (#6733)
* with apollo and redux example: Update deps and fix build

* Fix linting errors
2019-03-27 16:02:05 -05:00
Corbin Crutchley
1d66da15a1 with apollo and redux saga example: Update deps (#6734)
* with apollo and redux saga example: Update deps

* Fix linting problems
2019-03-27 16:00:57 -05:00
Corbin Crutchley
e03266008c form handler example: Update deps and fix build from dep update (#6732)
* form handler example: Update deps and fix build from dep update

* Ran lint error fixers

* Fixes errors that occur when commit occurs

* Commit linter fixes
2019-03-27 16:12:45 -04:00
Václav Nosek
02966afd5a [with-sentry] example: Make 'utils/sentry.js' more flexible (#6769)
* Make `ctx` optional in `captureException` function

* Make 'release' optional when calling sentry util

* Fix code style
2019-03-27 13:23:34 +01:00
Chris Cowan
1888467696 Improve with-google-analytics example (#6787)
The with-google-analytics example had the "routeChangeComplete" event listener set up in components/Page.js, but that the event listener would only be set up if the user visited a page using that component. From the example, it's not clear if google analytics can be used without making every page use a component like components/Page.js. Someone following the example may make pages that don't use components/Page.js and fail to have page views reported, or feel compelled to force a shared component into their design unnecessarily, or might even make a mistake by making multiple different components like Page.js which each add a new "routeChangeComplete" event listener, causing page views to be over-reported when the user navigates between pages using the different components.

This PR moves the "routeChangeComplete" event listener into _app.js, where it's guaranteed to be executed for every page and is more obviously decoupled from page-layout-related components.

This PR also fixes a React warning about the lack of an onChange handler on an input tag, and removes the unnecessary implementation of `getInitialProps` in _document.js (the default implementation is inherited if not present, there's nothing this example needs to do with `getInitialProps` specifically, and the body of the method seems to have been based on an old version of next's internal implementation).

This PR also fixes the url being passed to google tag manager incorrectly. It looks like page_path should be used instead of page_location because the `url` value only has the path, not the full url with the domain name, etc. (https://developers.google.com/analytics/devguides/collection/gtagjs/pages)
2019-03-27 13:21:41 +01:00
Tomáš Hapl
99362592b9 example with orbit-components (#6793) 2019-03-27 01:49:12 +01:00
Corbin Crutchley
9504a389c0 Update dependencies of various examples (#6731)
Minor changes to examples. Updating major semver updates with only `package.json` changes. 
I've done my best to make sure that these packages.json files all have `latest` for the `nextjs` package, `cross-env` for those with `server.js` files, etc.
I also added a `package.json` to `with-dynamic-app-layout` (it was missing one previously)

Made sure to test all of these packages post-upgrade to ensure maintained functionality
2019-03-27 01:42:49 +01:00
Michele Salvini
affe356a90 Pass mapDispatchToProps as an object (#6786)
wrapping `startClock` in `bindActionsCreator` there's no need to pass `dispatch` in:
```
this.props.startClock(dispatch)
```
Furthermore `bindActionsCreator` is not needed because following already bind actions:
```
const mapDispatchToProps = {
  startClock
};
```
2019-03-26 12:28:18 +01:00
Tim Neutkens
cf73809cb9
Revert "Add static-no-js site example (#6770)" (#6774)
This reverts commit 879da36888.
2019-03-25 09:08:41 +01:00
Giuseppe
879da36888 Add static-no-js site example (#6770) 2019-03-25 09:04:47 +01:00
Julio Carlos Menendez
7ae0ff38e9 Adds example for Office UI Fabric React. (#6705)
* Adds example for Office UI Fabric React.

* Fixes code style errors.
2019-03-19 13:30:05 +01:00
Jehun Seem(심제훈)
ce329cce96 Fix with-mobx-state-tree-typescript modules export (#6704)
* Update libraries

* Fix for export modules for type
2019-03-19 11:43:12 +01:00
JJ Kasper
12cbb934b3 Add support for creating AMP pages (#6706)
* Add support for .amp.js pages and
resolving /page?amp=1 to page.amp.js

* Update amp tests

* Update example and clean up amp page resolving

* Add nested amp test

* page => normalizedPage

* Add type to page options

* Add handling of amp with all pageExtensions
and normalize page

* Make sure findPageFile only falls back to
amp if enabled
2019-03-18 23:24:21 -04:00
March Works
71c4728598 update with-rematch example (#6699)
Solved the following issue [#6686](https://github.com/zeit/next.js/issues/6686)
2019-03-18 14:37:49 +01:00
Kyle Gallagher
05ddf3e4e0 Small fix to example custom-server-typescript (#6695)
I noticed that the nodemon.json file was not watching for all file changes in the correct location for filetype .ts (typescript). After some research I found that the "ext" option in the nodemon.json fixes the issue and should work across all operating systems.
2019-03-18 11:57:39 +01:00
Danil Shashkov
fbedce4de1 Add with-linaria example (#6510)
Next.js with Zero-runtime CSS-in-JS
2019-03-17 00:25:20 +01:00
John Lombardo
5e4886cdb9 Port with-mobx to with-mobx-react-lite (#6617)
Replicates the behaviour of the `with-mobx` example but implemented using `mobx-react-lite` and React context.

I'm still working out a best practice regarding actions and welcome feedback on anything.
2019-03-16 16:47:28 +01:00
Brent Ertz
4c4459f931 Update custom-server-typescript example (#6627)
* Typecheck server vs. client code independently, ensuring that each respects its own tsconfig.
* Use nextjs default distDir in tsconfig
* Update packages
* Fix type error in server.listen callback
2019-03-16 16:42:22 +01:00
Ravinder Mahajan
1c31d79c38 Creating one more example which only uses redux and no thunk as middl… (#6636)
Adding one more example which only uses redux and not thunk. This helps a lot for a beginner to understand basic redux first.
2019-03-14 17:40:00 +01:00
Christian Alfoni
6ba41915e4 initial overmind example (#6548)
* initial overmind example

* fix linting

* add with-overmind readme
2019-03-12 12:42:42 +01:00
Jan Potoms
176b5466bb Remove stray comma (#6593)
* eliminate need for render() method

* remove stray
2019-03-10 13:18:17 +01:00
Jan Potoms
0bcfd33c38 eliminate need for render() method (#6591)
This simplifies the example and reuses the existing `initialProps.styles` logic.
2019-03-10 12:17:18 +01:00
JJ Kasper
17da3f86ad Update with-now-env to use env config (#6581)
* Update with-now-env to use `env` config
instead of webpack.DefinePlugin

* Remove mention of DefinePlugin from index page
2019-03-08 20:41:07 +01:00
JJ Kasper
17806e2bb2
Add links for now info to parameterized-routing example (#6565) 2019-03-07 13:38:42 -06:00
k-kawakami
d9060f5abd Remove trailing spaces (#6547)
### changes
#### remove trailing spaces

When I was using example I noticed trailing spaces.
So, this PR removes the trailing spaces of json file, README, and others.

`examples/with-jest-typescript/src/modules/cars/Overview.tsx` also has it, but this time it did not change as tslint error occurs at commit.
2019-03-07 17:40:08 +01:00
Tim Neutkens
51fc26161d
Update README.md 2019-03-07 13:20:46 +01:00
Marton Langa
5f003105ef Change redirect status to 302 (#6562)
As discussed in #6546, changing redirect status to 302, so the redirect is only temporary
2019-03-07 12:51:45 +01:00
Marton Langa
0a4f0e6356 Fix page not loading with ending the request (#6546) 2019-03-07 11:29:25 +01:00
Roger Hutchings
068dd825f3 Add Grommet example (#6529)
Adds a new example showing how to use the [Grommet UI library](https://grommet.io/) with Next.js.
2019-03-05 14:00:57 +01:00
GaelS
2e00ebfe6c Update login.js (#6527)
Playing with this example, I realized that it was not doing what I expected in case of an error coming back from the API (e.g : throw properly the error and save it in the state).
2019-03-05 01:07:22 +01:00
Jess Telford
a3d94a56a4 [examples/with-sentry] Better docs + correct dependencies (#6521) 2019-03-03 23:09:18 +01:00
Mike Francis
8e807ca203 Added with-typescript-styled-components example (#6511)
* Added with-typescript-styled-components example

* Fix linting errors
2019-03-02 15:30:11 +01:00
JJ Kasper
89ad01cab8 Update with-zones example to support Now v2 / serverless (#6485)
Fixes: #6468
2019-03-02 01:11:37 +01:00
Joe Warren
5fd7b85280 Add graphql-hooks example (#6482)
Adds an example app using [graphql-hooks](https://github.com/nearform/graphql-hooks) that started life as the with-apollo example app. It uses the same graph.cool backend, mostly to demonstrate how similar it is.
2019-03-01 18:21:03 +01:00
JJ Kasper
23178db575 Add styles to experimental-amp example (#6461)
After discussion added global styles to experimental-amp example
2019-02-27 22:01:49 +01:00
JJ Kasper
70d611f0de Update with-hashed-statics example (#6472)
Fixes: https://github.com/zeit/now-builders/issues/160
2019-02-27 21:26:45 +01:00
Kiko Beats
3998805b2e Use cacheable-response for ssr (#6393)
Hello,

I have been using next.js for a while in a bunch of projects, so first for all thanks for all the vibrant effort around the project 🖤. 

Always I see the server side next.js approach as an advantage, but also a weakness for the extra resources you need to have, specially comparing how cheap is a client side app.

In order to do my things cheaper, I started using the SSR pattern you suggested in your examples, so useful! It saves time and resources.

However, it was *too simple*. In a real production scenario, you need a bit more, specially related with send the right response headers to keep the rest of external network agent updated of your cache state.

I started a tiny script code for doing that; basically, I copy/paste it on my ssr projects.

Now, after a time, I think it's worth it publish it as [cacheable-response](https://github.com/Kikobeats/cacheable-response) module.

The PR is for adding the module leverage into the next.js ssr example. 

It's doing the same, plus:

- be possible use a multi storage cache (memory by default; mongodb, redis, mysql, supported).
- sending `cache-control` response headers.
- sending `X-Cache-Expired-At`, just a humanize way to see the expiration time.
- support for forcing invalidation via `force=true` query parameter.

I hope you like it 🙂
2019-02-27 13:14:50 +01:00
Samundra Shrestha
aed7f643e2 add extra info to authentication (#6435)
* add extra info to authentication

* Update auth.js
2019-02-27 12:55:25 +01:00
Luc
806bfdfa99 Update with-jest, with-jest-react-testing-library examples (#6464)
The latest version of babel-jest doesn't require `babel-core` with the bridge version anymore (updated in this PR : https://github.com/facebook/jest/pull/7016).

So I'm updating with-jest and with-jest-react-testing-library examples accordingly.
2019-02-27 12:32:12 +01:00
Peter Kellner
62f84bb1ea Create example for adding env variables from next.js.config / Final (#6318)
* This is a non-working example of using PHASE_DEVELOPMENT_SERVER and PHASE_PRODUCTION_SERVER in production. I followed @timneutkens gist but was unable to make it work so I've boiled it down into this non-working example which I believe is the same.  The README is not updated. Once it is figured out why this is not working, I'll clean up the project and update the pull request to be complete but for now just want to make it work.

* added .eslintrc so that ` eslint . --fix` would work (not sure if that was really necessary). I assume that is same as `yarn lint-fix`.

* fixes for standard style

* fixes for standard style

* Fix example and add some comments

* Updated documentation and small change to logic of prod,dev,staging to work as expected.
Added significantly more doc then I normally would in the hopes that it helps someone avoid the mis-understanding I went through.  If it's too much, LMK and I'll reduce.

* removed eslint and updated package.json to get rid of eslint and standardjs
2019-02-27 12:18:04 +01:00
laiso
fdb10d4f1d Update to Next v8.0 example on with-graphql-react (#6454)
I'm working on examples/with-graphql-react changes to:
- Next v7 to v8.0 and update dependencies
- fix some errors for the change of graphql-react API
2019-02-26 23:44:45 +01:00
Matsumoto Toshi
967542cc83 Update @zeit/next-preact example (#6390)
* update next-preact

* Update package.json
2019-02-26 10:01:15 -05:00
JJ Kasper
074432d92c Drop images from experimental-amp and with-amp examples (#6446) 2019-02-26 00:38:13 +01:00
Joe Haddad
99867a1728 Add new experimental-amp example (#6444) 2019-02-25 23:49:49 +01:00
HelloRusk
78d560e5d7 fix link in with-react-with-styles sample (#6438)
with-aphrodite example link didn't work properly
2019-02-25 16:55:45 +01:00
Jesse Hoffman
a971d295ab Remove jsonPageRes Documentation Reference (#6440)
Next.js no longer uses `jsonPageRes`.

This PR removes it from `en-us` and `zh-cn` documentation (formatting picked up some changes on zh-cn readme).

Also updated the Flow type def for `getInitialProps`.

Resolves #6363
2019-02-25 16:49:11 +01:00
Jepser Bernardino
993cab89e5 Update Hapi example (#6429)
Since version 18 (released in January), Hapi's `request.url` returns the parsed URL, so `parse` is not needed.

Ref:
- https://hapijs.com/api#-requesturl
- https://github.com/hapijs/hapi/pull/3822
2019-02-24 13:44:12 +01:00
Pierre de la Martinière
e05229be54 Fix hot reloading in the yarn workspaces example (#6402)
* Fix hot reloading in the yarn workspaces example

* Update README links
2019-02-22 12:17:45 +01:00
Kévin Dunglas
e0896e5dbe Add an example using ESI cache (with React ESI) (#6225)
[React ESI](https://github.com/dunglas/react-esi) is a brand new cache library for vanilla React and Next.js applications, that can make highly dynamic applications as fast as static sites by leveraging the open Edge Server Include specification.

https://github.com/dunglas/react-esi

Because this spec is widespread, React ESI natively supports most of the well-known cloud cache providers including Cloudflare Workers, Akamai and Fastly. Of course, React ESI also supports the open source Varnish cache server that you can use in your own infrastructure for free (configuration provided).

This PR shows how to integrate React ESI with Next.js.
2019-02-22 09:32:51 +01:00
Joe Haddad
1757ad022c Drop cli-cursor dependency (#6387) 2019-02-21 15:34:35 +01:00
HelloRusk
414e8fab6c Update link in wasm example (#6389)
I renewed Rust installation Link.
2019-02-21 15:34:20 +01:00
Vincent Grafé
d7856c6698 fixes a few inconsistencies in server routes (#6382)
I spotted a few typos in the server files, that might confuse new/unexperienced users. I hope I did catch them all!
2019-02-21 13:21:22 +01:00
Robert Sköld
9f5d1ef31b Add example using lingui.js (#6210) 2019-02-21 12:53:02 +01:00
Ariel Fuggini
5ab3f00441 Fixed missing next deployment directory bug (#6331)
Fixes https://github.com/zeit/next.js/issues/6201 
Fixes #5912
2019-02-21 00:45:07 +01:00
Jess Telford
09508ed4bb [with-sentry] Use env config instead of webpack where possible (#6381) 2019-02-21 00:33:32 +01:00
Connor Davis
61de215e04
Move webpack config to TypeScript (#6348) 2019-02-20 13:24:02 -06:00
Jess Telford
ecbecb9edb Fixes for with-sentry example (#6362) 2019-02-20 14:49:16 +01:00
Jess Telford
9d7385c3d8 Add SSR'd Portals example (#6365) 2019-02-20 14:06:28 +01:00
HelloRusk
6eacea4361 updated module and removed old example in socket.io example (#6368) 2019-02-20 13:56:48 +01:00
JJ Kasper
bf69357f27 Remove onDemandEntries WebSocket server in favor of EventSource connection (#6354)
After talking with @timneutkens it was decided it'd be more streamlined to replace the onDemandEntries WebSocket with an alternative. Using the EventSource connection gives us these benefits over the WebSocket one:

- less code needed
- no extra server running
- no extra config for onDemandEntries
2019-02-19 21:58:47 +01:00
Jess Telford
cc83e751f1 Load styled-components example on codesandbox (#6321)
If this is an acceptable pattern, I'm happy to open a PR to add these links to all the other examples also 👍
2019-02-18 10:16:23 -05:00
Timon Borter
f9fedaeba6 recreate stdChannel (or saga middleware). (#6330) 2019-02-17 20:57:59 +01:00
Ahmed Tarek
5cef35b811 Fix style importing (#6322) 2019-02-17 13:32:58 +01:00
JJ Kasper
5d779a0289 Add falling back to fetch based pinging for onDemandEntries (#6310)
After discussion, I added falling back to fetch based pinging when the WebSocket fails to connect. I also added an example of how to proxy the onDemandEntries WebSocket when using a custom server. Fixes: #6296
2019-02-15 22:22:21 +01:00
Timon Borter
d2ef34429c push redux-saga to major release 1.0.1. (#6300) 2019-02-14 19:05:27 +01:00
Felix Mosheev
04ce3e7174 Use process.browser instead of env probing (#6286) 2019-02-14 19:05:08 +01:00
Jonathan Reed
7dbe837ae4 fixes hashed statics readme (#6293)
# Description

* Fixes incorrect assertion of configuration file in the `with-hashed-statics` README as well as adds link to line for updating
2019-02-13 19:53:42 +01:00
Tim Neutkens
4fea345f5d Merge branch 'master' into canary
# Conflicts:
#	lerna.json
#	packages/next-server/package.json
#	packages/next/package.json
2019-02-13 07:19:58 +01:00
Spencer Elliott
4dd6094639 styled-components example: use a fragment for styles initial prop (#6252)
`initialProps.styles` is a React node, but not guaranteed to be an
array, so we can use a fragment to concatenate additional styles.

See https://github.com/DefinitelyTyped/DefinitelyTyped/issues/32932#issuecomment-462372319
2019-02-11 20:48:03 +01:00
Juan Olvera
80cb91ec87 Add setup to run example with cookie authentication locally (#6101)
* extract request login from auth

* add clarification that the monorepo is for deploy in Now only and fix typo

* Refactor HOC

- add authorization to HOC
- add displayName to HOC
- remove unnecessary `run`s in local routing
2019-02-11 14:17:43 +01:00
Fredrik Höglund
2ab1ae7f61 Updated examples for build-time env configuration for v8 (#6237)
* Updated examples for build-time env configuration for v8

* Add comment to build time config example with how to include entire .env
2019-02-11 14:15:06 +01:00
Resi Respati
3746d7d90b [with-typescript] Fixed incorrect query type (#6238) 2019-02-11 10:32:10 +01:00
Tim Neutkens
163830c026 Merge branch 'canary'
# Conflicts:
#	examples/with-apollo-and-redux/README.md
#	examples/with-sentry/README.md
#	examples/with-sentry/package.json
#	examples/with-sentry/pages/_app.js
#	package.json
#	packages/next/build/webpack-config.js
#	packages/next/client/index.js
#	server/document.js
#	server/render.js
#	test/integration/production/test/index.test.js
2019-02-11 08:22:31 +01:00
Resi Respati
f8a80f1aa9 [with-typescript] remove unnecessary passHref in Link components (#6233)
As per discussion in #6165, I removed the `passHref` in `Link` as
they're unnecessary.
2019-02-11 00:00:05 +01:00
Fredrik Höglund
b05df70872 Fix first render of with-react-helmet example (#6235) 2019-02-10 20:48:13 +01:00
Henri
98cf0a8311 [examples] Update react jss example (#6198)
This updates the react-jss example to work with the v10 alpha
2019-02-04 11:51:38 +01:00
Resi Respati
8fdb133903 [with-typescript] Improved intial props examples, added example detail (#6165)
I've just thought of a way to improve the initial props page by adding
an example for a list/detail page structure. To do that, I've created a
separate `/detail` page, and a mock API which calls data from the array
we made on the previous PR.

A ListDetail component is created as an example for displaying detail.

Page structure is also cleaned up. Should I go ahead and add an example
on how to style with styled-jsx + its TS declarations? I might decide to
do it within this week anyway.
2019-01-31 17:36:02 +00:00
Petr Messner
968475fb95 Update with-relay-modern and with-relay-modern-server-express (#6182)
Update examples with-relay-modern and with-relay-modern-server-express to react-relay 2.0.0

- react-relay has started to use new Context API instead of Legacy Context API
- add `parseInt` because graphql 14.0.0 introduced stricter scalar value coercion

Closes #6157
2019-01-31 10:38:19 +01:00
Timon Borter
cf31021e25 Bugfix/redux saga 1 0 0 not ready (#6176)
This reverts the changes made in [this pr](https://github.com/zeit/next.js/pull/6109).
`redux-saga: "1.0.0"` changed the way it handles it's queues. Because of that we're still having trouble to implement the synchronous side-effects flow in `next-redux-saga`. See [this discussion](https://github.com/bbortt/next-redux-saga/pull/1) for more information.
Therefore I would feel more comfortable not to mislead users by giving them a non-working example in the main branch.
2019-01-30 15:34:18 +01:00
Jan Bejvl
b8057edd6e Updated README.md with proper link (#6172)
Updated README.md with proper link to 'root-static-files' example.
2019-01-29 13:42:58 +01:00