From 30314db086668980f552c977cd440ca8ce337538 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Thu, 28 Jul 2022 11:44:59 -0500 Subject: [PATCH 1/2] webpack: fix main.[hash].js not cached This caused updates to not work if main.js was not in the browser cache since it was being excluded from the service worker. Issue: https://github.com/pybricks/support/issues/689 --- CHANGELOG.md | 5 +++++ config/webpack.config.js | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f9973a0..0a403985 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ ## [Unreleased] +### Fixed +- Fixed `main.[hash].js` not cached ([support#689]). + +[support#689]: https://github.com/pybricks/support/issues/689 + ## [2.0.0-beta.4] - 2022-07-28 ### Added diff --git a/config/webpack.config.js b/config/webpack.config.js index 7a6daf6d..5174e1c0 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -716,12 +716,10 @@ module.exports = function (webpackEnv) { new WorkboxWebpackPlugin.InjectManifest({ swSrc, dontCacheBustURLsMatching: /\.[0-9a-f]{8}\./, - // REVISIT: main entry point should be chunked instead of ignored - exclude: [/\.map$/, /asset-manifest\.json$/, /LICENSE/, /static\/js\/main\.\w+\.js$/], // Bump up the default maximum size (2mb) that's precached, // to make lazy-loading failure scenarios less likely. // See https://github.com/cra-template/pwa/issues/13#issuecomment-722667270 - maximumFileSizeToCacheInBytes: 2 * 1024 * 1024, + maximumFileSizeToCacheInBytes: 10 * 1024 * 1024, }), // TypeScript type checking useTypeScript && From 3ac399e73c6362eaa67ecbb846a3a1fa21e741ee Mon Sep 17 00:00:00 2001 From: David Lechner Date: Thu, 28 Jul 2022 11:47:18 -0500 Subject: [PATCH 2/2] v2.0.0-beta.5 --- CHANGELOG.md | 6 +++++- package.json | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a403985..f31e6178 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ ## [Unreleased] +## [2.0.0-beta.5] - 2022-07-28 + ### Fixed - Fixed `main.[hash].js` not cached ([support#689]). @@ -349,7 +351,9 @@ Prerelease changes are documented at [support#48]. -[Unreleased]: https://github.com/pybricks/pybricks-code/compare/v2.0.0-beta.3...HEAD +[Unreleased]: https://github.com/pybricks/pybricks-code/compare/v2.0.0-beta.5...HEAD +[2.0.0-beta.5]: https://github.com/pybricks/pybricks-code/compare/v2.0.0-beta.4...v2.0.0-beta.5 +[2.0.0-beta.4]: https://github.com/pybricks/pybricks-code/compare/v2.0.0-beta.3...v2.0.0-beta.4 [2.0.0-beta.3]: https://github.com/pybricks/pybricks-code/compare/v2.0.0-beta.2...v2.0.0-beta.3 [2.0.0-beta.2]: https://github.com/pybricks/pybricks-code/compare/v2.0.0-beta.1...v2.0.0-beta.2 [2.0.0-beta.1]: https://github.com/pybricks/pybricks-code/compare/v1.2.0-beta.1...v2.0.0-beta.1 diff --git a/package.json b/package.json index 2a517d31..aabdba67 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@pybricks/pybricks-code", - "version": "2.0.0-beta.4", + "version": "2.0.0-beta.5", "license": "MIT", "author": "The Pybricks Authors", "repository": {