Open shashi opened 8 years ago
It feels like we want a solution close to watchify where the asset file is generated as a bundle which is then available to the browser when changed. I could see each
It seems to me that hot-loading Javascript is made difficult by the fact that web components cannot be re-registered. I don't think that's that big a deal right now as much as packing asset files together in a compact package for faster load time.
There are other options that I missed out here:
I think we should implement both of these
Right now, all assets are loaded from Escher's assets folder, uncompressed and un-concatenated. This is of course not ideal.
Here is a rough sketch of what this could look like in the future:
a, b, and c would get concatenated and gzipped (the first time they are needed), and cached in a file under
assets/cache
with some canonical name likeProblem 1: Some polymer files are repeatedly included in others. So if window.assets is pushed to a second time, it should be possible to exclude what was already sent. And the corresponding statements must be stripped. This is not only nice to have, not having this is a fatal error since elements will try to register themselves more than once.
Problem 2: cache invalidation. If one is editing the assets file, when should they be cleared? a manual way to do it can be provided:
escher --clear-cache
.