-
Notifications
You must be signed in to change notification settings - Fork 946
Extract Offline-only component provider #3460
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
💥 No ChangesetLatest commit: 2ccff75 Merging this PR will not cause any packages to be released. If these changes should not cause updates to packages in this repo, this is fine 🙂 If these changes should be published to npm, you need to add a changeset. This PR includes no changesetsWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Click here to learn what changesets are, and how to add one. Click here if you're a maintainer who wants to add a changeset to this PR |
Binary Size ReportAffected SDKs
Test Logs
|
26db8f5
to
3da634e
Compare
a926099
to
489fcb4
Compare
489fcb4
to
2b021e7
Compare
packages/firestore/package.json
Outdated
@@ -18,7 +18,7 @@ | |||
"dev": "rollup -c -w", | |||
"lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", | |||
"lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", | |||
"prettier": "prettier --write '*.js' '{,!(dist)}/**/*.ts'", | |||
"prettier": "prettier --write '*.js' '*.ts' '{,!(dist)}/**/*.ts'", |
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.
Question: what's the reason for this addition? Shouldn't the glob on the right cover it?
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 tried to figure this out with https://globster.xyz/, but it seems to slightly disagree with what we have. I think '{,!(dist)}/**/*.ts'
doesn't match since it requires at least one level of nesting.
This is the next PR in the infinite series that will eventually be #3425
It changes the component providers so that it is possible to only instantiate the components that are needed for cache-only queries.
There are now:
The offline providers provide LocalStore, Persistence and related classes. OnlineComponentProvider provides SyncEngine and RemoteStore (among others).
MultiTabOfflineComponentProvider depends on OnlineComponentProvider. That means that in Multi-Tab mode, even a client that only uses
getDocsFromCache
will bundle RemoteStore and SyncEngine. This is probably what we want though, since it may have to listen to queries from secondary tabs.