Open trusktr opened 5 years ago
Hmmm, I ran delete window.reactHotLoaderGlobal
, and then the retainer stack changed to the following (notice the yellow highlights):
Maybe this is not related to react hot loader then.
reactHotLoaderGlobal is basically React-Hot-Loader
as a whole module. Including maps(knownClassComponents
), holding every component you have, including proxy weak maps, and some other stuff.
And you are right - there is no delete operation defined. PS: And you can't "delete" RHL as a variable. You are deleting no more than just copy.
How can I ensure that in production there's no react-hot-loader stuff imported at all?
ReactHotLoader global variable should not exists. It would not if NODE_ENV is set to production.
ReactHotLoader
global variable should not exists.
Did you mean the reactHotLoaderGlobal
variable?
yep. If it does not exist - ReactHotLoader does not exists.
If you are reporting a bug or having an issue setting up React Hot Loader, please fill in below. For feature requests, feel free to remove this template entirely.
Description
What you are reporting:
Seems like there's a leak in the hot loader? For each instance of my
Annotator
component, I see a retainer hierarchy like the following in the Heap snapshot I took in the Memory tab:Expected behavior
What you think should happen:
I think that the
gui
you see at the top of the retainer hierarchy should be garbage collected, and my component is done with it, but it is leaking. I see lots of React stuff in the retainer stack.Actual behavior
What actually happens:
The yellow-highlighted objects in the stack are the only things that JS has references to, which looks to be the
enter()
function, which seems related to React hot loader.Environment
React Hot Loader version:
4.6.5
Run these commands in the project folder and fill in their results:
node -v
:v8.11.3
npm -v
:6.5.0
Then, specify:
Reproducible Demo
No simple reproduction yet.