Next.js,应用实例

Next.js是一个新的通用JavaScript框架,它为基于React和服务器的Web应用提供了一个新的可选方案。

Next.js目前已经开源,https://zeit.co/blog/next

  • Hello World
    源码:https://github.com/zeit/next.js/tree/master/examples/hello-world

这个例子展示了Next.js最基本的想法。我们有两个页面: pages/index.js 和 pages/about.js。前者对 / 请求作出响应,后者则对 /about。使用 next/link可以在它们之间添加超链接和通用路由功能。

  • Basic CSS
    源码:https://github.com/zeit/next.js/tree/master/examples/basic-css

  • Custom Server
    源码:https://github.com/zeit/next.js/tree/master/examples/custom-server

  • Custom Server(Express)
    源码:https://github.com/zeit/next.js/tree/master/examples/custom-server-express

  • Custom Server(Koa)
    源码:https://github.com/zeit/next.js/tree/master/examples/custom-server-koa

  • Custom Server(Hapi)
    源码:https://github.com/zeit/next.js/tree/master/examples/custom-server-hapi

  • Data Fetching
    源码:https://github.com/zeit/next.js/tree/master/examples/data-fetch

  • Head Elements
    源码:https://github.com/zeit/next.js/tree/master/examples/head-elements

  • Layout Component
    源码:https://github.com/zeit/next.js/tree/master/examples/layout-component

  • Nested Components
    源码:https://github.com/zeit/next.js/tree/master/examples/nested-components

  • Parameterized Routing
    源码:https://github.com/zeit/next.js/tree/master/examples/parameterized-routing

  • Progressive Render
    源码:https://github.com/zeit/next.js/tree/master/examples/progressive-render

  • Shared Modules
    源码:https://github.com/zeit/next.js/tree/master/examples/shared-modules

  • SSR Caching
    源码:https://github.com/zeit/next.js/tree/master/examples/ssr-caching

  • SVG Components
    源码:https://github.com/zeit/next.js/tree/master/examples/svg-components

  • Infermo Renderer
    源码:https://github.com/zeit/next.js/tree/master/examples/using-inferno

  • Preact Renderer
    源码:https://github.com/zeit/next.js/tree/master/examples/using-preact

  • Custom Routing
    源码:https://github.com/zeit/next.js/tree/master/examples/using-router

  • AMP
    源码:https://github.com/zeit/next.js/tree/master/examples/with-amp

  • Apollo
    源码:https://github.com/zeit/next.js/tree/master/examples/with-apollo

  • Sustom Babel config
    源码:https://github.com/zeit/next.js/tree/master/examples/with-custom-babel-config

  • Flow
    源码:https://github.com/zeit/next.js/tree/master/examples/with-flow

  • TypeScript
    源码:https://github.com/zeit/next.js/tree/master/examples/with-typescript

  • Aphrodite
    源码:https://github.com/zeit/next.js/tree/master/examples/with-aphrodite

  • CXS
    源码:https://github.com/zeit/next.js/tree/master/examples/with-csx

  • External Scoped CSS
    源码:https://github.com/zeit/next.js/tree/master/examples/with-external-scoped-css

  • Fela
    源码:https://github.com/zeit/next.js/tree/master/examples/with-fela

  • Glamor
    源码:https://github.com/zeit/next.js/tree/master/examples/with-glamor

  • Global Stylesheet
    源码:https://github.com/zeit/next.js/tree/master/examples/with-global-stylesheet

  • Jest
    源码:https://github.com/zeit/next.js/tree/master/examples/with-jest

  • Loading
    源码:https://github.com/zeit/next.js/tree/master/examples/with-loading

  • Mobx
    源码:https://github.com/zeit/next.js/tree/master/examples/with-mobx

  • Next-Routes
    源码:https://github.com/zeit/next.js/tree/master/examples/with-next-routes

  • Prefetching
    源码:https://github.com/zeit/next.js/tree/master/examples/with-prefetching

  • Pretty URL Routing
    源码:https://github.com/zeit/next.js/tree/master/examples/with-pretty-url-routing

  • React Helmet
    源码:https://github.com/zeit/next.js/tree/master/examples/with-react-helmet

  • React Intl
    源码:https://github.com/zeit/next.js/tree/master/examples/with-react-intl

  • React MD
    源码:https://github.com/zeit/next.js/tree/master/examples/with-react-md

  • Redux
    源码:https://github.com/zeit/next.js/tree/master/examples/with-redux

  • Refnux
    源码:https://github.com/zeit/next.js/tree/master/examples/with-refnux

  • Scoped PostCSS
    源码:https://github.com/zeit/next.js/tree/master/examples/with-scoped-stylesheets-and-postcss

  • Shallow Routing
    源码:https://github.com/zeit/next.js/tree/master/examples/with-shallow-routing

  • Styled Compoents
    源码:https://github.com/zeit/next.js/tree/master/examples/with-styled-components

  • Styled-JSF with PostCSS
    源码:https://github.com/zeit/next.js/tree/master/examples/with-styled-jsx-postcss

  • Styled Styleron
    源码:https://github.com/zeit/next.js/tree/master/examples/with-styletron

  • Universal Configuration
    源码:https://github.com/zeit/next.js/tree/master/examples/with-universal-configuration

  • URL Object Routing
    源码:https://github.com/zeit/next.js/tree/master/examples/with-universal-configuration

  • Webpack Bundle Analyzer
    源码:https://github.com/zeit/next.js/tree/master/examples/with-webpack-bundle-analyzer

本文翻译自:https://zeit.co/blog/next2

你可能感兴趣的:(Next.js,应用实例)