1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00
Commit graph

452 commits

Author SHA1 Message Date
Tim Neutkens f0703f8e13 Update preact example 2018-01-31 11:19:34 +01:00
Tim Neutkens 6db44f8058 Deprecate css examples 2018-01-31 11:19:34 +01:00
Jerome Fitzgerald ab889369d5 [fix] apollo-redux: Separate out entire example #3463 (#3629)
* [fix] apollo-redux: Separate out entire example #3463

Apollo and Redux are completely separate ways of managing state. This example serves as a conduit if you were using Apollo 1.X with Redux, and are migrating to Apollo 2.x, however, you have chosen not to manage your entire application state within Apollo (`apollo-link-state`).

There is no "withData" function that allows you to call either/or. You must call "withRedux" and/or "withApollo" on your Component. They can be combined in the example at `index.js` or remain separate as seen in `apollo.js` and `redux.js`.

Going forward, this example may go the way of the dodo.

* [chore] reformat code to match next syntax

Localize prettier sometimes has a mind of its own. 😄️

* Fix linting
2018-01-31 10:40:32 +01:00
Brice BERNARD 053a248c44 [with-portals] Remove dynamic import, add <Portal /> (#3571) 2018-01-31 10:35:59 +01:00
Stephen Mathieson 9165d753d0 Add an example using analytics (#3580)
This patch adds an example of a Next.js app using analytics. A custom
document injects the [Segment](https://segment.com) bootstrapping
snippet into the `<head>`, allowing "page" and "track" calls to be made.

An issue came up in CNA asking how we handle this in our apps (see
https://github.com/segmentio/create-next-app/issues/24), so I figure an
"official example" could help.

NOTE: I am affiliated with Segment.
2018-01-31 10:35:27 +01:00
Logan McAnsh 4965387a3c add Polka server example (#3588)
* add Polka server example

* Update package.json

* Fix linting
2018-01-31 09:24:38 +01:00
Sergio Xalambrí 99272808d9 Update custom-server-micro example to latest version (#3594) 2018-01-31 09:22:43 +01:00
Alex Indigo e401e2cf5f Added IoC example (#3595)
* Added `with-ioc` example

* pre-compile deps until we get nextjs magic working
2018-01-31 08:36:20 +01:00
Tim Neutkens 9a82ca4029 Update Next.js version on examples 2018-01-30 21:46:15 +01:00
Matías Hernández Arellano c4830c3a61 upgraded flow version and updated code to use of React.Node (#2) (#3635) 2018-01-30 21:11:37 +01:00
Tim Neutkens e093441bad Universal Webpack (#3578)
* Speed up next build

* Document webpack config

* Speed up next build

* Remove comment

* Add comment

* Clean up rules

* Add comments

* Run in parallel

* Push plugins seperately

* Create a new chunk for react

* Don’t uglify react since it’s already uglified. Move react to commons in development

* Use the minified version directly

* Re-add globpattern

* Move loaders into a separate variable

* Add comment linking to Dan’s explanation

* Remove dot

* Add universal webpack

* Initial dev support

* Fix linting

* Add changes from Arunoda's work

* Made next dev works.
But super slow and no HMR support.

* Fix client side hot reload

* Server side hmr

* Only in dev

* Add on-demand-entries client + hot-middleware

* Add .babelrc support

* Speed up on demand entries by running in parallel

* Serve static generated files

* Add missing config in dev

* Add sass support

* Add support for .map

* Add cssloader config and fix .jsx support

* Rename

* use same defaults as css-loader. Fix linting

* Add NoEmitErrorsPlugin

* Add clientBootstrap

* Use webpackhotmiddleware on the multi compiler

* alpha.3

* Use babel 16.2.x

* Fix reloading after error

* Remove comment

* Release 5.0.0-univeral-alpha.1

* Remove check for React 16

* Release 5.0.0-universal-alpha.2

* React hot loader v4

* Use our static file rendering machanism to serve pages.
This should work well since the file path for a page is predictable.

* Release 5.0.0-universal-alpha.3

* Remove optional loaders

* Release 5.0.0-universal-alpha.4

* Remove clientBootstrap

* Remove renderScript

* Make sure pages bundles are served correctly

* Remove unused import

* Revert to using the same code as canary

* Fix hot loader

* Release 5.0.0-universal-alpha.5

* Check if externals dir exist before applying config

* Add typescript support

* Add support for transpiling certain packages in node_modules

Thanks to @giuseppeg’s work in https://github.com/zeit/next.js/pull/3319

* Add BABEL_DISABLE_CACHE support

* Make sourcemaps in production opt-in

* Revert "Add support for transpiling certain packages in node_modules"

This reverts commit d4b1d9babfb4b9ed4f4b12d56d52dee233e862da.

In favor of a better api around this.

* Support typescript through next.config.js

* Remove comments

* Bring back commons.js calculation

* Remove unused dependencies

* Move base.config.js to webpack.js

* Make sure to only invalidate webpackDevMiddleware one after other.

* Allow babel-loder caching by default.

* Add comment about preact support

* Bring back buildir replace

* Remove obsolete plugin

* Remove build replace, speed up build

* Resolve page entries like pages/day/index.js to pages/day.js

* Add componentDidCatch back

* Compile to bundles

* Use config.distDir everywhere

* Make sure the file is an array

* Remove console.log

* Apply optimization to uglifyjs

* Add comment pointing to source

* Create entries the same way in dev and production

* Remove unused and broken pagesGlobPattern

* day/index.js is automatically turned into day.js at build time

* Remove poweredByHeader option

* Load pages with the correct path.

* Release 5.0.0-universal-alpha.6

* Make sure react-dom/server can be overwritten by module-alias

* Only add react-hot-loader babel plugin in dev

* Release 5.0.0-universal-alpha.7

* Revert tests

* Release 5.0.0-universal-alpha.10

* Make sure next/head is working properly.

* Add wepack alias for 'next' back.

* Make sure overriding className in next/head works

* Alias react too

* Add missing r

* Fragment fallback has to wrap the children

* Use min.js

* Remove css.js

* Remove wallaby.js

* Release 5.0.0-universal-alpha.11

* Resolve relative to workdir instead of next

* Make sure we touch the right file

* Resolve next modules

* Remove dotjsx removal plugins since we use webpack on the server

* Revert "Resolve relative to workdir instead of next"

This reverts commit a13f3e4ab565df9e2c9a3dfc8eb4009c0c2e02ed.

* Externalize any locally loaded module lives outside of app dir.

* Remove server aliases

* Check node_modules reliably

* Add symlink to next for tests

* Make sure dynamic imports work locally.
This is why we need it: b545b519b2/lib/MainTemplate.js (L68)
We need to have the finally clause in the above in __webpack_require__.
webpack output option strictModuleExceptionHandling does that.

* dynmaic -> dynamic

* Remove webpack-node-externals

* Make sure dynamic imports support SSR.

* Remove css support in favor of next-css

* Make sure we load path from `/` since it’s included in the path matching

* Catch when ensurepage couldn’t be fulfilled for `.js.map`

* Register require cache flusher for both client and server

* Add comment explaining this is to facilitate hot reloading

* Only load module when needed

* Remove unused modules

* Release 5.0.0-universal-alpha.12

* Only log the `found babel` message once

* Make sure ondemand entries working correctly.
Now we are just using a single instance of OnDemandEntryHandler.

* Better sourcemaps

* Release 5.0.0-universal-alpha.13

* Lock uglify version to 1.1.6

* Release 5.0.0-universal-alpha.14

* Fix a typo.

* Introduce multi-zones support for mircofrontends

* Add section on css
2018-01-30 16:44:44 +01:00
Saro Vindigni 202ceca1af Fix Doc in with-firebase-authentication (#3626) 2018-01-27 15:12:25 +01:00
Gavin 8c366defaf fix(store): product env cannot find module 'redux-devtools-extension'. (#3618)
Problem description:
- Cannot find module 'redux-devtools-extension'
2018-01-26 17:09:49 +01:00
Shaleen Jain c40f184a6a Extend with-data-prefetch to handle advanced use cases (#3525) 2018-01-26 17:07:17 +01:00
Tim Neutkens bba744d3fa Merge branch 'master' into fix/canary 2018-01-13 06:33:19 +01:00
Wei Zhu 9263ad13f7 Update Ant Design example (#3485) 2018-01-06 17:14:22 +01:00
Cory House b5739d5361 Grammar fixes (#3531) 2018-01-03 14:06:45 +01:00
credifiable e80d9b4696 Updated material-ui-next URI (#3509) 2017-12-28 16:25:11 +01:00
Jerome Fitzgerald 46b57a6eff [refactor] with-apollo-and-redux: 2.0.0 (#3484)
* [refactor] with-apollo-and-redux: 2.0.0

- This ports over `with-apollo` (w/ recent `withRouter` fix and addition
for Post) along with implementing `apollo-cache-redux` #3463
- The `redux` side of things is lacking (it is the *same* as the
original example)
- Created a `routes.js` for use on Server and Client Side (to expand the
PostList functionality)
- SSR is maintained
- Redid the "PostVote" a bit... sorry. 😬️

Possible todo(s):
- Add in API and Clock Examples from `with-redux` to show Apollo and
Redux working together a bit more
- redux-saga (I personally use this, may be too opinionated for the base
example though)

Packages updated:
- apollo-cache-redux
- apollo-client-preset
- graphql
- graphql-anywhere
- graphql-tag
- isomorphic-unfetch
- next-routes
- prop-types
- react
- react-apollo
- react-dom
- redux

* [refactor] fix linting issues

When I run `yarn lint` explicitly these were caught, but not doing a
build proper. Apologies on that!

* [chore] 📦️ package.json: like other examples

* [refactor] +apollo-cache-inmemory, -apollo-cache-redux

Separation of Apollo and Redux. 😄️
We could stand to use a few actual examples of Redux, though this is a
good starting block.
Some other code cleanup as well.
2017-12-27 19:57:57 +01:00
Sergio Xalambrí ffdf4e3228 Add with-data-prefetch example (#3420)
* Add with-data-prefetch example

* Fix typos

* Improve example code
2017-12-26 21:46:46 +01:00
Ricardo Pierre-Louis f2989c5739 Examples/with reflux (#3476)
* Update withData.js (#3458)

#3234

* Begun with-reflux example

* Built with-reflux example

* Built with-reflux example
2017-12-19 10:33:01 +01:00
Brice BERNARD 5bb710a0d2 [with-jest] Upgrade to jest 22 and so remove raf deps (#3477) 2017-12-19 10:29:29 +01:00
Petr Huřťák 9bc681bea1 Fix glamorous example (#3462)
It used old version 1 and when I run npm run dev it returned 500.
Once I updated to 4, everything works as expected.
2017-12-18 11:28:57 +01:00
Abdulhalim Kara 69aa647535 Update withData.js (#3458)
#3234
2017-12-18 11:27:16 +01:00
Brice BERNARD 35ffad968c [with-apollo] Fix missing rootContext (#3468) 2017-12-18 11:25:06 +01:00
Sergio Xalambrí 5040de3b3f Fix SVG component example dependencies (#3448) 2017-12-13 01:44:11 -08:00
Bertrand Marron c8d2da68cf Use "preset-env" option to configure env preset in with-jest example (#3424) 2017-12-08 20:01:05 -08:00
Thierry Charbonnel 4cab5228a0 Github gh-pages Example (#3383)
* gh-page-exemple

* add babelrc for gh-page exemple

* Fix example (exemple in fr)

* example fix typo

* lint fix
2017-12-08 18:17:04 -08:00
Tim Neutkens 51f120ec70 Add markdown-in-js example (#3410) 2017-12-06 18:20:38 -08:00
Tim Neutkens 24c1ac6ca9
Use canary for all example downloads (#3411) 2017-12-06 18:12:42 -08:00
Tim Neutkens b64365b550 Add markdown-in-js example (#3410) 2017-12-06 16:59:32 -08:00
Thomas Greco 278f58b54b pushing updated emotion example (#3344)
* pushing updated emotion example

* Fix linting
2017-12-05 16:46:06 -08:00
Brice BERNARD 48ed89f93d [with-apollo] Fix warning about missing _allPostsMeta and more (#3397)
* Fix coding style

* Fix className type

* Upgrade deps

* Fix coding style of lib/

* Simplify onSubmit handler

* Fix missing missing _allPostsMeta warning

* Follow lint rules
2017-12-05 10:50:45 -08:00
Brice BERNARD 25005d158b [with-jest] Fix tests (#3395)
* Fix tests

* Follow linting rules
2017-12-05 10:43:30 -08:00
Tibor Vukovic e8f39ad74c Update hapi example to support hapi@17 (#3357) 2017-12-05 10:42:57 -08:00
Arunoda Susiripala 820e3ff716
Always load pages with ".js" extension (#3393)
* Always fetch pages with '.js' extention from client side.

* Load error page always from _error.js rather _error/index.js

* Load pages from page.js instead of page/index.js from the client for static exports.

* Update index.js

* Simplify the path re-write logic in the webpack pages-plugin.
2017-12-05 04:49:53 +05:30
Giuseppe 5daafa4f87 Upgrade styled-jsx to v2.2.1 (#3358)
* Pulled encoding to top of head (#3214)

* Remove next.d.ts to use @types/next (#3297)

* Add with-mobx-state-tree example (#3179)

* Adapt with-mobx example for with-mobx-state-tree

* Remove unnecessary lastUpdate parameter to show off snapshot

* update readme

* make other.js more closely mimic index.js

* Upgrade styled-jsx to v2.2.1

Includes some bug fixes.

* Fix linting
2017-12-04 08:15:30 -08:00
dsantic 3a651971e1 Upgrading with-flow example to the latest flow-bin ver. 0.59.0 (#3337)
For upgrading I used flow-upgrade module by https://yarnpkg.com/en/package/flow-upgrade
2017-12-03 14:58:46 -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
Gregoor 6ad54704da Update relay example dependencies & .gitignore (#3365) 2017-12-02 18:07:42 -08:00
Sergio Xalambrí cd0e13df01 Add example of Nodemon on a custom server (#3374) 2017-12-02 15:44:38 -08:00
Tim Neutkens df4974eac8
Add runtime environment example (#3371) 2017-12-02 18:08:53 +01:00
Sergio Xalambrí 32eb6b7718 Add with Portals example (#3372) 2017-12-02 18:02:22 +01:00
Adrian Li f9c6e12037 Update reason example to version 3 syntax and fix errors (#3347)
* update dependencies

* add bsconfig refmt version

* update to new syntax

* add dependency on concurrently for dev convenience

* fix dev script
2017-11-28 14:15:03 +01:00
Tim Neutkens c9401214db Fix linting 2017-11-25 12:03:25 +01:00
Brian Dombrowski 5ede8c9dc3 More complete with-apollo-and-redux example with dynamic post route (#3223)
* More complete with-apollo-and-redux example with dynamic post route

* Removed commented out code
2017-11-23 14:05:51 +01:00
Lucas Rosa fc335ac36c Add example with tailwind css (#3317)
* Add Tailwind css example

* Fix read me

* Add create-next-app setup to read me
2017-11-23 13:48:34 +01:00
Max Scher f0eacf66ea Add data node to serverState declaration (#3321)
The serverState variable definition did not include the data node, which
may cause parsing errors on the client-side.
  - add data: { } on line 23 within the apollo: { } object
2017-11-23 13:46:33 +01:00
Dan Argue a8c344fa19 Add with-mobx-state-tree example (#3179)
* Adapt with-mobx example for with-mobx-state-tree

* Remove unnecessary lastUpdate parameter to show off snapshot

* update readme

* make other.js more closely mimic index.js
2017-11-23 13:41:59 +01:00
Tage A. L. K c6d9ab7563 with-apollo-auth updated for Apollo 2.0 (#3278)
* Updated for Apollo 2.0

* Updated for commit: ccb188a

* Simplified serverState

Updated with danistefanovic's comment. Looks better.

* Revert "Simplified serverState"

This reverts commit 1b543a35909dcfe401c753cb2f71760180087057.

* Simplified server

Updated with Statedanistefanovic's comment.
2017-11-17 08:23:52 +01:00