Join GitHub today
remove dynamic js and map files from appcache (app.manifest) #9434
As described in issue #9407, dynamic-imports does not load modules from the appcache, and since we don't want the browser to download these assets twice, this patch avoids adding those files to app.manifest.
This patch does pass the appcache unit test, but I'm not sure how to create a test for this, as I'm not sure how to set gt it to load dynamic imports to test with.
I appreciate that this PR involves changes only to the
appcache package, rather than changing the way we bundle and serve JS resources (which would require a new version of Meteor to be released). Thanks for spotting this problem and moving forward with the fix, @CaptainN!
Dec 5, 2017
12 checks passed
The url check is really only used for .map files. The check for dynamic js files was relatively easier, since the type attribute reflects it's dynamic status. If the .map files were similarly marked as dynamic in the type (like 'dynamic json') that might help avoid the problem.
Alternatively, we could remove all .map files from the app cache, and not inspect the url at all, but that's a bigger change.