Is it possible to load specific files only when the current route requires them?
Nessuno ha ancora preso questa issue.
- Lingua principale
- JavaScript
- Stelle
- 11.8k
- Fork
- 7.9k
- Merge medio
- 1g 11h
- PR unite (30g)
- 11
Descrizione
Hi. I have an app that uses old .js files from a previous development of my website (in jQuery) which I'm introducing to this project as I'm redesigning my website and only want to load the old apps I made without having to go through the ordeal of re-coding them again to fully match ReactJS standards. It all works, however since each of these apps used a separate .js file to function, I have pasted them into the project as new files, and now when I load the homepage (localhost:3000), all the resources that are mentioned on these javascript files are loaded along with it (even if only a few bytes of each), not on the page body, but on the Network tab of the Chrome developer tools, and I assume into a similar location in other browsers, which would consume memory. Is there a way to tell React not to load these specific files unless the component that uses functions from them requires them?
Is this even the right place to ask this question? Please let me know, and I'll close the issue and ask in a more appropriate location
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Il report fa riferimento alla homepage su localhost:3000, a componenti specifici delle route e a vecchi file JavaScript di jQuery. Inizia determinando se questa domanda rientra nella documentazione di React e controlla la scheda Network durante il caricamento della homepage; il lavoro è completo quando l’issue ha una risposta chiaramente documentata oppure viene reindirizzata a un forum più appropriato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, jquery, react
- Ambito
- frontend, web-dev
- Tipo di issue
- Documentazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 20/100