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
fix(core): Omit unnecessary libraries for web #10068
fix(core): Omit unnecessary libraries for web #10068
Conversation
@@ -35,9 +35,6 @@ typedef EnsurePluginInitialized = Future<void> Function()?; | |||
class FirebaseCoreWeb extends FirebasePlatform { | |||
static Map<String, FirebaseWebService> _services = { | |||
'core': FirebaseWebService._('app', override: 'core'), | |||
'app-check': FirebaseWebService._('app-check', override: 'app_check'), |
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 isn't going to work. We still need to rename those libraries, just not add them as a dependency.
Hey @kaptnkoala - do you intend to update this PR? |
137ea17
to
6642409
Compare
@russellwheatley I've update the PR so that web plugins that need override the Firebase Web product name, provide the override when registering them selfs. I felt like that is a more natural place to define those overrides, but let me know what you think. The necessary change in the |
Thanks @blaugold! This is exactly what was needed. We don't consider this breaking as it is underlying implementation and not user facing API 😄 |
@blaugold - do you mind merging with |
6642409
to
efaf538
Compare
@russellwheatley Thanks for the ping. I think that did it. |
Co-authored-by: Gabriel Terwesten <gabriel@terwesten.net>
Description
Currently it seems that unnecessary web libraries are loaded on start of a Flutter Web application.
In our case, we only want to use Firebase Analytics to send tracking data. For this we need to install the firebase_core and firebase_analytics package as dependencies in our project. But when we launch the bundled app in the browser, there are additional JS libraries loaded to the expected
firebase-app.js
andfirebase-analytics.js
files. At launch of our app, these JS libraries are loaded.The
firebase-firestore.js
dependency comes from the firebase_core and firebase_analytics using shared functionality from _flutterfire_internals, which has thecloud_firestore_platform_interface
andcloud_firestore_web
packages in its dependencies. But there does not seem to be any code used from these dependencies, so it seems that they could be removed.The
firebase-app-check.js
andfirebase-remote-config.js
libraries are loaded because the app-check and remote-config JS libraries are installed as default web services in FirebaseCoreWeb platform interface. I have not found any explanation in the code, why this is necessary, because both web plugins register their web service on plugin registration, when they are added as discrete dependency to a project.Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
).This will ensure a smooth and quick review process. Updating the
pubspec.yaml
and changelogs is not required.///
).melos run analyze
) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?