Commit graph

224 commits

Author SHA1 Message Date
Tomas Roos
6de2477564 Mobx leaks memory on server side (#1550)
* Added server.js to configure useStaticRendering on start

* Update package to use server.js

* auto format with standard instead of prettier :( fixes broken test
2017-03-29 17:24:46 +05:30
Koji Ishimoto
5a11a86389 Add and update dependencies (#1531) 2017-03-28 08:22:46 +02:00
Arana Jhonny
e9d0aeb2b2 remove extra semicolon. (#1520) 2017-03-27 20:01:40 +05:30
David Ascher
84d4197a6d Add link (#1492) 2017-03-24 14:14:29 +01:00
Penn Su
b682267b50 Fix URL (#1467) 2017-03-21 09:40:09 +05:30
Vlad Frolov
1a61133dd4 fix(example): Added missing instructions for CSS "bundling" in with-react-md example (#1451) (#1456) 2017-03-18 11:45:48 +01:00
Tim Neutkens
1a7e804361 Document babel caching (#1432) 2017-03-15 20:47:31 +01:00
Henrik
8bd46c8380 Remove .DS_Store file from helmet example (#1435) 2017-03-15 20:36:47 +01:00
Stephen Mathieson
8cf965a753 examples: add svg-components (#982) 2017-03-15 15:26:08 +01:00
BDav24
db7c286740 [POC] Pretty url routing (#1001)
* [example] with pretty url routing

* use single quotes even in React components

* improve Link import
2017-03-15 15:24:54 +01:00
Steve Fan
a57fa7ebb1 An example with react-helmet (#1264)
* upload example

* fix

* fix

* fix

* fix .babelrc

* fix standard style

* fix indent

* rename helmetHead to helmet

* added gitignore

* package.json

* removed yarn.lock

* Added more examples of using react-helmet

* removed gitignore
2017-03-15 15:23:42 +01:00
Guilherme Diego
123a635f00 Example to create next application with scoped/external css. (#1340)
* First structure for external css example

* Remove: Builded files

* Fix: Identation to 2 spaces

* Fix example

* Fix lint

* Fix: Review points
2017-03-15 15:21:48 +01:00
Tim Neutkens
228bbbef74 Use jsonPageRes instead of xhr (#1424) 2017-03-15 08:07:29 +05:30
Adam Soffer
d5bd8c7d03 Update with-apollo example (#1394)
* Add minimal apollo example

* Update apollo example README

* Update apollo example demo link in README

* Fix button styles

* Fix show more button

* Alias demo url

* Include the data field on the Apollo store when hydrating

* Revert

* Include the data field on the Apollo store when hydrating per tpreusse's suggestion.

* Add example to faq section in README

* Sort by newest; Add active state to buttons

* Make optimization suggestions

* Use process.browser; inline props

* Pass wrapped component's initial props into component heirarchy if they exist

* Remove unnecessary sorting of array

* Update Apollo example

* Remove trailing comma

* Update reduxRootKey

* Remove unnecessary babelrc

* Update with-apollo example

- Remove use of deprecated 'reduxRootKey' option
- Add loading indicator inside pagination button
2017-03-14 23:41:55 +01:00
Tim Neutkens
68a7b59b19 Upgrade styled-components. Fixes #1416 (#1422) 2017-03-14 13:18:10 -07:00
Luke Edwards
4ad5e2e0dc Examples: Update Inferno & Preact (#1407)
* clean & bump inferno & preact pkgs

* reenable UglifyJS for preact
2017-03-13 22:05:04 +01:00
Jayden Seric
02e697cb0d Updated with-apollo example. (#1389)
- Deleted several unused dependencies.
- Updated dependencies.
- Simplified Apollo related imports thanks to react-apollo exporting apollo-client and graphql-tag since [v0.13.2](https://github.com/apollographql/react-apollo/blob/master/Changelog.md#0132).
- Tidied the readme and added a link to the Apollo docs.
2017-03-12 08:33:01 +01:00
Sergio Daniel Xalambrí
38822717a9 Add support for URL objects in Link and Router (#1345)
* Add support for URL objects in Link and Router

* Fix typo in comment

* Fix possible bug if the `href` prop is `null`

* Document the usage of URL objects in Link and Router

* Update readme.md

* Parse URL to get the host & hostname in `isLocal`

This should check if the current location and the checked URL have the same `host` or `hostname`.

* Format `as` parameter from object to string if required

* Format `href` and `as` inside the construct and componentWillReceiveProps

* Use `JSON.stringify` to compare objects

* Add usage example

* chore(package): update chromedriver to version 2.28.0 (#1386)

https://greenkeeper.io/

* Refactor the codebase a bit.

* Change the example name.

* Add a few test cases.

* Add the example to the README.
2017-03-12 09:27:51 +05:30
Larry Lu
4fb7e4bc64 Fix typo (#1380)
port 300 -> 3000
2017-03-10 09:10:44 +01:00
Sergio Daniel Xalambrí
bb3ceaadea Fix styled-components server-render example (#1382) 2017-03-10 09:07:28 +01:00
Tim Suchanek
40573317f7 Update README.md (#1368)
Fix graph.cool link in example
2017-03-07 14:47:31 +01:00
Tim Neutkens
bf9d34df37 Disable uglify the pretty way (#1351) 2017-03-06 08:53:00 -08:00
Arunoda Susiripala
f8f3fa7dce Introducing Shallow Routing (#1357)
* Simplify route info handling.

* Add basic resolve=false support.

* Make sure to render getInitialProps always if it's the first render.

* Change resolve=false to shallow routing.

* Add test cases for shallow routing.

* Update README for shallow routing docs.

* Update docs.

* Update docs.

* Update docs.
2017-03-06 08:48:35 -08:00
Conor Dockry
193eaf4c9e Add missing ! in using-preact example (#1355) (#1356) 2017-03-06 10:46:02 +05:30
Orlin M Bozhinov
563856f477 postcss-loader, postcss-easy-import, normalize.css and autoprefixer (#1352) 2017-03-05 07:48:37 -08:00
Tim Neutkens
5947716ff7 Implement preact/inferno SSR (#1346)
* Use module-alias to alias preact server side

* Use module-alias to alias inferno server side

* Remove unneeded routes example
2017-03-04 17:47:56 -08:00
Tim Neutkens
2a1f8ad387 Fix linting errors in standard 9.0 (#1333)
* Fix linting errors in standard 9.0

* Update lockfile
2017-03-02 16:17:41 -08:00
Arana Jhonny
bc47aac8f4 Fixed some problems with standard (#1331) 2017-03-02 22:46:16 +01:00
Orlin M Bozhinov
38cc82d0bc With global stylesheet paths (#1327)
* with-global-stylesheet without relative paths and with node_modules

* a parenthetical remark about material-components-web not being part of the example
2017-03-02 08:37:58 -08:00
fridays
7c8cd4bc69 Example with next-routes (#1290)
* Example with next-routes

* optimize description

* rename to with-next-routes
2017-03-01 09:42:47 -08:00
Arana Jhonny
68d48cb004 Update Koa example for Koa 2 with async/await (#1317) 2017-02-28 21:49:58 +01:00
Tim Neutkens
e1babdfe9d Render styled-jsx in _document example (#1287) 2017-02-28 05:15:49 +05:30
Tim Neutkens
f8f90955c5 Add prefetch to propTypes + flow typings (#1295) 2017-02-27 10:50:28 +05:30
Tim Neutkens
408633c1dc Remove traces of glamor (#1286)
* Remove traces of glamor

As talked about with @rauchg. Glamor takes up around 60KB of the bundle (pre-gzip). Since styled-jsx is the way to go now and we support adding glamor by the user we should remove it as dependency cause it is bundled even when not used.

Added rehydration to the example, since we did that in our code.

There is only one thing I'm not sure about and want to discuss:
what should we do with next/css. Right now I added a throw for when it is imported. I'm not sure if we should do that / some other way to notify the user it has been removed. The reasoning behind the throw is that when we would do a console.warn the user would see 'css.default.<X>' not found because we don't have the glamor dependency anymore.

* Update yarn.lock

* Remove test for styles
2017-02-26 17:58:00 +05:30
Sébastien Dubois
6ede206d82 update link prefetch syntax in examples (#1276) 2017-02-25 15:54:42 +01:00
Eric Ferraiuolo
e24db68f8b Add example app with React Intl (#1055)
* Add example app with React Intl

Fixes #1022

* Update examples/with-react-intl/package.json to be consistent
2017-02-24 22:45:18 +01:00
Tim Neutkens
9ba7a10f85 Fix linting errors (#1235) 2017-02-21 21:52:44 +01:00
Fabien Le Frapper
22c22efc35 Fix missing dependencies (#1232)
Tried to pull & run this example, it failed, complaining about missing react & react-dom dependencies
2017-02-21 16:40:18 +01:00
Davide Bertola
d4b018e91f add ‘with-refnux’ example (#1215) 2017-02-20 20:13:05 -08:00
Tim Neutkens
e5844314e3 Fix linting errors (#1197) 2017-02-18 20:12:19 +01:00
胡子大哈
bdd5b9ef3d Add note for next-connect-redux #1193 (#1203) 2017-02-18 19:39:34 +01:00
Guillermo Rauch
47e5231cdd Revert "Use the original idea of provider wrapper for redux example (#1201)"
This reverts commit ba54c6ac3d.
2017-02-18 14:11:54 -03:00
胡子大哈
ba54c6ac3d Use the original idea of provider wrapper for redux example (#1201)
Use the original idea of provider wrapper from #1193 and remove
unnecessary `initStore` in every page.
2017-02-18 14:03:02 -03:00
Kirill Konshin
f0cb5b71a0 Added next-redux-wrapper to example (#1196)
* Added next-redux-wrapper to example

* Docs, renamed withRedux
2017-02-18 01:10:27 -03:00
Tim Neutkens
00590d7181 Remove babelrc for preact example (#1194) 2017-02-17 20:03:02 -03:00
Thomas Lindstrøm
6e5d57dae9 Add example with-scoped-stylesheets-and-postcss (#1146)
* Add example `with-external-stylesheets-and-postcss`

* 🔥 Remove extra semi-colon

* 📝 Attribute `with-global-stylesheet`

* Force a new test

* 📝 Update README.md

* Rename `external` -> `scoped`
2017-02-17 16:04:58 +01:00
Dan Zajdband
e33a7dbc25 Now that we have react-dom as a peerDependency this import issue was fixed (#1183) 2017-02-16 19:44:43 -03:00
Tim Neutkens
ff547752f0 Fix HMR issue with webpack-stats-analyzer (#1149)
* Use stats.json instead of running server

* Add suggested changes
2017-02-15 21:42:48 +09:00
Giuseppe
db97fbffad Fix with-styled-jsx-postcss example (#1147) 2017-02-15 11:57:15 +01:00
Arunoda Susiripala
14c86bef1d Introduce a simple prefetching solution (#957)
* Implement a very simple prefetching solution.

* Remove next-prefetcher.

* Require 'whatwg-fetch' only in the client.

* Use xhr in the code.

* Use a simple fetching solution.

* Fix 404 and xhr status issue.

* Move the prefetching implementation to next/router.

* Add deprecated warnning for next/prefetch

* Run only 2 parellel prefetching request at a time.

* Change xhr to jsonPageRes.

* Improve the prefetching logic.

* Add unit tests covering the Router.prefetch()

* Update examples to use the new syntax.

* Update docs.

* Use execOnce() to manage warn printing.

* Remove prefetcher building from the flyfile.js
Because, we no longer use it.
2017-02-15 14:22:22 +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
Tim Neutkens
2f7cc9c33c Add webpack-bundle-analyzer example (#1110) 2017-02-14 07:54:50 +05:30
sfhardman
dbc2ceefde Return a promise from getRequestHandler execution, await _serveStatic in serveStaticWithGzip, update custom-server-hapi to complete request lifecycle (#1099) 2017-02-12 23:12:32 -03:00
Arunoda Susiripala
b220193167 Babelrc false babelrc (#1094)
* Detect babelrc disabling via babelrc.

* Simplify boolean condition.
2017-02-13 06:18:22 +09:00
Davide Bertola
19f1125520 add global stylesheet example (#1016)
* add global stylesheet example

* fix avoiding html-escape of stylesheets

* update readme

* remove .gitignore
2017-02-12 00:22:35 +01:00
Tim Neutkens
c106a1d02f Using router example improvements (#1034) 2017-02-09 22:02:01 +05:30
Arunoda Susiripala
57b6e9a71b Using styled-jsx for with-jest example. (#1052) 2017-02-09 19:14:52 +05:30
Giacomo Rebonato
b00f0c2044 TypeScript example proposal (#845)
* TypeScript example proposal

* removed unused loader

Removed typings

Moved TypeScript to dev dependencies

removed unused typings

changed react typings version

removed react dependency

set next dependency version to latest

removed not needed babel preset

enabled sourcemaps

simplified tsconfig

modified component to be a functional one

* Ignore build

* Making npm script Windows-friendly

* Clean up

* Added readme

* fixed typo
2017-02-09 12:36:58 +01:00
Arunoda Susiripala
bdcb0f7828 Add support to transpile import/export syntax (#1044)
next/babel doesn't transpile import/export.
So, we need to do it explicitly, but only for test env.
2017-02-09 08:32:58 +05:30
Naoyuki Kanezawa
9348762f4a add next/error (#1040) 2017-02-08 16:59:33 -03:00
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
Adam Soffer
01cc898450 Update Apollo example (#1021)
* Add minimal apollo example

* Update apollo example README

* Update apollo example demo link in README

* Fix button styles

* Fix show more button

* Alias demo url

* Include the data field on the Apollo store when hydrating

* Revert

* Include the data field on the Apollo store when hydrating per tpreusse's suggestion.

* Add example to faq section in README

* Sort by newest; Add active state to buttons

* Make optimization suggestions

* Use process.browser; inline props

* Pass wrapped component's initial props into component heirarchy if they exist

* Remove unnecessary sorting of array

* Update Apollo example

* Remove trailing comma

* Update reduxRootKey

* Remove unnecessary babelrc
2017-02-07 12:02:28 +01:00
Emanuel Kluge
f6510c05b2 Pass parsed request-URL into the run-method (#1000) 2017-02-05 12:38:20 -03:00
Sergio Daniel Xalambrí
592c666e82 [example] Progressive rendered application (#998)
* [add] example of a progressive rendered app

* [update] remove extra blank line

* [update] fix typo

* [update] more use cases

* [update] example link

* Update README.md

* [update] next.js dependency version

* [update] fix readme typos
2017-02-05 13:43:28 +01:00
Koutaro Chikuba
267b74b256 Add next.js flowtype definition to with-flow example (#973)
* Add next.js flowtype definition to with-flow

* Add render api types for flow

* Add prefetch types

* Fix push/replace api types to promise
2017-02-05 19:39:51 +09:00
Tim Neutkens
a8731d0651 Added universal configuration example (#991)
* Added universal configuration example

* Make example more clear
2017-02-05 04:43:23 +05:30
Arunoda Susiripala
57e9a5e5f6 Find custom babel config location properly. (#969)
* Find custom babel config location properly.
Earlier we simply check for the .bablerc file in the dir.
But the actual logic is much complex.
Now we are using the babel's actual logic to find the
custom config location.

* Fix failing tests.
2017-02-03 14:33:35 +09:00
Vlad Frolov
fca0a39cbc examples/with-react-md: Fixed "Cannot read property 'focus' of undefined" (#961) 2017-02-02 22:56:07 +01:00
Tim Neutkens
61bdae5a08 Fix typo in react-md example readme (#959) 2017-02-02 20:00:45 +01:00
Vlad Frolov
0a2466a36e Added React-MD example (#940) 2017-02-02 13:10:59 +01:00
Tim Neutkens
59281adef3 Allow parsed url to be passed down (#950)
* Allow parsed url to be passed down

* Update example to reflect url passing

* Check if passed url.query is empty

* Rename url to parsedUrl
2017-02-02 12:21:08 +05:30
Tim Neutkens
0820204646 Remove yarn.lock from examples (#912)
* Remove yarn.lock from examples

* Add yarn.lock to gitignore for examples

* Move yarn ignore to examples directory
2017-01-29 05:48:53 +05:30
Sébastien Dubois
a3bec7666b with-apollo: Don't store Redux store and Apollo client in global namespace (#909)
* Add yarn lockfile

* Avoid storing Redux store and Apollo client in global namespace + don't create Apollo client when already existing in browser
2017-01-28 17:22:32 +01:00
Stephen Mathieson
ee717af088 examples/with-redux: remove global store (#908)
This patch removes the global `store` on the client. IMO this example
should avoid polluting the global namespace with simple scoping tricks
can solve the problem equally as well.
2017-01-27 18:33:42 -08:00
Adam Soffer
8310f812ec Fix Apollo Example (#900)
* Add minimal apollo example

* Update apollo example README

* Update apollo example demo link in README

* Fix button styles

* Fix show more button

* Alias demo url

* Include the data field on the Apollo store when hydrating

* Revert

* Include the data field on the Apollo store when hydrating per tpreusse's suggestion.

* Add example to faq section in README

* Sort by newest; Add active state to buttons

* Make optimization suggestions

* Use process.browser; inline props

* Pass wrapped component's initial props into component heirarchy if they exist

* Remove unnecessary sorting of array
2017-01-27 17:06:17 +01:00
jcsmesquita
8922e7b63a Update README.md (#895)
Just adding download instructions
2017-01-26 23:19:12 +05:30
Adam Soffer
a76ec83b64 Update Apollo Example (#888)
* Add minimal apollo example

* Update apollo example README

* Update apollo example demo link in README

* Fix button styles

* Fix show more button

* Alias demo url

* Include the data field on the Apollo store when hydrating

* Revert

* Include the data field on the Apollo store when hydrating per tpreusse's suggestion.

* Add example to faq section in README

* Sort by newest; Add active state to buttons

* Make optimization suggestions

* Use process.browser; inline props

* Pass wrapped component's initial props into component heirarchy if they exist
2017-01-25 17:10:21 -08:00
Dan Zajdband
3ad3a6c1e7 Added Google AMP example (#793)
* Added Google AMP example

* Added styles and a second page

* Using regular anchor since there is no client-side routing

* Added comment on react config for amp
2017-01-24 05:20:56 -08:00
jagreehal
cbb2d1c250 simpler flow task (#857) 2017-01-23 22:19:14 -08:00
Robin Frischmann
8d8d5ebdf6 Example using Fela (#863)
* added example using fela

* update package-json

* removed nested routing test

* fixed linting issues

* fixed typo
2017-01-23 20:29:15 -03:00
Adam Soffer
4b257483e2 Add Apollo example (#780)
* Add minimal apollo example

* Update apollo example README

* Update apollo example demo link in README

* Fix button styles

* Fix show more button

* Alias demo url

* Include the data field on the Apollo store when hydrating

* Revert

* Include the data field on the Apollo store when hydrating per tpreusse's suggestion.

* Add example to faq section in README

* Sort by newest; Add active state to buttons

* Make optimization suggestions

* Use process.browser; inline props
2017-01-22 13:27:06 +01:00
Kristo Jorgenson
e67d62d888 Update styled-component docs (#841)
* Add details to custom Document documentation

Custom document must be created at ./Pages/_document.js, which is not
noted in the README… so I updated it.

* Add note to styled-components example about existing issue

* Made phrasing a bit more clear

* Another phrasing update.

* from P to p
2017-01-21 22:24:17 +01:00
Arunoda Susiripala
399e510389 Make sure lastAppProps always have some value. (#829)
* Make sure lastAppProps always have some value.

* Revert "Make sure lastAppProps always have some value."

This reverts commit b4ae722d9c1a4460e17dbdc041b111cbd492b2aa.

* Throw an error, if we found an empty object from getInitialProps.

* Add proper tests for getInitialProps empty check.
2017-01-20 11:33:46 -08:00
jagreehal
1e77568657 added example with flow (#814)
* added  example with flow

* Fixed linting errors
2017-01-19 01:48:55 -08:00
Arunoda Susiripala
2efabde215 Fix koa-404 issue by adding res.statusCode to 200 (#815) 2017-01-18 00:45:29 -03:00
Dan Zajdband
2c2d961844 Added Koa example (#800)
* Added Koa example

* Linted koa example
2017-01-17 08:23:06 +01:00
Dan Zajdband
e28f80cd99 Updated <Link> in repo, always wrapping an anchor. (#798) 2017-01-16 22:27:55 +01:00
Sébastien Dubois
a66ff658f4 Fix link (#789)
* Fix link

* Fix links
2017-01-16 18:23:24 -03:00
Dan Zajdband
7cc554c67a Fixed hapi example (#795) 2017-01-16 11:27:07 -08:00
Sébastien Dubois
ffeeb682af Remove useless config override (#790) 2017-01-16 14:24:33 -03:00
Sébastien Dubois
8fa630d855 Add dynamic routing keyword (#788)
I was looking for "dynamic routing" in the examples and didn't find it because that keyword isn't used.
2017-01-16 23:33:11 +09:00
Giuseppe
0d6ceec8db Add styled-jsx-postcss example (#781)
* Add styled-jsx-postcss example

* Remove commented code
2017-01-15 19:59:22 -08:00
Tim Neutkens
b6e72f59e5 Use UTC time to avoid time differences (#782) 2017-01-15 16:14:40 -08:00
nkzawa
8a06c7b092 example: fix style 2017-01-15 00:30:39 +09:00
Shawn Kelly
5ef34c6dd8 update styletron example to support multiple stylesheets (#763) 2017-01-13 15:49:35 -08:00
Arunoda Susiripala
7be5797cc2 Use the preact-compat dist version. (#760) 2017-01-13 11:40:07 -03:00
Huang Xuan
c19b82dfe2 Fix title of README (#720) 2017-01-10 11:32:32 -08:00
sfhardman
ec302aa289 Add custom server example using Hapi (#712) 2017-01-09 18:35:10 -08:00
Tim Neutkens
f3ee901fa6 Use next.js beta for example (#710) 2017-01-09 13:40:45 -08:00
Mike Bannister
2e0f9d144b Fix link (#701) 2017-01-08 12:30:29 -08:00