Commit graph

27 commits

Author SHA1 Message Date
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
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
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
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
Juan Olvera
7e12997af6 Test updater script on examples folder (#5993)
I wrote a [script](https://github.com/j0lv3r4/dependency-version-updater) to update dependencies recursively in `package.json` files, e.g.:

```
$ node index.js --path="./examples" --dependencies="react=^16.7.0,react-dom=^16.7.0"
```

This PR contains the result against the examples folder.
2019-01-05 12:19:27 +01:00
Tim Neutkens
9c4eefcdbf
Add prettier for examples directory (#5909)
* Add prettier for examples directory

* Fix files

* Fix linting

* Add prettier script in case it has to be ran again
2018-12-17 17:34:32 +01:00
Peter Kellner
c03d25b97a Added length calculation for insert of cache rather then default to 1… (#5835)
* Added length calculation for insert of cache rather then default to 1. changed default cache from 100 to 100MB

* adjusted for lint
2018-12-06 23:17:59 +01:00
Michael Herold
5b3578e58f #4751 - Explicitly mention install when cloning examples (#4758)
Preferably this installation wouldn't be necessary, but in lieu of a fix...

#4751
2018-07-11 23:56:15 +02:00
yhirano55
82e77a8838 Update ssr-caching example (#4363)
* Remove unnecessary dir key from next's argument
* Add license section to package.json
2018-05-14 00:00:37 +02:00
James Hegedus
f2e56609cd Examples: stabalise README format and create-next-app usage (#4009)
* Examples: clarify language around Yarn create & npx

* add missing READMEs and create-next-app usage

* suggest people tag jthegedus in firebase related issues

* add yarn alt instructions

* cerebraljs example readme & fixes
2018-04-03 14:19:05 +02:00
Tim Neutkens
ebf0c47c25
Upgrade standard.js (#4064)
* Upgrade standard.js

# Conflicts:
#	yarn.lock

* Upgrade babel-eslint
2018-03-27 20:11:03 +02:00
James Hegedus
b1d8b839dd Examples: use npx and yarn create to run create-next-app on examples (#4002)
* remove global npm install of create-next-app

* add npx to create-next-app command in examples

* add bash to shell snippets

* add yarn create to next-app command in examples

* fix READMEs named with lowercase

* change READMEs to use UPPERCASE
2018-03-14 09:09:46 +01:00
Olivier Tassinari
2473b55871 [ssr-caching] Only cache 200 status requests (#3708)
* [ssr-caching] Only cache 200 requests

I'm assuming caching an error page is a bad pattern.

* Update server.js
2018-02-06 17:51:49 +05:30
Tim Neutkens
24c1ac6ca9
Use canary for all example downloads (#3411) 2017-12-06 18:12:42 -08:00
Fouad Matin
2528779394 examples: add create-next-app (#3377)
* examples: add create-next-app

* fix with-typescript readme
2017-12-02 20:30:17 -08:00
Tim Neutkens
47d3cfd0fd Upgrade React for all examples (#3113) 2017-10-17 08:11:46 +02:00
Brikou CARRE
ba65b07dff Ease running multiple examples at the same time with process.env.PORT (#2753) 2017-08-10 20:15:46 +02:00
Henrik
f14297dc80 Normalize example package.json files (#2350) 2017-06-23 10:46:44 +02:00
Paul Molluzzo
d08e027a8c Add deploy now button to the top of all example READMEs (#1763)
* Add deploy now button to the top of all example READMEs

* Remove unnecessary whitespace changes
2017-04-22 14:51:51 +02:00
Tim Neutkens
7f0591896a Use latest version of Next for all examples (#1597)
* Use latest for all examples

* Update yarn.lock
2017-04-03 09:46:35 +05:30
Sébastien Dubois
3c7237169f ssr-caching: document way to configure cache key (#1133)
* ssr-caching: document way to configure cache key

* simplify comment
2017-02-14 22:01:50 +05:30
Lukas Strassel
4a73ccbb00 add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples
2017-02-08 10:11:38 +05:30
Sébastien Dubois
a66ff658f4 Fix link (#789)
* Fix link

* Fix links
2017-01-16 18:23:24 -03:00
Naoyuki Kanezawa
917a96a1cd set build and start npm scripts on all examples (#549) 2016-12-28 10:12:24 -08:00
nkzawa
1888a251a8 fix npm script on examples 2016-12-26 12:59:09 +09:00
Ian Mitchell
355dbf8fdd Fix SSR Cache Example (#510) 2016-12-25 00:38:35 +05:30
Arunoda Susiripala
b9bee24787 Add an example with SSR caching. (#497)
* Add an example with SSR caching.

* Update server.js

* Update README.md

* Use app.renderError to display errors in SSR example.
2016-12-23 09:13:52 -08:00