Closed Vadorequest closed 4 years ago
So these are my thoughts:
reactstrap/bootstrap
, it'd be great to use styled-system and maybe rebass, they're based off atomic and subatomic design systems.What do you think?
Thanks for the feedback, gonna answer point by point:
- I don't think we need to show up getInitialProps, next.js is slowly moving away from it.
β Agreed. Let's avoid those and focus on the new API getStaticProps and getServerSideProps.
- Include fallback and revalidate would be interesting since they're fairly new features.
β Agreed. How would you like to showcase those 2 features?
- I honestly don't like reactstrap/bootstrap, it'd be great to use styled-system and maybe rebass, they're based off atomic and subatomic design systems.
π€ I don't like bootstrap much either, but I'm not sure about changing it at this point. It's still more commonly known and rather easy to use, while SS/Rebass look like they need more boilerplate to get started. They're interesting, and their advanced compatibility with Emotion is great, I'm just not sure if it's better for getting started, kinda worried about added complexity.
- Would be great to breakdown all pages into reusable components.
β Agreed. I believe it's already the case for components that are actually being reused, like products.
- Targeting the project to serverless would be a good optimization.
π€ Isn't it already the case?
- Considering that GraphCMS is so expensive for production, maybe we should consider other options like Strapi with Graphql or something else.
π΄ Not right now, I want to avoid changing everything with this PR/branch. GraphCMS is great for POCs because it's free and managed (no need to self-host), which actually reduces complexity for testing things around. I agree that using something else (like Strapi) is probably what people will do in the end, but it's just a matter of changing the API endpoint (and dealing with BC like i18n content).
For this reason, I intend to keep GraphCMS around, maybe we'll add a Strapi example, as an alternative, at some point. But not now.
Also, I'm strongly considering Airtable as the next API alternative, because it's free and isn't as limited as GCMS, and also it's different (REST-ish API) so it's a good use case, and very very good for POCs (may likely become the default preset/demo).
- Include fallback and revalidate would be interesting since they're fairly new features.
β Agreed. How would you like to showcase those 2 features?
I think we should keep this simple, maybe create a sample fallback page that will be static generated on-demand, maybe something like https://static-tweet.now.sh/
- I honestly don't like reactstrap/bootstrap, it'd be great to use styled-system and maybe rebass, they're based off atomic and subatomic design systems.
π€ I don't like bootstrap much either, but I'm not sure about changing it at this point. It's still more commonly known and rather easy to use, while SS/Rebass look like they need more boilerplate to get started. They're interesting, and their advanced compatibility with Emotion is great, I'm just not sure if it's better for getting started, kinda worried about added complexity. Ok that make sense, the focus here is more next.js rather than best UI/UX pratices.
- Targeting the project to serverless would be a good optimization.
π€ Isn't it already the case?
I meant, the target: "serverless"
on next.js (https://nextjs.org/docs/api-reference/next.config.js/build-target#serverless-target), but I just realized that deployments to Vercel will automatically enable this target, so we're good.
- Considering that GraphCMS is so expensive for production, maybe we should consider other options like Strapi with Graphql or something else.
π΄ Not right now, I want to avoid changing everything with this PR/branch. GraphCMS is great for POCs because it's free and managed (no need to self-host), which actually reduces complexity for testing things around. I agree that using something else (like Strapi) is probably what people will do in the end, but it's just a matter of changing the API endpoint (and dealing with BC like i18n content).
For this reason, I intend to keep GraphCMS around, maybe we'll add a Strapi example, as an alternative, at some point. But not now.
Also, I'm strongly considering Airtable as the next API alternative, because it's free and isn't as limited as GCMS, and also it's different (REST-ish API) so it's a good use case, and very very good for POCs (may likely become the default preset/demo).
Ok, that make sense, once again, that's not the main goal here.
Also I think it would be great to mesure performance to show up how good this setup is in terms of performance, accessibility, best practices and SEO.
This is the current score the demo has on lighthouse:
I think we should keep this simple, maybe create a sample fallback page that will be static generated on-demand, maybe something like static-tweet.now.sh
Good idea. Re-implementing their Twitter example is possible.
I meant, the
target: "serverless"
on next.js (nextjs.org/docs/api-reference/next.config.js/build-target#serverless-target), but I just realized that deployments to Vercel will automatically enable this target, so we're good.
I hadn't noticed that. They say we shouldn't opt-in if we use Vercel, so keeping it as it is probably good enough. But I'd like to make it obvious, so I'll add a comment about it for transparency.
Also I think it would be great to mesure performance to show up how good this setup is in terms of performance, accessibility, best practices and SEO.
Great suggestion. I've just gone through https://nextjs.org/blog/next-9-4#integrated-web-vitals-reporting and I believe we could implement it very easily with the built-in Amplitude analytics. Does that sound good?
It'll allow to track performances for each rendering, I'll take a deeper look and add it to to-do things.
Great suggestion. I've just gone through https://nextjs.org/blog/next-9-4#integrated-web-vitals-reporting and I believe we could implement it very easily with the built-in Amplitude analytics. Does that sound good?
Yeah, that sounds great.
I'm excited about this :)
Adding errors to the list:
Should we add the prod rollback if E2E is failing here?
I'll rather open a separate issue
I'm almost done with the Demo rewrite. Latest demo at https://nrn-v1-hyb-mst-aptd-gcms-lcz-sty-c1-g99eujlm6.now.sh
What's coming next is proper examples for SSG/R with their variations (revalidate, fallback)
Example with fallback mode has been implemented, it was a bit harder than I thought so.
Now, a isSSGFallbackInitialBuild
variable is available in all pages as prop, and helps to know if the page was was built during the current "request".
Revalidate demo available at https://nrn-v1-hyb-mst-aptd-gcms-lcz-sty-c1-i6tj62ina.now.sh/fr/examples/native-features/example-with-ssg-and-revalidate
PR is ready and has implemented all requirements, I'll merge.
Status
PR in progress at https://github.com/UnlyEd/next-right-now/pull/52
Context
@jajourda @samuelcastro I'd like to know what you think about the current demo (e.g: https://nrn-v1-hyb-mst-aptd-gcms-lcz-sty-c1-oylx1iihd.now.sh/fr)
I think we should add more example and restructure those examples (UI/UX)
It's mostly visual, but do you have any idea about how to do it better? Would you like to work on it?
Quick list of stuff we should showcase (IMHO):
Use of getInitialProps (SSR+CSR), should we? I prefer the new getSP/getSSP way, cleaner/api/status
Is there anything important we're missing?