Commit 98d041b4 authored by Robert Knight's avatar Robert Knight

Tweak comments in response to PR review feedback

parent e324109c
...@@ -68,6 +68,8 @@ function injectScript(doc, src, forceReload = false) { ...@@ -68,6 +68,8 @@ function injectScript(doc, src, forceReload = false) {
// Module scripts are only evaluated once per URL in a document. Adding // Module scripts are only evaluated once per URL in a document. Adding
// a dynamic fragment forces re-evaluation without breaking browser or CDN // a dynamic fragment forces re-evaluation without breaking browser or CDN
// caching of the script, as a query string would do. // caching of the script, as a query string would do.
//
// See examples in https://html.spec.whatwg.org/multipage/webappapis.html#integration-with-the-javascript-module-system
src += `#ts=${Date.now()}`; src += `#ts=${Date.now()}`;
} }
...@@ -193,8 +195,6 @@ export function bootHypothesisClient(doc, config) { ...@@ -193,8 +195,6 @@ export function bootHypothesisClient(doc, config) {
// Force re-evaluation of JS module scripts, so that the annotator entry // Force re-evaluation of JS module scripts, so that the annotator entry
// point code gets re-run if the client is unloaded and later re-loaded. // point code gets re-run if the client is unloaded and later re-loaded.
// We do this even if the client has not been loaded before because it is
// simpler and there are no negative effects (eg. to caching).
{ forceModuleReload: true } { forceModuleReload: true }
); );
} }
......
...@@ -98,7 +98,7 @@ describe('bootstrap', () => { ...@@ -98,7 +98,7 @@ describe('bootstrap', () => {
}); });
it('loads assets for the annotation layer', () => { it('loads assets for the annotation layer', () => {
clock.tick(123); clock.tick(123); // Set timestamp used by module cache-busting fragment.
runBoot('annotator'); runBoot('annotator');
const expectedAssets = [ const expectedAssets = [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment