Skip to content

Cannot lazily load firebase components #14

@jshcrowthe

Description

@jshcrowthe

Describe your environment

  • Operating System version: macOS Sierra
  • Firebase SDK version: 4.0.0
  • Firebase Product: app

Describe the problem

firebase.js is a really large file and while you can load the individual pieces of the SDK (firebase-app, firebase-database, firebase-auth, etc) you have to do so before calling firebase.initializeApp(). This, for most use cases, means that developers load the entire firebase SDK before their app code which results in a lot of time blocking the main thread.

Steps to reproduce:

  1. Load firebase-app.js
  2. Initialize an app with firebase.initializeApp()
  3. Load firebase-database.js
  4. Try and call firebase.database()
  5. Observe error

Relevant Code:

http://jsbin.com/tovayaz/2/edit?js,console

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions