Closed
Description
[REQUIRED] Step 2: Describe your environment
- Operating System version: Firebase Hosting
- Firebase SDK version: Future with lazy loading - see Allow for lazy registration of app components #15
- Library version:
- Firebase Product: All
[REQUIRED] Step 3: Describe the problem
Issue:
- Currently when hosted on Firebase a user has to load component scripts in the correct order (auth, database, app)
- Then they need to call
'/__/firebase/init.js'
These steps do not play well with polymerfire or angularfire. The user still needs to declare the config properties either directly or by setting up their own secrets.
Request:
- Add a test to check if app is hosted on Firebase.
var _isFirebaseHosted = fetch('/__/firebase/init.js').then(response => {
if (response.status == 200) {
return true;
}
return false;
});
- Auto initializeApp
if (_isFirebaseHosted) {
firebase.initializeApp('/__/firebase/init.js');
}