Trying to understand how infinite scrolling works in Discourse

Would someone please explain how Discourse does infinite scrolling? It has already been described to me by devs that to disable it is extremely difficult and would take months of danger-prone changes to so, but I’m not asking anyone to do this. I’m just trying to get an understanding of the innards of Discourse so I can craft a plug-in to adjust how infinite scrolling works. Telling those of us trying to figure this out that it’s impossible or nearly so and then ending the conversation is not helpful. Let’s get a dialog going on this.

As you know, it is very complex. More complex than a single topic or even several topics could cover adequately. To start off a discussion, how about starting with what you have figured out so far?

1 Like

The easy (and not advisable) way to disable it is to override the handlebars templates where it exists and leave out the load-more pieces. That would break it in that specific location.

3 Likes

I’ve gathered so far that if Javascript is turned off, then pagination is turned on by something in the server-side code. I intend to identify what code produces that and investigate how to selectively activate it.

1 Like

The files in this folder may be some help
https://github.com/discourse/discourse/tree/master/app/views/topics

2 Likes

I can help here:

See:

Then once you are done with that and have a dev environment up, work through 2-3 or so #starter-task’s , after that submit about 10-20 PRs that are #pr-welcome, once you did all of that, please feel free to post a well framed technical question asking for guidance.

You are asking skyscraper construction level questions, got to start by building your first mud hut.

7 Likes