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

Lazily load events as they come into view (OFC-5) #326

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

davish
Copy link
Collaborator

@davish davish commented Mar 31, 2023

Loading events into FullCalendar is expensive. See #323 for details on how FullCalendar.addEvent() chokes on a 900-event calendar.

This PR will make use of event-generating functions in FullCalendar to lazily load events to the calendar as they come into view. OFCEventSource, which is returned from getAllEvents(), will have a function that takes in a start and end date and will return all events in the specified calendar that fall within those bounds.

Considerations:

  • only non-recurring events have a real start date. All recurring events will always have to be loaded in to the calendar.

  • Can addEvent() still be used when updating single events around with click and drag?

  • How to use EventSource.refetch() properly to re-draw the calendar? Will there be flickering?

  • Naiive implementation of getEventsWithinBounds() on EventStore that just filters the events in the list.

  • Unit tests for getEventsWithinBounds().

  • Plumb event-generating functions that query the EventStore through the EventCache and view.ts. At this point the change should be fully functional, can do some testing to see if it makes Obsidian Unresponsive While Full Calendar Fetches Remote Calendars (Such as Google Calendar) #323 any better.

  • Efficient implementation of getEventsWithinBounds() with btree-typescript. Create a btree whose key is CalendarId-StartDate-EventId and whose value is EventId. Can then query for all entries in between [calendar-start, calendar-endplusone) to get all the matching events.

@davish davish mentioned this pull request Apr 2, 2023
7 tasks
@davish davish changed the title Lazily load events as they come into view Lazily load events as they come into view (OFC-5) Apr 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant