community-content icon indicating copy to clipboard operation
community-content copied to clipboard

[SUBMIT] How to implement infinite scrolling when using Strapi in React

Open Tammibriggs opened this issue 2 years ago • 25 comments

My resource

In this article, I will show how to implement infinite scrolling which is one of the patterns used to handle performance issues that may arise when working with large data sets.

Outline:

  • What is infinite scrolling
  • Cloning the stater Strapi app
    • Brief overview of our stater app
  • Implementing infinite scrolling
    • Observing scroll position for appending to existing data
    • Create functionality to fetch new data based on scroll position
    • Stop fetching when all data has been fetched
  • Conclusion

My content is

  • [x] A Strapi Tutorial / Guide / How to article
  • [ ] About Headless, CMS, javascript, open source, or jamstack
  • [ ] Other, specify

What do you all think? ❤️ I love it! 🚀 I can help you!

Thank you for submitting your article proposal.

Tammibriggs avatar May 26 '22 06:05 Tammibriggs

Hello @Tammibriggs can you please expand more on your outline before we approve this tutorial?

What app will you build? what tech stack will you use? we already have some tutorials covering this topic such as this: https://www.youtube.com/watch?v=VHf2EM38Ikg

I would like to have an article published on the blog about this topic but it has to be within a certain use case and also should include using one of our plugins published on our market place here: https://market.strapi.io

ShadaW11 avatar May 30 '22 11:05 ShadaW11

Hi @ShadaW11, thanks for your reply.

I will update the pitch and send it to you ASAP.

Tammibriggs avatar May 30 '22 12:05 Tammibriggs

Hi @ShadaW11, I have updated the outline based on your suggestions.

Here is the updated outline:

  • Setting up a Strapi Project
    • Creating the Collection Types
  • Building a Book app
    • Brief overview of our app
    • Adding book data to Strapi
    • Integrating Meilisearch for searching books
    • Implementing infinite scrolling with intersection observer
      • Observing scroll position for appending to existing data
      • Create functionality to fetch new data based
  • Conclusion

Tammibriggs avatar May 30 '22 17:05 Tammibriggs

Hello @Tammibriggs thank you for updating the outline. Can you please let me know what tech stack you will be using? also can you add additional plugins? here's a sample of a detailed outline:

1- Goal

In this tutorial, we will look at how we....

Outline

The need for headless CMS Why use strapi? How it all works setting up the Nuxt frontend Configuring Nuxt to work with Apollo Client Creating a Strapi Collection Type Install the Strapi GraphQL Plugin Using the GraphQL Playground Adding a query to our Nuxt client Rendering Strapi data in the Nuxt client Resources

Github code Resources Conclusion

2- Hi, I will like a create a new tutorial about....

Outline

Introduction Prerequisites Backend Setup Strapi Setup Cloudinary installation and set up Creating Photos collection type Allowing Access to the backend Frontend Setup 11ty and Tailwind CSS Setup Connect Strapi backend to 11ty frontend Creating 11ty file structure Creating Website's layout Importing and displaying data from Strapi Conclusion

ShadaW11 avatar May 31 '22 10:05 ShadaW11

Can you please update and expand your outline based on the above feedback. Thank you

ShadaW11 avatar May 31 '22 10:05 ShadaW11

Hi @ShadaW11, here is the updated outline using the above samples.

Topic: Build a book app with infinite scrolling and Meilisearch Strapi Plugin in React

Goal In this tutorial, we will be building a book app using Strapi. The app will focus on how to fetch and render data in chunks with infinite scrolling and how to integrate and use meilisearch plugin to search for data.

Outline

  • Introduction
  • Prerequisite
  • Setting up a Strapi Project
    • Creating the Collection Types
  • Building a Book app
    • Brief overview of our app
    • Adding book data to Strapi
    • Integrating Meilisearch for searching books
    • Implementing infinite scrolling with intersection observer
      • Observing scroll position for appending to existing data
      • Create functionality to fetch new data
  • Conclusion

What do you think?

Tammibriggs avatar May 31 '22 12:05 Tammibriggs

Hi @ShadaW11,

I haven't heard from you concerning the updated outline above.

Is it ok now?

Tammibriggs avatar Jun 02 '22 09:06 Tammibriggs

Hello @Tammibriggs sounds great, please gp ahead and start working on it.

ShadaW11 avatar Jun 02 '22 11:06 ShadaW11

Hi @ShadaW11,

