-
Notifications
You must be signed in to change notification settings - Fork 3
Preload dynamic packages when appcache is active #236
Comments
I would put it in Specifically, in It might make sense to spread this prefetching out over time, asynchronously. If you call You can test if |
Hi, I'm looking into using appcache package on an app using already dynamic imports. I thought @CaptainN work on this PR and meteor/meteor#9482 PR was to cache dynamic imported modules into Application Cache so they will be available offline. But I can not build a tiny simple app this way (https://github.com/tophsic/meteor-bare/tree/appcache-with-dynamic-imports). When I load app online, I do not see Did I misunderstood object of this feature request? Is it possible to load dynamic import on offline mode? Best regards |
Are you running the app with I suppose we could enable caching in development if you're using the |
Ouch, I think it is not the first time I forgot to think about such subtlety! Thanks for your extremelly quick response. As far I am aware of this, I do not need caching in development environment. |
I think it does run in development mode (at least it does print some info to the console), though you are likely to run over the generally small 5MB limit. I can confirm that the PR I submitted did work when I submitted it, though I have seen some issues with it recently. I'll look at it more closely (with Meteor 1.6.1), since it's on my short list for a particular project I'm on anyway. :-) This and the more recent |
Migrating from meteor/meteor#9407
When
appcache
is enabled, anddynamic-imports
are used, Meteor is not able to load dynamic resources when loading from the cache, if those resources have not been previously loaded.Solution - when appcache is enabled,
dynamic-imports
should preload all additional packages. A package manifest is already available, we just need a loop to grab them at some point after the initial bundle is loaded and run.I'm happy to take a stab at a PR. It seems the changes could go in either the
appcache
package (detect ifdynamic-imports
is used) or indynamic-imports
(detect ifappcache
is used). Any preference?The text was updated successfully, but these errors were encountered: