-
Notifications
You must be signed in to change notification settings - Fork 944
Simplify ComponentProviders #3935
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
|
6afd071
to
48d814b
Compare
Binary Size ReportAffected SDKs
Test Logs
|
Size Analysis ReportAffected ProductsNo changes between base commit (2c1764d) and head commit (469d314). Test Logs
|
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.
LGTM
'If you are using `experimentalForceOwningTab:true`, make sure that only ' + | ||
'one tab has persistence enabled at any given time.'; | ||
'Failed to obtain exclusive access to the persistence layer. To allow ' + | ||
'shared access, multi-tab synchronization has to be enabled in all tabs.'; |
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.
It seems a shame to remove the helpful error message regarding experimentalForceOwningTab:true
, though it seems like we should know if that's enabled and give that helpful message only when applicable.
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 was hoping to not use the "experimental" name in firestore-exp and dropped it due to the two different names. I will come up with a way to add it back.
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.
Approve for prettier changes
This PR is meant to reduce the diff for #3901
#3901 changes the legacy Firestore SDK to use
enableIndexedDbPersistence
orenableMultiTabIndexedDbPersistence
for any call toFirestore.enablePersistence()
. This allows us to only include the IndexedDbOfflineComponentProvider or MultiTabOfflineComponentProvider when needed, which results in some simplifications.We now know that
MultiTabOfflineComponentProvider
is only used with multi-tab persistence. Before,MultiTabOfflineComponentProvider
also needed to support non-multi-tab persistence. This already simplified the component provider, but this PR goes a bit further and removes all persistence related settings from the Component Provider configuration and instead configures each persistence provider directly at instantiation.This PR also adds the existing
canFallback
logic for persistence-related errors to firestore-exp.