-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use the default Flutter service worker instead of our custom service worker #5331
Conversation
@@ -403,8 +403,7 @@ class FakeVmServiceWrapper extends Fake implements VmServiceWrapper { | |||
) async { | |||
final httpProfile = await getHttpProfile(isolateId); | |||
return Future.value( | |||
httpProfile.requests | |||
.firstWhereOrNull((request) => request.id == id), | |||
httpProfile.requests.firstWhereOrNull((request) => request.id == id), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change was due to running dart format
from the root
packages/devtools_app/web/index.html
Outdated
onEntrypointLoaded: function(engineInitializer) { | ||
engineInitializer.initializeEngine().then(function(appRunner) { | ||
appRunner.runApp(); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you set the config to use canvas kit here now that we are using the default service worker?
https://docs.flutter.dev/development/platform-integration/web/renderers#runtime-configuration.
This would also allow us to remove --dart-define=FLUTTER_WEB_CANVASKIT_URL=canvaskit/ \
from build_release.sh
below.
Here is the devtools issue for that: #5148
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
packages/devtools_app/web/index.html
Outdated
onEntrypointLoaded: function(engineInitializer) { | ||
engineInitializer.initializeEngine({ | ||
renderer: 'canvaskit', | ||
canvasKitBaseUrl: 'canvaskit' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curious, does the call to initializeEngine work without setting the base url? In the example on the flutter website, I only saw "renderer" specified, so I'm wondering why we need this too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, looks like this is required otherwise it tries to download canvaskit from the CDN, which is surprising. Opened flutter/flutter#121743 in Flutter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Just making sure - have we verified that canvas kit is properly loaded with the new changes?
Fixes #5148 |
Yep, all is working (even with no internet connection) |
Work towards #3896, #4658
Use the default Flutter service worker generated by Flutter Web instead of our own.
index.html
were copied from the defaultindex.html
generated by Flutter when you runflutter create
pwa-strategy
changed fromnone
tooffline-first
so that Flutter generates a service workerConfirmed that the new service worker works by running
dart run tool/build_e2e.dart
. Need to also update the copybara script before submitting.