Skip to content

Automatically Refresh Front-End for Logged-In Users #10

@kevinfodness

Description

Description

  • Ensure that new liveblog entries are displayed for users where the liveblog is active once per minute.
  • For the purposes of this implementation, “active” liveblogs are defined as a post with a liveblog block where there has been a new liveblog post within the last 6 hours.
  • Ensure that the liveblog entry content is populated using the same templating system that is used on initial load. (This likely means having the REST API for a liveblog post return a custom key that is an array of strings containing HTML for each liveblog entry to display which were rendered by the backend.)
  • Minimize re-render of content where possible, but respond to updates (edited liveblogs should update and deleted liveblogs should delete, not just add new ones). A possible solution here is to have React take over the area that shows the liveblog entries, reading its initial state from the HTML that was put on the page when the page initially loaded, and then polling the REST API for updates every minute and adding/removing/updating items as necessary based on what changed, but without rerendering the entire list. Alternately, if it is more straightforward to use vanilla JS for this, that's also fine.

Use Case

Users who are following the liveblog should be able to see new entries show up automatically on the front end without reloading the page.

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestphpRequires understanding PHPtypescriptRequires understanding TypeScript

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions