From d5c815e52fa4aeb96ec0bf750e4d4417c8294b9d Mon Sep 17 00:00:00 2001 From: Hassan El Mghari Date: Sat, 12 Feb 2022 16:24:33 -0500 Subject: [PATCH] Update frequently asked questions in documentation (#34252) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a rewrite of the FAQ section as it's quite outdated. Thank you to @styfle and @leerob for the suggestions. **Here's a list of changes I've made:** - Removed “How big is it” - Removed “What syntactic features are compiled? How do I change them?” - Replaced all occurances of "it" with "Next.js" - Changed "Is Next.js production ready?" to mention showcase - Started the answer to each question with either yes or no for yes/no questions - Listed more pros for router section, changed question name, and backlined to migrating from react router docs - Revamped "fetching data" answer to list all our data fetching methods and backlink to docs - Made "Can I use Next.js with my favorite JavaScript library?" more clear and emphasized the large number of examples we have - Reorganized questions to make more sense - Made wording more consistent throughout **Additional Questions:** 1. Do we want to keep the "What inspired Next.js" section the same? One option could be to only keep the first sentence linking to G's article and not talk about PHP because of its reputation among newer web developers as an old & outdated technology. 2. What's the advantage of routes always being lazy-loadable? I'd like to add this to the last bullet point of the new router question to make it obvious what the benefit is. Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com> --- docs/faq.md | 68 +++++++++++++++++++++++++---------------------------- 1 file changed, 32 insertions(+), 36 deletions(-) diff --git a/docs/faq.md b/docs/faq.md index 96025209501f5..cd97832dfbcf5 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -5,65 +5,66 @@ description: Get to know more about Next.js with the frequently asked questions. # Frequently Asked Questions
- Is this production ready? -

Next.js has been powering https://vercel.com  since its inception.

- -

We’re ecstatic about both the developer experience and end-user performance, so we decided to share it with the community.

+ Is Next.js production ready? +

Yes! Next.js is used by many of the top websites in the world. See the + Showcase for more info.

- How big is it? -

The client side bundle size should be measured in a per-app basis. A small Next main bundle is around 65kb gzipped.

-
- -
- How can I change the internal webpack configs? -

Next.js tries its best to remove the overhead of webpack configurations, but for advanced cases where more control is needed, refer to the custom webpack config documentation.

-
- -
- What syntactic features are compiled? How do I change them? -

We track V8. Since V8 has wide support for ES6 and async and await, we compile those. Since V8 doesn’t support class decorators, we don’t compile those.

- -

See the documentation about customizing babel config for more information.

+ How do I fetch data in Next.js? + Next.js provides a variety of methods depending on your use case. You can use: + + To learn more about data fetching, visit our data fetching documentation.
- Why a new Router? - Next.js is special in that: + Why does Next.js have its own Router? + Next.js includes a built-in router for a few reasons: + If you're migrating from React Router, see the migration documentation.
- How do I fetch data? -

It's up to you. You can use the fetch API or SWR inside your React components for remote data fetching; or use our data fetching methods for initial data population.

+ Can I use Next.js with my favorite JavaScript library? +

Yes! We have hundreds of examples in our examples directory.

- Can I use it with GraphQL? -

Yes! Here's an example with Apollo.

+ Can I use Next.js with GraphQL? +

Yes! Here's an example with Apollo and an example API Route with GraphQL.

- Can I use it with Redux? -

Yes! Here's an example. And there's another example with thunk.

+ Can I use Next.js with Redux? +

Yes! Here's an example with Redux and an example with thunk.

+
+ +
+ Can I make a Next.js Progressive Web App (PWA)? +

Yes! Here's our Next.js PWA Example.

Can I use a CDN for static assets? -

Yes. You can read more about it here.

+

Yes! When you deploy your Next.js application to Vercel, your static assets are automatically detected and served by the Edge Network. If you self-host Next.js, you can learn how to manually configure the asset prefix here.

- Can I use Next with my favorite JavaScript library or toolkit? -

Since our first release we've had many example contributions. You can check them out in the examples directory.

+ How can I change the internal webpack config? +

In most cases, no manual webpack configuration is necessary since Next.js automatically configures webpack. For advanced cases where more control is needed, refer to the custom webpack config documentation.

- What is this inspired by? + What is Next.js inspired by?

Many of the goals we set out to accomplish were the ones listed in The 7 principles of Rich Web Applications by Guillermo Rauch.

The ease-of-use of PHP is a great inspiration. We feel Next.js is a suitable replacement for many scenarios where you would otherwise use PHP to output HTML.

@@ -72,8 +73,3 @@ description: Get to know more about Next.js with the frequently asked questions.

As we were researching options for server-rendering React that didn’t involve a large number of steps, we came across react-page (now deprecated), a similar approach to Next.js by the creator of React Jordan Walke.

- -
- Can I make a Next.js Progressive Web App (PWA)? -

Yes! Check out our PWA Example to see how it works.

-