Automattic / jetpack

Security, performance, marketing, and design tools — Jetpack is made by WordPress experts to make WP sites safer and faster, and help you grow your traffic.
https://jetpack.com/
Other
1.59k stars 799 forks source link

Add more Infinite Scroll jQuery events #1497

Open ste93cry opened 9 years ago

ste93cry commented 9 years ago

Following request @georgestephanis in issue #1488, I'm opening this ticket to request the post-load event in the Infinite Scroll jQuery plugin to be namespaced. It would be useful to add also some more extension points, for example a pre-load event or something that allows the editing of the query_args from client side before sending the AJAX request. As event data it would be useful to have access to the Scroller instance, to edit it's internal variables if needed (like the page number).

georgestephanis commented 9 years ago

Anyone know if we have third party integrations to the existing event already that namespacing would break?

jeherve commented 9 years ago

We've advertised post-load on the support page since the beginning, so there might indeed be quite a few people using it in personal projects out there: http://jetpack.me/support/infinite-scroll/#js-events

ste93cry commented 9 years ago

For fallback support, you could mark as deprecated that event and trigger it twice, one time as before and another time under the appropriate namespace that new events should use too. Then, in a major new version you remove the old trigger. This means that the plugin won't break immediatly the compatibility and users will have time to upgrade their scripts in order to use the new feature

georgestephanis commented 9 years ago

I really don't like the idea of breaking backward compatibility without actual cause (not just 'best practices' but the current pattern actually breaking things sufficiently to justify breaking other things while fixing it)

ste93cry commented 9 years ago

This is why I suggested to trigger the event twice, before the deprecated event is removed in a major new version.

stale[bot] commented 6 years ago

This issue has been marked as stale. This happened because:

No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation.

github-actions[bot] commented 3 years ago

This issue has been marked as stale. This happened because:

No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation.