-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
feat(core): ChannelAware ProductVariants #564
feat(core): ChannelAware ProductVariants #564
Conversation
I'm going to pull down the work so far and take a look around. Assuming the changes seem suitable to merge into Vendure, I could then work on:
In that case it would be good if I could push directly to your PR branch. It seems that this would be possible, see this guide. |
// tslint:disable-next-line:no-non-null-assertion | ||
FindOptionsUtils.joinEagerRelations(qb, qb.alias, qb.expressionMap.mainAlias!.metadata); | ||
return qb | ||
.leftJoin('product.variants', 'variant') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering about any potential performance implications of this part. Imagine that a Product has 100 variants. To look up that product we then need to join 100 * (# channels) rows to check whether the Product is available on the current Channel.
In the original proposal we discussed that edge-case where a Product is created without any variants, and it therefore belongs to no Channel. One of my proposals was to keep a reference to the Channels on the Product. I'm now wondering whether it is worthwhile to keep it for reasons of performance and also developer ergonomics.
Of course this perf thing is just a suspicion. It needs to be tested. I'll put together a load test so we can have some objective idea about whether or not it really matters to do it this way.
Re performance of product lookup: As stated in the review comment, I wanted to investigate the perf impact of needing to join all variants (in order to determine channel) when looking up a product. Load test setupI constructed the following load test:
Results:
|
Hi Michael |
Linked to issue #519.
Functional part of transferring from ChannelAware Products to ChannelAware ProductVariants is done.
Tasks that still need to be done:
Fix DefaultSearchPlugin
Fix ElasticSearchPlugin
Adjust AdminUI
Fix FastImporter service
Fix existing Product tests that are now broken
Write new tests
Would you be able to take some of these tasks off my hands if I focus on writing the new tests?
Any feedback on the implementation is of course welcome.
Thank you very much in advance!