I am done with the article. Here is the link to it on DropBox: https://www.dropbox.com/scl/fi/w8s31b8f79o9k57w6leg6/Build-a-book-app-with-infinite-scrolling-and-Meilisearch-Strapi-Plugin-in-React.paper?dl=0&rlkey=iuhiksa0xodbryvke9d6cfofc

Tammibriggs avatar Jun 09 '22 08:06 Tammibriggs

@Tammibriggs not sure if anyone has responded yet in terms of reviewing your article. I am going to be taking over for what Shada used to do here. I am fairly new so still learning the ropes around the process.

PaulBratslavsky avatar Jun 20 '22 20:06 PaulBratslavsky

Hi @PaulBratslavsky,

No one has answered me yet.

Tammibriggs avatar Jun 20 '22 20:06 Tammibriggs

I will review your article, as well as the steps that I need to take, and will get back to you.

PaulBratslavsky avatar Jun 21 '22 01:06 PaulBratslavsky

@PaulBratslavsky,

Any update on the review of the article.

Tammibriggs avatar Jun 28 '22 10:06 Tammibriggs

@Tammibriggs, thanks for your patience. There are no updates yet, but you'll get them soon. Your article will be reviewed and published. Thanks.

TiaraOluwanimi avatar Jul 04 '22 08:07 TiaraOluwanimi

Hello @Tammibriggs 👋 Just wanted to let you know that your article will be published the second week of August so you can proceed to submit your invoice and get your payment.

dessireugarte avatar Jul 29 '22 15:07 dessireugarte

@dessireugarte Please where should I submit my invoice?

Tammibriggs avatar Aug 05 '22 06:08 Tammibriggs

Hello @Tammibriggs 👋 Your article is live! 🎉 Please register to our forum by clicking on the discussion at the bottom of your post, so you automatically receive notifications when someone adds comments. Also please follow the guidelines to issue and submit an invoice. Now you can submit your invoice here, and soon you will receive your payment. Please feel free to reach out to me if you have any questions!

dessireugarte avatar Aug 08 '22 08:08 dessireugarte

Hello @Tammibriggs 👋

We just got contacted by Meilisearch and they are very pleased about the article you wrote. They are willing to promote on their side, but they shared these comments:

  1. the article is showing v0.27.2 of Meilisearch, which is an old one as we're now they are at v0.28.1
  2. there is no search-as-you-type
  3. They noticed a few missing imports that prevent the code from working

Could you take a look at these changes? cc @malgamves @TiaraOluwanimi

dessireugarte avatar Aug 10 '22 07:08 dessireugarte

Hi @dessireugarte,

Let me look into this and give you feedback.

Tammibriggs avatar Aug 11 '22 07:08 Tammibriggs

Hi @dessireugarte @malgamves @TiaraOluwanimi,

I have confirmed that with the upgrade of Meiliserach to v0.28.1 breaking changes have been introduced and indeed there is a missing import in the article that prevents the code from working. So how should I proceed to fix this?

Also, I don't get what you mean by there is no search-as-you-type. Is it that you want me to include that functionality?

Tammibriggs avatar Aug 12 '22 08:08 Tammibriggs

Hi @dessireugarte @malgamves @TiaraOluwanimi,

I have confirmed that with the upgrade of Meiliserach to v0.28.1 breaking changes have been introduced and indeed there is a missing import in the article that prevents the code from working. So how should I proceed to fix this?

Also, I don't get what you mean by there is no search-as-you-type. Is it that you want me to include that functionality?

Could you make the relevant changes to the original Dropbox Paper doc you used to write the first version of the article and then tag @TiaraOluwanimi when done?

Also, yes you would have to implement that functionality. Let us know if you have any other questions

malgamves avatar Aug 16 '22 08:08 malgamves

Hi @TiaraOluwanimi,

I am done making the suggested changes to the article on Dropbox.

Tammibriggs avatar Aug 24 '22 07:08 Tammibriggs

Hi @dessireugarte, it's been over 3 weeks I sent my invoice but I haven't gotten paid.

Tammibriggs avatar Aug 29 '22 09:08 Tammibriggs

hey @Tammibriggs we had a lot of our team on summer holiday thus the delay. We've put this through. Could you ping in a week if the status doesn't change?

malgamves avatar Aug 31 '22 12:08 malgamves

Hi @malgamves It's been more than a week now but I haven't still received it.

Tammibriggs avatar Sep 07 '22 09:09 Tammibriggs

hey @Tammibriggs please confirm that this is sorted now?

malgamves avatar Oct 17 '22 16:10 malgamves

Yes, it has been sorted. Sorry for not telling you earlier.

Tammibriggs avatar Oct 17 '22 21:10 Tammibriggs