Commit graph

18 commits

Author SHA1 Message Date
Oscar Busk
077097b7f8
Remove licence from all example/package.json that has them (#28007)
* Add licences to all example/package.json that lack them

* Revert "Add licences to all example/package.json that lack them"

This reverts commit 5d4e25012f7334772b8ef5924bc355277e827cba.

* Update check-examples to remove `license` field from examples

* Remove `license` from all examples.

This was mentioned in vercel/next.js#27121 but it looks like it didn't end up being in the merge?

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-08-14 10:48:39 -05:00
Luc Leray
f52955ec94
Clean up examples package.json (#27121)
Clean up package.json files in the `examples` directory:
- Add `private: true`
- Remove `version` (because they are irrelevant for packages that are not meant to be published)
- Remove `name` (because they are optional for packages that are not meant to be published, and when someone clones an example, they often rename it and the property becomes stale)
- Remove `author`
- Remove `description`
- Remove `license`

Also remove `with-dynamic-app-layout` example completely, since it does the same as `layout-component` (https://github.com/vercel/next.js/pull/27121#discussion_r668178408).

## Documentation / Examples

- [x] Make sure the linting passes
2021-07-12 19:58:03 +00:00
Lee Robinson
f6e5a816e2
[examples] Fix ssr-caching example. (#26540)
Closes https://github.com/vercel/next.js/issues/12019 with a better example of proper SSR caching.
2021-06-23 18:27:19 +00:00
Nick Babcock
5629223407
Update examples to use React 17 (#26133)
[With next 11 requiring react 17](https://nextjs.org/blog/next-11#upgrade-guide), most of the examples
need to be updated, so the following snippet updated all the examples to
a compatible react version.

```bash
cd examples/
fd -g 'package.json' | xargs sed -r -i 's/"react": ".*"/"react": "^17.0.2"/
fd -g 'package.json' | xargs sed -r -i 's/"react-dom": ".*"/"react-dom": "^17.0.2"/'

# exclude experimental react version
git checkout with-reason-relay/package.json
```
2021-06-16 16:43:26 +00:00
GH Lee
fb843a5577
[examples] Fix for custom server SSR caching (#18786) 2021-02-07 12:20:00 -06:00
Jesse Jafa
ce994365b7
Add cross-env to ensure examples work on Windows 10 (#16694)
Closes https://github.com/vercel/next.js/issues/16693
2020-08-30 06:53:29 +00:00
Joe Haddad
f17d435166
Ensure all examples are MIT licensed (#16691) 2020-08-29 22:32:35 -04: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
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
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
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
Tim Neutkens
47d3cfd0fd Upgrade React for all examples (#3113) 2017-10-17 08:11:46 +02:00
Henrik
f14297dc80 Normalize example package.json files (#2350) 2017-06-23 10:46:44 +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
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
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
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