Skip to content

Conversation

ericclemmons
Copy link
Contributor

@ericclemmons ericclemmons commented Jun 12, 2020

I'm adding https://github.com/vercel/swr to handle auto-refreshing & fetching (via stale-while-revalidate) of chunks.

SWR has more options we can take advantage of (particularly with dropping axios in favor of fetch so we can leverage the built-in browser cache), but for now this does the following:

  • Return null while loading.
  • Return the default content on error.
  • Return the chunk on data.
📦 Published PR as canary version: 2.0.1-canary.4.1c93912.0

✨ Test out this PR locally via:

npm install [email protected]
# or 
yarn add [email protected]

@ericclemmons ericclemmons added the enhancement New feature or request label Jun 12, 2020
@ericclemmons ericclemmons merged commit 0380b70 into master Jun 12, 2020
@ericclemmons ericclemmons deleted the cache branch June 12, 2020 03:36
@github-actions
Copy link

🚀 PR was released in v2.0.1 🚀

@github-actions github-actions bot added the released This issue/pull request has been released. label Jun 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request released This issue/pull request has been released.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant