From 340600a700de3513021637a50d2b927ca287fedb Mon Sep 17 00:00:00 2001 From: raclim Date: Tue, 8 Oct 2024 16:33:00 -0400 Subject: [PATCH 1/2] add cache busting to assets in preview --- client/modules/Preview/previewIndex.jsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/client/modules/Preview/previewIndex.jsx b/client/modules/Preview/previewIndex.jsx index 9e16b5ad85..2c1265328d 100644 --- a/client/modules/Preview/previewIndex.jsx +++ b/client/modules/Preview/previewIndex.jsx @@ -52,6 +52,19 @@ const App = () => { } } + function addCacheBustingToAssets(files) { + const timestamp = new Date().getTime(); + return files.map((file) => { + if (file.url) { + return { + ...file, + url: `${file.url}?v=${timestamp}` + }; + } + return file; + }); + } + useEffect(() => { const unsubscribe = listen(handleMessageEvent); return function cleanup() { @@ -62,7 +75,7 @@ const App = () => { Date: Tue, 8 Oct 2024 16:59:28 -0400 Subject: [PATCH 2/2] 2.14.7 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 75e6656705..9180611792 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "p5.js-web-editor", - "version": "2.14.6", + "version": "2.14.7", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "p5.js-web-editor", - "version": "2.14.6", + "version": "2.14.7", "license": "LGPL-2.1", "dependencies": { "@auth0/s3": "^1.0.0", diff --git a/package.json b/package.json index 1d1dd0658e..97a6a09058 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "p5.js-web-editor", - "version": "2.14.6", + "version": "2.14.7", "description": "The web editor for p5.js.", "scripts": { "clean": "rimraf dist",