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

When serializing nodes for links, only include small subset of data #944

Merged
merged 2 commits into from
Jan 22, 2025

Conversation

ptgolden
Copy link
Member

Previously, if an AppLink was rendered from a node, the entire node was serialized. Since a node is a non-trivially large JSON structure, this resulted in a lot of wasted serialization, as only a few pieces of information are necessary to generate a link. As a result, pages that rendered a non-trival amount of links (in this case, SectionHierarchy) would be very laggy as the browser struggled to do all that serialization.

This commit filters only those properties necessary to render a link: id, category, name, and in_taxon_label.

(Note that this stretegy is already used in AssociationSummary.vue).

Fixes #912

Previously, if an AppLink was rendered from a node, the entire node was
serialized. Since a node is a non-trivially large JSON structure, this
resulted in a lot of wasted serialization, as only a few pieces of
information are necessary to generate a link. As a result, pages that
rendered a non-trival amount of links (in this case, SectionHierarchy)
would be very laggy as the browser struggled to do all that
serialization.

This commit filters only those properties necessary to render a link:
`id`, `category`, `name`, and `in_taxon_label`.

(Note that this stretegy is already used in AssociationSummary.vue).

Fixes #912
Copy link

netlify bot commented Jan 21, 2025

Deploy Preview for monarch-app ready!

Name Link
🔨 Latest commit 903573c
🔍 Latest deploy log https://app.netlify.com/sites/monarch-app/deploys/679145075e53b4000833f336
😎 Deploy Preview https://deploy-preview-944--monarch-app.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Jan 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.97%. Comparing base (b953722) to head (903573c).
Report is 39 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #944      +/-   ##
==========================================
+ Coverage   70.75%   70.97%   +0.21%     
==========================================
  Files          91       91              
  Lines        3084     3128      +44     
==========================================
+ Hits         2182     2220      +38     
- Misses        902      908       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@amc-corey-cox amc-corey-cox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Patrick will add a description of what toBreadcrumbNode does and why we need it to the function.

@ptgolden
Copy link
Member Author

The same function should be used in pages/node/AssociationsTable.vue and pages/node/AssociationsSummary.vue

@ptgolden ptgolden merged commit 2cc9053 into main Jan 22, 2025
11 checks passed
@ptgolden ptgolden deleted the issue-912-janky-applink branch January 22, 2025 19:30
@ptgolden
Copy link
Member Author

The same function should be used in pages/node/AssociationsTable.vue and pages/node/AssociationsSummary.vue

I did not end up doing this, because a DirectionalAssociation is different than a Node.

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.

Entities with many subclasses load super slowly
2 participants