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

Build-time GraphQL #1739

Closed
supernova-at opened this issue Sep 23, 2019 · 1 comment
Closed

Build-time GraphQL #1739

supernova-at opened this issue Sep 23, 2019 · 1 comment
Labels
performance Things related to perf Progress: done research Research spike or experimental work.

Comments

@supernova-at
Copy link
Contributor

Overview

Run-time calls to the GraphQL API to fetch data introduce latency and delay to the application.
Investigate whether we can fetch any data that the initial load of the application needs at build time and preload the application with it.

Risks / Caveats

  1. We don't know the frequency of builds. It may be entirely possible that the site is only ever "built" once.
  2. We don't know the frequency of data updates. How will the application "update" this data if it is changed in the M2 Admin (for example) after build time?

It may be entirely possible that the result of this investigation is "we should not do this".

References

The GraphQL project documentation has good information on what data changes and how frequently (and when it should be updated).

@supernova-at supernova-at added research Research spike or experimental work. performance Things related to perf labels Sep 23, 2019
@sirugh
Copy link
Contributor

sirugh commented Feb 11, 2021

We already do this in the webpack configurator. Unclear whether that should continue to happen now that we support multi-store and also we need to be able to react to config changes without forcing a client to rebuild their runtime bundle.

The storeConfig query provides a lot of information but it is store specific. Perhaps a better thing to do would be to understand the specific data we want to pre-fetch, do it for all possible stores, and make that call happen in the service worker. I'm closing this for now, to clean up our github issue log, but if you think it is worth an investigation we should open an internal JIRA ticket :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Things related to perf Progress: done research Research spike or experimental work.
Projects
None yet
Development

No branches or pull requests

2 participants