From b6bc9c85796b4a64bb23070d23cb7e137f60b39f Mon Sep 17 00:00:00 2001 From: abose Date: Sat, 8 Aug 2026 17:45:06 +0530 Subject: [PATCH 1/2] build: update pro deps --- tracking-repos.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tracking-repos.json b/tracking-repos.json index 79697b8469..f58b097035 100644 --- a/tracking-repos.json +++ b/tracking-repos.json @@ -1,5 +1,5 @@ { "phoenixPro": { - "commitID": "11fc9899d481d9781b2a8d850d8c7209db4c010a" + "commitID": "5886d202574264a2c4c70b4126618b9fae4950ff" } } From 6d3c2469e88517d9506f3724151d5c4a89cab4ee Mon Sep 17 00:00:00 2001 From: abose Date: Sat, 8 Aug 2026 18:50:54 +0530 Subject: [PATCH 2/2] build: use a looser PWA cache size limit for dev builds release:dev fails on windows only, at createDistCacheManifest: the dev dist cache came to 78203 KB against a hardcoded 78000 KB ceiling that was shared by every release chain. Dev builds ship unminified sources and keep the phoenix-pro sources in dist, so they are legitimately larger than prod. Split the ceiling into MAX_CACHE_SIZE_KB_PROD (78000, unchanged) and MAX_CACHE_SIZE_KB_DEV (100000), matching the DEV_MAX_TOTAL_SIZE_MB / PROD_MAX_TOTAL_SIZE_MB split that already exists in validate-build.js. releaseDev gets its own createDistCacheManifestDev task; staging and prod are unchanged. src/cacheManifest.json only matters when the src tree itself is served (npm run serve). Releases ship dist/, whose manifest is regenerated by createDistCacheManifest and overwrites the copy makeDistNonJS carried over, so the src manifest takes the dev limit in both chains. The shipped artefact is still guarded by createDistCacheManifest and validateDistSizeRestrictions at their existing prod limits. Also report the actual limit and measured size in the error message instead of always naming 78MB. --- gulpfile.js/index.js | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/gulpfile.js/index.js b/gulpfile.js/index.js index 81e69f8430..2da39623b6 100644 --- a/gulpfile.js/index.js +++ b/gulpfile.js/index.js @@ -459,6 +459,13 @@ const ALLOWED_EXTENSIONS_TO_CACHE = ["js", "html", "htm", "xml", "xhtml", "mjs", const DISALLOWED_EXTENSIONS_TO_CACHE = ["map", "nuspec", "partial", "pre", "post", "webmanifest", "rb", "ts"]; +// Ceiling for the PWA service worker cache, in KB. Dev builds ship unminified sources and keep the +// phoenix-pro sources in dist, so they are legitimately larger than prod - dev gets the looser +// limit, mirroring DEV_MAX_TOTAL_SIZE_MB / PROD_MAX_TOTAL_SIZE_MB in validate-build.js. Prod is the +// number that actually matters for users, so keep that one tight. +const MAX_CACHE_SIZE_KB_PROD = 78000; +const MAX_CACHE_SIZE_KB_DEV = 100000; + const EXCLUDE_PATTERNS_FROM_CACHE = [ /src\/nls\/.*expertTranslations\.json$/, /src\/nls\/.*lastTranslated\.json$/, @@ -512,7 +519,7 @@ function _getFileDetails(path) { }; } -function _computeCacheManifest(baseDir, filePaths) { +function _computeCacheManifest(baseDir, filePaths, maxSizeKB) { let manifest = {}, fileDetails, totalSize = 0; let fileSizes = []; for(let filePath of filePaths){ @@ -533,8 +540,9 @@ function _computeCacheManifest(baseDir, filePaths) { totalSize = Math.round(totalSize/1024); // KB console.log("Total size of cache in KB: ", totalSize); - if(totalSize > 78000){ - throw new Error("The total size of the src or dist folder core assets exceeds 78MB." + + if(totalSize > maxSizeKB){ + throw new Error(`The total size of the src or dist folder core assets exceeds ` + + `${Math.round(maxSizeKB / 1000)}MB (got ${Math.round(totalSize / 1000)}MB).` + "\nPlease review and trim storage. This significantly impacts the distribution size." + "\nEither trim down the size or increase the limit after careful review."); } @@ -954,24 +962,32 @@ async function _renameConcatExtensionsinDist() { } } -function createCacheManifest(srcFolder) { +function createCacheManifest(srcFolder, maxSizeKB) { return new Promise((resolve, reject)=>{ _listFilesInDir(srcFolder).then((files)=>{ files = _fixAndFilterPaths(srcFolder, files); console.log("Files in cache: ", files.length); - let cache = _computeCacheManifest(srcFolder, files); + let cache = _computeCacheManifest(srcFolder, files, maxSizeKB); fs.writeFileSync(srcFolder + "/cacheManifest.json", JSON.stringify(cache, null, 2)); resolve(); }).catch(reject); }); } +// src/cacheManifest.json only matters when the src tree itself is served (npm run serve) - releases +// ship dist/, whose manifest is regenerated by createDistCacheManifest and overwrites the copy that +// makeDistNonJS carried over. So this is a dev-serving artefact in every chain and takes the dev +// limit; the shipped artefact is guarded by createDistCacheManifest + validateDistSizeRestrictions. function createSrcCacheManifest() { - return createCacheManifest("src"); + return createCacheManifest("src", MAX_CACHE_SIZE_KB_DEV); } function createDistCacheManifest() { - return createCacheManifest("dist"); + return createCacheManifest("dist", MAX_CACHE_SIZE_KB_PROD); +} + +function createDistCacheManifestDev() { + return createCacheManifest("dist", MAX_CACHE_SIZE_KB_DEV); } function copyDistToDistTestFolder() { @@ -1101,7 +1117,7 @@ exports.reset = series(cleanAll); exports.releaseDev = series(cleanDist, exports.buildDebug, makeBracketsConcatJS, makeConcatExtensions, _compileLessSrc, makeDistAll, cleanUnwantedFilesInDistDev, releaseDev, _renameConcatExtensionsinDist, - createDistCacheManifest, createDistTest, + createDistCacheManifestDev, createDistTest, _cleanPhoenixProGitFolder, _cleanReleaseBuildArtefactsInSrc, validateBuild.validateDistSizeRestrictions); exports.releaseStaging = series(cleanDist, exports.build, makeBracketsConcatJSWithMinifiedBrowserScripts, makeConcatExtensions, _compileLessSrc, makeDistNonJS, makeJSDist, makeJSPrettierDist, makeNonMinifyDist,