Reactfire preventing lazy loading of firebase modules
@jhuleatt já está trabalhando nisso.
Desde 19/11/2021.
Avaliação
Esta issue ainda não foi avaliada.
Descrição
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.
- Linguagem predominante
- TypeScript
- Estrelas
- 3.6k
- Forks
- 403
- Merge médio
- 5d 1h
- PRs com merge (30d)
- 10
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de FirebaseExtended/reactfire
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 38/100
FirebaseExtended/reactfire#801 ·
-
v5
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
FirebaseExtended/reactfire#793 ·
-
v5
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
FirebaseExtended/reactfire#790 · 2 comentários ·
-
v5
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 55/100
FirebaseExtended/reactfire#789 ·
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
FirebaseExtended/reactfire#788 ·
Todas as issues de FirebaseExtended/reactfire
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
bcgov/bc-wallet-mobile#4761 · 1 comentário ·
-
external-issue to-triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
-
area-deployment area-integrations triage:bot-seen
Dificuldade 2/5 Meio dia Facilidade para iniciantes 86/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
-
refactor
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100