{title}
19 |{description}
21 |├── .DS_Store ├── .gitignore ├── .vscode └── settings.json ├── README.md ├── TODO.md ├── assets ├── init.css └── ssense.css ├── components ├── core │ ├── Head.js │ ├── Image.js │ ├── Image.module.css │ ├── Layout.js │ ├── Layout.module.css │ ├── MainNav.js │ └── MainNav.module.css ├── examples │ ├── common │ │ ├── Banner.js │ │ ├── Feed.js │ │ ├── Footer.js │ │ ├── Header.js │ │ ├── Header.module.css │ │ ├── Item.js │ │ └── Stats.js │ ├── i18n │ │ └── locales │ │ │ ├── en.json │ │ │ └── es.json │ └── trr │ │ ├── Banner.js │ │ ├── Footer.js │ │ ├── Header.js │ │ └── Main.js └── real │ ├── ArticleWidget.js │ ├── ArticleWidget.module.css │ ├── ArticleWidgetRow.js │ ├── ArticleWidgetRow.module.css │ ├── BlogWidget.js │ ├── BlogWidget.module.css │ ├── CTA.js │ ├── CTA.module.css │ ├── Container.js │ ├── Container.module.css │ ├── Footer.js │ ├── Footer.module.css │ ├── Header.js │ ├── Header.module.css │ ├── MainContainer.js │ ├── MainContainer.module.css │ ├── MainReadWidget.js │ ├── MainReadWidget.module.css │ ├── ReadWidget.js │ ├── ReadWidget.module.css │ ├── ReadWidgetRow.js │ ├── ReadWidgetRow.module.css │ ├── ShopWidget.js │ └── ShopWidget.module.css ├── helpers └── uuid.js ├── jsconfig.json ├── lib ├── bc.js └── cart.js ├── package-lock.json ├── package.json ├── pages ├── _app.js ├── _document.js ├── concepts │ ├── isr.js │ ├── item │ │ └── [slug].js │ ├── ssg.js │ └── ssr.js ├── examples │ ├── common.js │ ├── real.js │ └── skeleton.js ├── index.js └── real │ └── store-0 │ └── index.js ├── postcss.config.json ├── prismic-configuration.js ├── public ├── favicon.ico └── favicon.png ├── tailwind.config.js └── vercel.json /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/okbel/next-store/c53f6265280bde97c134a9273b3ab5a9742fbee1/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | .vercel 4 | .env 5 | .next -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "git.ignoreLimitWarning": true 3 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # next-store 2 | 3 | A proof of concept using a NextJS seed ready to be deployed with Vercel. 4 | 5 | [](https://vercel.com/import/git?c=1&s=https://github.com/okbel/next-store) 6 | 7 | ### Features 8 | 9 | - Lazy Image Loading x2 10 | - CSS Purged 11 | - Green on Lighthouse 12 | 13 |  14 | 15 | ### Tech Stack 16 | 17 | - Nextjs 18 | - PurgeCSS 19 | - TailwindCSS 20 | - PostCSS 21 | - Allows nesting and imports. 22 | 23 | ## Up and Running 24 | 25 | - Develop running `npm run dev` - [http://localhost:3000](http://localhost:3000) 26 | 27 | - Build `npm run build` 28 | 29 | - Deploy `vercel --prod` 30 | 31 | ## Demo 32 | 33 | [https://next-store-pi.vercel.app](https://next-store-pi.vercel.app) 34 | 35 | ## Data Fetching 36 | 37 | Using SWR: 38 | 39 | ```js 40 | import useSWR from "swr"; 41 | 42 | function Profile() { 43 | const { data, error } = useSWR("/api/user", fetcher); 44 | 45 | if (error) return
18 | A proof of concept using a NextJS seed ready to be 19 | deployed with Vercel. 20 |
21 | {showGoBack && ( 22 | 23 | Go back 24 | 25 | )} 26 |6 | We announced a new product! 7 | 8 | Earn up to $500 in Site Credit!* Limited Time 9 | 10 | 11 | 12 | See Details → 13 | 14 | 15 |
16 |141 | The latest news, articles, and resources, sent to your inbox 142 | weekly. 143 |
144 | 158 |210 | © 2020 MyStore, Inc. All rights reserved. 211 |
212 |15 | 16 | Jewelry 17 | 18 |
19 | 20 |{desc}
24 | 25 |142 | The latest news, articles, and resources, sent to your inbox 143 | weekly. 144 |
145 | 159 |218 | Honoring heritage brands and extending the lifecycle of luxury items. 219 |
220 | The RealReal, Inc. 221 |224 | All items are pre-owned and consigned to The RealReal. Trademarks are 225 | owned by their respective brand owners. No brand owner endorses or 226 | sponsors this ad or has any association and/or affiliation with The 227 | RealReal. 228 |
229 |{description}
21 |{description}
19 |19 | {category} | {date} 20 |
21 |{category}
18 |{category}
18 |18 | Big and complex systems with many web pages encounter the issue of 19 | having to re-build an entire app for each deploy. Systems like this 20 | usually deal with this issue by using{" "} 21 | server side rendering and a caching layer (e.g Varnish) 22 |
23 |24 | Rendering and building a page by request is not a solution. 25 | Neither is building the entire app everything at once. That's why we 26 | came up with Incremental Static Generation. 27 |
28 | This is useful for: 29 |Features that we are planning
70 |This page has been Incrementally built.
7 |18 | This content is: {data} 19 |20 |
24 | By default, Next.js pre-renders every page. This 25 | means that Next.js generates HTML for each page in advance, instead of 26 | having it all done by client-side JavaScript. 27 |
28 |Pre-rendering can result in better performance and SEO.
29 |30 | Each generated HTML is associated with minimal JavaScript code 31 | necessary for that page. When a page is loaded by the browser, its 32 | JavaScript code runs and makes the page fully interactive. This 33 | process is called hydration. 34 |
35 |36 | Next.js has two forms of pre-rendering:{" "} 37 | Static Generation and 38 | Server-side Rendering. The difference is in{" "} 39 | when it generates the HTML for a page. 40 |
41 |42 | Read more about this topic:{" "} 43 |
65 | We recommend using Static Generation over Server-side Rendering for 66 | performance reasons. Statically generated pages can be cached by CDN 67 | with no extra configuration to boost performance. However, in some 68 | cases, Server-side Rendering might be the only option. 69 |
70 |71 | You can also use Client-side Rendering along with 72 | Static Generation. 73 |
74 |22 | This content is: {data} 23 |24 |
28 | By default, Next.js pre-renders every page. This 29 | means that Next.js generates HTML for each page in advance, instead of 30 | having it all done by client-side JavaScript. 31 |
32 |Pre-rendering can result in better performance and SEO.
33 |34 | Each generated HTML is associated with minimal JavaScript code 35 | necessary for that page. When a page is loaded by the browser, its 36 | JavaScript code runs and makes the page fully interactive. This 37 | process is called hydration. 38 |
39 |40 | Next.js has two forms of pre-rendering:{" "} 41 | Static Generation and 42 | Server-side Rendering. The difference is in{" "} 43 | when it generates the HTML for a page. 44 |
45 |46 | Read more about this topic:{" "} 47 |
69 | Next.js pre-renders a page on each request. It will be slower because 70 | the page cannot be cached by a CDN, but the pre-rendered page will 71 | always be up-to-date. 72 |
73 |74 | The HTML is generated on each request. Therefore, by adding latency to 75 | the request{" "} 76 | 77 | Server-side Rendering results in slower performance than Static 78 | Generation. 79 | 80 |
81 |