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

Make shelf lazy #172

Merged
merged 2 commits into from
Aug 13, 2019
Merged

Make shelf lazy #172

merged 2 commits into from
Aug 13, 2019

Conversation

drawveloper
Copy link
Contributor

What is the purpose of this pull request?

As part of our new strategy for performance, we're testing the hypothesis that server side rendering shouldn't be sensible to segment. In the long run, we will fetch products server-side without generating a simulation and hydrate prices on the client-side. But for now, side-stepping server side rendering of the shelf should make the home page much faster immediately.

What problem is this solving?

Slow server-side rendering.

How should this be manually tested?

N/A

Screenshots or example usage

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Requires change to documentation, which has been updated accordingly.

@vtex-io-ci-cd
Copy link
Contributor

vtex-io-ci-cd bot commented Aug 12, 2019

Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖

Please select which version do you want to release:

  • Patch

  • Minor

  • Major

And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.

  • No thanks, I would rather do it manually 😞

@jgfidelis
Copy link
Contributor

Question, the shelf still has ssr:true option being passed to the query, does it make a difference?

const options = {
  options: ({
    category,
    collection,
    hideUnavailableItems,
    orderBy = OrdenationTypes.ORDER_BY_TOP_SALE_DESC.value,
    specificationFilters = [],
    maxItems = ProductList.defaultProps.maxItems,
  }) => ({
    ssr: true,
    variables: {
      category,
      ...(collection != null ? {
        collection,
      } : {}),
      specificationFilters: specificationFilters.map(parseFilters),
      orderBy,
      from: 0,
      to: maxItems - 1,
      hideUnavailableItems,
    },
  }),
}

@drawveloper
Copy link
Contributor Author

Nope! Because the component won't even be included in the assets sent to render-ssr.

@jgfidelis jgfidelis merged commit 32a9d5b into master Aug 13, 2019
@jgfidelis jgfidelis deleted the feature/lazy branch August 13, 2019 17:30
@vtex-io-ci-cd
Copy link
Contributor

vtex-io-ci-cd bot commented Aug 13, 2019

Your PR has been merged! App is being published. 🚀
Version 1.25.1 → 1.26.0

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.

2 participants