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

fix: lazy check for available product links #1162

Merged
merged 2 commits into from May 20, 2022

Conversation

dhhyi
Copy link
Collaborator

@dhhyi dhhyi commented May 17, 2022

PR Type

[x] Bugfix

What Is the Current Behavior?

If the property displayOnlyAvailableProducts is activated on ish-product-links-carousel, the component fetches all linked products to calculate the carousel content. This leads to a drop in page performance, especially in SSR if products have many linked accessories.

What Is the New Behavior?

The product links are evaluated lazy slide by slide whenever the user switches to them. For SSR only the first slide is evaluated.

Does this PR Introduce a Breaking Change?

[ ] Yes
[x] No

Other Information

AB#76738

@dhhyi dhhyi added bug Something isn't working community Community contributions labels May 17, 2022
@dhhyi dhhyi self-assigned this May 17, 2022
@dhhyi dhhyi added the performance Performance improvements label May 17, 2022
@dhhyi dhhyi removed their assignment May 17, 2022
@SGrueber
Copy link
Collaborator

@dhhyi
I linked 7 accessory products to a product, one of them is not available.
If I scroll to the left and after that to the right so products become visible again I experience the following issues:

  • the image of these products are not visible immediately so that the no-image-available image is to be seen shortly
  • the product prices for these products are (unnecessarily) fetched from the REST api

Is there any chance to fix these issues?

@SGrueber SGrueber self-requested a review May 19, 2022 16:48
@dhhyi
Copy link
Collaborator Author

dhhyi commented May 20, 2022

@SGrueber

Is there any chance to fix these issues?

Yes, this behavior was caused by tearing down and re-initializing product contexts. This is now fixed by preserving the slides that have already been viewed.

@SGrueber SGrueber added enhancement Enhancement to an existing feature and removed bug Something isn't working labels May 20, 2022
@SGrueber SGrueber merged commit e44ee3e into develop May 20, 2022
@SGrueber SGrueber deleted the fix/accessories-filter-available branch May 20, 2022 10:34
@dhhyi dhhyi added this to the 2.4 milestone May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Community contributions enhancement Enhancement to an existing feature performance Performance improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants