Next Right Now Demo
This demo uses the preset What is a preset? - See all presets
It can be used as a boilerplate to get started your own project, or as a learning resource.
General documentation about NRN is available at https://unlyed.github.io/next-right-now/.
The role of this demo is to showcase what's built-in within the selected preset only.
Next.js native features
Make sure to check the official documentation to learn more about it (routing, etc.)
getInitialProps, because even though it is not officially deprecated, it is preferred to use
From experience, it is harder to use
getInitialPropsbecause you have to make your code universal, because it will be executed from the server (SSR) and the browser (CSR), and it usually leads to increased complexity and tougher bugs.
This is the officially recommended way to build apps since then.
We also strongly recommend using SSG, whenever possible.
SSG can only be used using
getStaticProps, NRN provides a
getDefaultStaticProps helper to configure common stuff between all SSG-based pages using the
default layout, and help reduce code duplication.
You should use it if you only want/can pre-generate only part of your static pages at build time, and then build static pages on-demand upon request.
It's very interesting if you've got a ton of pages and want faster builds. This way, you can pre-build only the most used pages of your app, and build other pages on-demand if they ever get requested.
revalidate option (BETA)
revalidate option is strongly related to the Incremental Static Regeneration concept.
Basically, it's the ability to regenerate parts of your apps based on your own business rules.
Currently, it only supports a time-based regeneration (similar to TTL), thus when your page is too old, it gets regenerated.
API-based regeneration (e.g: regenerate pages based on a CMS update) is still being discussed in the RFC.
But, there are special considerations to support TS for testing, code linting, etc.
TS is treated as first-class citizen, we do our best to make the TS experience as smooth and simple as possible.
We use TS a lot, and type everything. You could say NRN comes with an advanced TS usage.
This can be overwhelming for TS beginners, even though you shouldn't have anything to configure by yourself, you'll still need to understand the concepts and be aware of the features we use.
We strongly recommend you to take a look at the React TypeScript Cheatsheets, which is amazing for both beginners and experienced TS users.
New to Next.js?
NRN is meant to help you, but basic Next.js knowledge will be necessary as we don't focus on the basics here but mostly on the difficult/advanced stuff.
Hosting on Vercel vendor
Stages & secrets
SaaS B2B MST
MSTis similar to the
monorepodesign, where the same source code can be used to deploy multiple instances.
UI components library
Markdown as JSX components at runtime
SVG to React
Tracking useless re-renders
You can consider them as "advanced integration examples".
You can edit the
customertheme, play with its primary color to see how the demo is affected depending on the various rendering modes (SSG, SSR, etc.)
You can also edit the products, and play around, as if you were using the Stacker CMS from a customer/editor standpoint!
This is a great feature for SaaS B2B businesses, because each customer can only view/edit their own content, not what belongs to another customer.