Recall & Review
beginner
What is tree-shaking in the context of Firebase Modular SDK (v9+)?
Tree-shaking is a process that removes unused code from the final app bundle, making the app smaller and faster by only including the Firebase features you actually use.
Click to reveal answer
beginner
How does the Modular SDK (v9+) help with tree-shaking compared to older Firebase SDK versions?
The Modular SDK uses individual function imports instead of a big namespace, so bundlers can detect and remove unused parts easily, unlike older SDKs that imported everything at once.
Click to reveal answer
beginner
Why should you import only the Firebase functions you need in Modular SDK (v9+)?Importing only needed functions helps tree-shaking work well, reducing app size and improving load speed by excluding unused Firebase code.
Click to reveal answer
beginner
Example: How to import Firestore's getDoc function in Modular SDK (v9+) for tree-shaking?Use: import { getDoc } from 'firebase/firestore'; This imports only the getDoc function, allowing unused Firestore code to be removed.Click to reveal answer
beginner
What is the main benefit of tree-shaking for mobile users of Firebase apps?
Smaller app size means faster downloads, quicker startup, and less data usage, which improves user experience especially on slow or limited networks.
Click to reveal answer
What does tree-shaking do in Firebase Modular SDK (v9+)?
✗ Incorrect
Tree-shaking removes unused code to reduce app size and improve performance.
Which import style helps tree-shaking in Firebase Modular SDK (v9+)?
✗ Incorrect
Importing only specific functions allows bundlers to remove unused code.
Why is tree-shaking important for Firebase apps on mobile devices?
✗ Incorrect
Tree-shaking reduces app size, making apps load faster and use less data.
Which Firebase SDK version introduced the Modular SDK with tree-shaking support?
✗ Incorrect
Firebase Modular SDK with tree-shaking was introduced in version 9.
What happens if you import the entire Firebase SDK instead of specific functions in Modular SDK?
✗ Incorrect
Importing the whole SDK prevents tree-shaking from removing unused code, increasing bundle size.
Explain how tree-shaking works in Firebase Modular SDK (v9+) and why it matters.
Think about how only the code you use stays in your app.
You got /5 concepts.
Describe best practices for importing Firebase features to maximize tree-shaking benefits.
Focus on how to write your import statements.
You got /4 concepts.