Firebase hosting services reserves URLs that start with /_ _
. These reserved namespaces help us to use other Firebase services with Hosting. These reserved URLs are available when we deploy the web application to hosting, and are available on the local server through the Serve command.
The Firebase SDK serves hosting over the HTTP/2 protocol when it's deployed. We can tweak the performance of file loading at the origin. Hosting serves all the SDK with the following special URL:
/__/firebase/{version}/{sdk-file}.js
The right way to import the SDK is as shown here:
<script src="/__/firebase/4.12.1/firebase-app.js"></script> <script src="/__/firebase/4.12.1/firebase-auth.js"></script> <script src="/__/firebase/4.12.1/firebase-storage.js"></script>
With all versions of the SDK hosted this way, it's easy to download the latest SDKs. We can also autoconfigure the SDK, as shown here:
fetch('/__/firebase/init.json').then(response => { firebase.initializeApp...