I.e., hot module reloading for transitive imports. We already watch transitively imported modules, but the problem is that we can’t simply refresh cells that import a module after that module changes: once you import something at a given URL, it is permanently in memory.
To fix this, we need to rewrite top-level imports and transitive imports so they include a content hash or modification time of the imported module and its transitive dependencies. When an imported module changes and we are notified via the watcher, we need to recompile the code for the affected cells and send the new definition to the client as an update↓. The newly compiled code will include the new hash/mtime as part of the imported path, such that when the client runs it, it will import the changed modules.
Related #115 #79 #78 #77 which also require rewriting imported modules. (And #136 which was the first step.)
I.e., hot module reloading for transitive imports. We already watch transitively imported modules, but the problem is that we can’t simply refresh cells that import a module after that module changes: once you import something at a given URL, it is permanently in memory.
To fix this, we need to rewrite top-level imports and transitive imports so they include a content hash or modification time of the imported module and its transitive dependencies. When an imported module changes and we are notified via the watcher, we need to recompile the code for the affected cells and send the new definition to the client as an update↓. The newly compiled code will include the new hash/mtime as part of the imported path, such that when the client runs it, it will import the changed modules.
Related #115 #79 #78 #77 which also require rewriting imported modules. (And #136 which was the first step.)