diff --git a/Readme.md b/Readme.md index f72febca..0c010704 100644 --- a/Readme.md +++ b/Readme.md @@ -193,12 +193,165 @@ Note: we recommend putting `.next` in `.npmignore` or `.gitigore`. Otherwise, us ## FAQ -The following tasks are planned and part of our roadmap +
+ Is this production ready? + Next.js has been powering `https://zeit.co` since its inception. + + We’re ecstatic about both the developer experience and end-user performance, so we decided to share it with the community. +
-- [ ] Add option to supply a `req`, `res` handling function for custom routing -- [ ] Add option to extend or replace custom babel configuration -- [ ] Add option to extend or replace custom webpack configuration -- [ ] Investigate pluggable component-oriented rendering backends (Inferno, Preact, etc) +
+ How big is it? + +The client side next bundle, which includes React and Glamor is **${X}kb** gzipped. + +The Next runtime (lazy loading, routing, ``) contributes **${Y}%** to the size of that bundle. + +The codebase is ~1500LOC (excluding CLI programs). + +
+ +
+ Is this like `create-react-app`? + +Yes and No. + +Yes in that both make your life easier. + +No in that it enforces a _structure_ so that we can do more advanced things like: + - Server side rendering + - Automatic code splitting + +In addition, Next.js provides two built-in features that are critical for every single website: + - Routing with lazy component loading: `` (by importing `next/link`) + - A way for components to alter ``: `` (by importing `next/head`) + +Next is not suitable right now for creating reusable components that every single React app can use. But we consider that a feature, since your re-usable components should live in separate repositories and then `import`ed. + +In the future, we might consider a `next export` feature that produces a re-usable build of a component, to take advantage of Glamor and our simple and easy-to-use build system. + +
+ +
+ Why CSS-in-JS? + +`next/css` is powered by [Glamor](https://github.com/threepointone/glamor). While it exposes a JavaScript API, it produces regular CSS and therefore important features like `:hover`, animations, media queries all work. + +There’s *no tradeoff* in power. Instead, we gain the power of simpler composition and usage of JavaScript expressions. + +*Compiling* regular CSS files would be counter-productive to some of our goals. Some of these are listed below. + +In the future, however, we _might_ be able to take advantage of custom elements / shadow DOM to also support the full CSS syntax once browser support is wide enough. + + +### Compilation performance + +Parsing, prefixing, modularizing and hot-code-reloading CSS can be avoided by just using JavaScript. + +This results in better compilation performance and less memory usage, specially for large projects. No `cssom`, `postcss`, `cssnext` or transformation plugins. + +It also means fewer dependencies and fewer things for Next to do. Everything is Just JavaScript® (since JSX is completely optional) + +### Lifecycle performance + +Since every class name is invoked with the `css()` helper, Next.js can intelligently add or remove `