-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(browser): Add IndexedDb offline transport store #6983
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
Conversation
|
Note: I changed the target to |
|
Just noticed that this offline wrapper is currently getting included in the default browser bundles and adds around 2-3KB. Options:
|
The CDN bundle? I think we're fine with that sacrifice. For npm they can just tree-shake it away. |
We went with a 4th option. Exclude |
Lms24
left a comment
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.
This LGTM and good that we're excluding it from the bundles.
| /** | ||
| * Creates a Rollup plugin that removes all code between the `__ROLLUP_EXCLUDE_FROM_BUNDLES_BEGIN__` | ||
| * and `__ROLLUP_EXCLUDE_FROM_BUNDLES_END__` comment guards. This is used to exclude the Replay integration | ||
| * from the browser and browser+tracing bundles. |
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.
l: Let's just update the JSDoc here that this factory function can be used to exclude basically any exported member from the bundles
AbhiPrasad
left a comment
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.
As part of the offline integration deprecation, we also need to revamp all of our docs for this!
Closes #3046
This PR:
insert/popwrappers for IndexedDbidb-keyvalas reference since it's well used and testedcreateIndexedDbStorethat creates anOfflineStoreimplementationmakeIndexedDbOfflineTransport) that supplements transport options withIndexedDbOptionsmakeBrowserOfflineTransportfor use in creating browser offline transportfake-indexeddbto test the code in node.jsHow it's used:
Browser support:
getAllKeysTextEncoder/TextDecoderSince IE is not supported we could make the fetch transport the default so it does not need to be passed to
makeFetchTransport?Tests