Skip to content

Commit

Permalink
Add clarifying comment to each file changed in the patch see: #326 (c…
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonic authored Mar 28, 2023
1 parent 6e6888f commit 011d890
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion build_tools/patch_web.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env sh

set -e

# This script is needed to patch the flutter.js and flutter_service_worker.js so they load faster
# see: https://github.com/dwyl/app/issues/326#issuecomment-1478314967
patch ./build/web/flutter.js < ./build_tools/web/flutter.js.patch
patch ./build/web/flutter_service_worker.js < ./build_tools/web/flutter_service_worker.js.patch
2 changes: 2 additions & 0 deletions build_tools/web/flutter.js.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
--- flutter.js 2023-03-24 18:27:43
+++ flutter2.js 2023-03-24 18:37:08
@@ -353,7 +353,15 @@
// This script is needed to patch the flutter.js and flutter_service_worker.js so they load faster
// see: https://github.com/dwyl/app/issues/326#issuecomment-1478314967
// Install the `didCreateEngineInitializer` listener where Flutter web expects it to be.
this.didCreateEngineInitializer =
entrypointLoader.didCreateEngineInitializer.bind(entrypointLoader);
Expand Down
5 changes: 3 additions & 2 deletions build_tools/web/flutter_service_worker.js.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
+++ flutter_service_worker2.js 2023-03-24 19:04:42
@@ -28,22 +28,10 @@

// The application shell files that are downloaded before a service worker can
// start.
// Patched flutter_service_worker.js splits up the loading of files so they are parallel.
// see: https://github.com/dwyl/app/issues/326#issuecomment-1478314967
// Application shell files that are downloaded before a service worker can start.
-const CORE = [
- "main.dart.js",
-"index.html",
Expand Down
3 changes: 2 additions & 1 deletion web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ <h1>do what you love</h1>
});
}

// load serviceworker earlier
// Load serviceWorker earlier
// see: https://github.com/dwyl/app/issues/326#issuecomment-1478314967
const serviceWorkerActivation = navigator.serviceWorker.register(
"flutter_service_worker.js?v=" + serviceWorkerVersion
);
Expand Down

0 comments on commit 011d890

Please sign in to comment.