Skip to content

Lazy loading of table and iframe panels #2611

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

Merged
merged 3 commits into from
Apr 24, 2025
Merged

Lazy loading of table and iframe panels #2611

merged 3 commits into from
Apr 24, 2025

Conversation

egonw
Copy link
Collaborator

@egonw egonw commented Apr 12, 2025

Fixes #2602

Description

The patch uses the Intersection Observer API. For each panel, it creates a unique observer. When a panel becomes visible, the (unique) handler is called. This is followed by an unobserve to ensure that the SPARQL query is run only once.

Caveats

This browser compability page shows that the Intersection Observer API is widely available, but not on old browsers: https://caniuse.com/intersectionobserver

  • Breaking change (unsupported for old browsers)
  • This change requires a documentation update
    • I have made corresponding changes to the documentation
  • This change requires new dependencies (please list)

Testing

Open up as many pages as possible and see if you see irregularities.

Checklist

  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have not used code from external sources without attribution
  • I have considered accessibility in my implementation
  • There are no remaining debug statements (print, console.log, ...)

@Daniel-Mietchen
Copy link
Member

Daniel-Mietchen commented Apr 12, 2025

This seems to work fine, and the console message comments can probably be removed.

However, I opened a separate ticket for a related issue:

@egonw
Copy link
Collaborator Author

egonw commented Apr 16, 2025

@fnielsen, can you please let me know if this patch is good to go?

@fnielsen fnielsen merged commit fe73fce into main Apr 24, 2025
4 checks passed
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.

Avoid concurrent SPARQL queries while loading a Scholia page
3 participants