-
Notifications
You must be signed in to change notification settings - Fork 60
System.delete("file.css") should remove link from head #81
Comments
Try |
Tried your solution but doesn't seem to work, unless I'm missing something. It only removes it from the registry, not the dom node. I've repurposed https://github.com/alexisvincent/system-ja-stack-trace-error to demonstrate this issue. To reproduce, serve the repo and run System.delete(System.normalizeSync('app.css!')) in the console |
Yes, even if the module is deleted from the registry that does not mean the CSS is unloaded as there is no unload pipeline for modules removed from the registry. It's best to follow the principles of modular CSS so that unloading of CSS is not necessary due to careful scoping. |
What are your thoughts on implementing an unload of css. In my mind it would be what people intuitively expect. |
It could be done by having the CSS module itself export an "unload" function, which disposes of its own registry entry. But it shouldn't be encouraged. |
For me, it would make sense to add an unload step that loaders can implement if they want to, I'm positive there are other cases where a loader might want to do some initialisation and subsequently some finalisation. |
System.delete("file.css") should remove link from head. When hot reloading css with capaj/systemjs-hot-reloader.
Currently the delete does nothing. And then the css file is injected. So what ends up happing is actually a minimal overwrite.
a.css
a2.css
The expectation is that the color property is no longer being specified. But it is.
The text was updated successfully, but these errors were encountered: