Reactfire preventing lazy loading of firebase modules
@jhuleatt đang làm issue này rồi.
Từ ngày 19/11/2021.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
When using ReactFire I want to lazy load Firestore to reduce build initial build size and improve load times. When using ReactFire lazy loading firestore does not happen even while using import('firebase/firestore').
I have included a version that does not use ReactFire with working lazy loading as shown by the initialisation time.
I have also included a version that does use ReactFire where I am trying to use lazy loading but I believe it is not working.
I noticed this in a Nextjs project with the bundle analyzer but haven't included Nextjs in the examples for simplicity.
Version info
React: 17.02
Firebase: 9.4.1
ReactFire: 4.2.1
Test case
Test case without using ReactFire and lazy loading working:
https://codesandbox.io/s/blissful-scott-05qj6?file=/src/App.tsx
https://csb-9c5hc.netlify.app/
Test case with using ReactFire and lazy loading not working:
https://codesandbox.io/s/elegant-roentgen-2iyt8?file=/src/App.tsx
https://csb-2iyt8.netlify.app/
You can use the network tab to see that 6 networks requests are made without ReactFire but only 5 are made with using it, you can also see the breakdown of chunks in the lighthouse analysis.
Lighthouse Treemap without ReactFire
Lighthouse Treemap with ReactFire
This is quite a big blocker for me so any help would be appreciated.
Steps to reproduce
Open the two codesandbox's/netlify deployments above.
Expected behavior
Firestore is loaded in a separate chunk.
Actual behavior
Firestore is loaded in the initial chunk.
- Ngôn ngữ chính
- TypeScript
- Star
- 3.6k
- Fork
- 403
- Merge trung bình
- 5 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 10
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của FirebaseExtended/reactfire
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
FirebaseExtended/reactfire#801 ·
-
v5
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
FirebaseExtended/reactfire#793 ·
-
v5
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
FirebaseExtended/reactfire#790 · 2 bình luận ·
-
v5
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
FirebaseExtended/reactfire#789 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
FirebaseExtended/reactfire#788 ·
Tất cả issue của FirebaseExtended/reactfire
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
bcgov/bc-wallet-mobile#4761 · 1 bình luận ·
-
external-issue to-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
area-deployment area-integrations triage:bot-seen
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 86/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100