[likes] reduce performance impact, add count and recent likes
Fixes #0000
Changes proposed in this pull request:
This PR supposedly adds two new values by default to each post whenever Likes is enabled. A count of likes and the most recent likes.
I ran into an issue with the count, but before I spend much more time on this let's figure out whether we want this at all.
(I know dist needs to be removed :) )
Reviewers should focus on:
Screenshot
Necessity
- [ ] Has the problem that is being solved here been clearly explained?
- [ ] If applicable, have various options for solving this problem been considered?
- [ ] For core PRs, does this need to be in core, or could it be in an extension?
- [ ] Are we willing to maintain this for years / potentially forever?
Confirmed
- [ ] Frontend changes: tested on a local Flarum installation.
- [ ] Backend changes: tests are green (run
composer test). - [ ] Core developer confirmed locally this works as intended.
- [ ] Tests have been added, or are not appropriate here.
Required changes:
- [ ] Related documentation PR: (Remove if irrelevant)
- [ ] Related core extension PRs: (Remove if irrelevant)
I know it's still a work in progress, but just reading through the code I notice the isLiked part in addLikeAction is not updated with new code yet.
Yeah. We still need to decide whether we want this and if we do, finish it.
Superseded by https://github.com/flarum/framework/pull/3781