Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use pagination so huge relationships lists doesn't kill the server #28

Open
d8vjork opened this issue May 22, 2024 · 3 comments
Open

Use pagination so huge relationships lists doesn't kill the server #28

d8vjork opened this issue May 22, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@d8vjork
Copy link

d8vjork commented May 22, 2024

What happened?

The timeline is loaded as a whole while it should limit the result by the number of entries or let the developer decide

How to reproduce the bug

Have a model with a another related having 1000 entries or more (it loads fast, but should be loaded by chunks aka paginated)

Package Version

1.2.7

PHP Version

8.3.2

Laravel Version

10

Which operating systems does with happen with?

No response

Notes

No response

@d8vjork d8vjork added the bug Something isn't working label May 22, 2024
@SujalRatnaTamrakar
Copy link
Contributor

Hello, I've added pagination in my fork. I feel like it isn't clean enough. If anybody wants is up for cleaning and creating a PR. Please feel free to do it.

@199ocero
Copy link
Owner

Hello @SujalRatnaTamrakar you can PR it to this repo if you want.

@d8vjork
Copy link
Author

d8vjork commented May 31, 2024

@SujalRatnaTamrakar That looks promising, I would suggest using a cursorPaginator as the UI of this package is more driven to an infinite loading but based on clicking that "Load more"

Also cursorPaginate() is better performance-wise

https://github.com/SujalRatnaTamrakar/activity-timeline/blob/a6250661f9d204ca4ca6181acc617ef443f6b281/src/Concerns/HasSetting.php#L119

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants