You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/renderer/index.ts
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -52,3 +52,11 @@ export class Renderer {
52
52
);// Start reconcilation and render the result
53
53
}
54
54
}
55
+
56
+
// When webpack bundles everthing into one js file, there is no require cache. Hence, all the modules are present in a single array.
57
+
// When all the instructions from this bundled js file is executed and there are no more events left to listen to,
58
+
// NodeJs tries to clear up everything. Since all the modules in the bundled file are in a single variable and there is nothing referencing it,
59
+
// the gc is able to clean up even those. This is not the case in a regular nodejs app where we have require cache that keeps reference to all the modules.
60
+
// Hence to prevent all the modules from being gc'ed we keep reference to one of the modules in the entire array of modules.
0 commit comments