-
Notifications
You must be signed in to change notification settings - Fork 6k
Fixes a few issues in flutter_js #53231
Conversation
This addresses a couple things: flutter/flutter#147610 (Treat `auto` renderer properly) flutter/flutter#149443 (Add an entrypoint base url config option) This also adds a `useLocalCanvasKit` configuration option on the build config, which the flutter tool can use to fix flutter/flutter#148713
|
I'm testing these changes against the framework presubmit stuff here: flutter/flutter#149769 |
|
Presubmit testing against the framework has some issues currently. (flutter/flutter#149780) But it looks the presubmit testing that I did get to run seems to indicate things are working with this change. |
ditman
left a comment
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.
Thanks for the clean up! All I can do is nitpick, I think the worst offender is the introduction of some single quotes in the new file utils.js (while it seems we're going to double quotes everywhere elsewhere)
lib/web_ui/flutter_js/src/utils.js
Outdated
| function stripLeftSlash(s) { | ||
| return s.startsWith('/') ? s.substring(1) : s; | ||
| } | ||
|
|
||
| function stripRightSlash(s) { | ||
| return s.endsWith('/') ? s.substring(0, s.length - 1) : s; | ||
| } |
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.
Do we want these to strip repeated slashes?
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.
Hmmm, I thought about that. I was on the fence about it. Seems like the code would be more complex, and passing in a path segment with more than one leading or trailing slash feels like an obviously wrong thing to do and if the path segment ends up malformed then whatever. But then again, maybe it's just better to strip multiple slashes. I'll look to see if I can make a simple change here.
lib/web_ui/flutter_js/src/utils.js
Outdated
| } | ||
|
|
||
| export function joinPathSegments(...segments) { | ||
| return segments.map((segment, i) => { |
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.
segments
.filter(s => s != null)
.map...
That way we don't have to use .length later? Do we expect many "empty" strings?
Should this function throw when one of the segments is not valid, instead of attempting to fix the URL?
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.
I think this should just do the logical thing when handed any string?, and not throw. I don't want to add extra error handling to this function. I can pre-filter out falsey strings, but I still would need to do the .length filter afterward in case a string was just a slash, and it only became empty after the map function.
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.
If we're using length to validate, maybe also "trim" beforehand, so " " is not a valid string?
| </script> | ||
| <script> | ||
| _flutter.buildConfig = { | ||
| useLocalCanvaskit: true, |
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.
Pretty!
…149944) flutter/engine@1cdbebe...45cf05f 2024-06-07 [email protected] [web] add test for inefficient overlay allocation (flutter/engine#53284) 2024-06-07 [email protected] Update Chrome to 125. (flutter/engine#53282) 2024-06-07 [email protected] Roll Dart SDK from 4b693b16eec1 to d4f17e0bf28b (1 revision) (flutter/engine#53283) 2024-06-07 [email protected] Fixes a few issues in flutter_js (flutter/engine#53231) 2024-06-07 [email protected] Roll Fuchsia Linux SDK from aVohW_hnfDaE0smBX... to zpBZmUB_JC5AjG-f4... (flutter/engine#53279) 2024-06-07 [email protected] Roll Dart SDK from 7b239d7f4578 to 4b693b16eec1 (1 revision) (flutter/engine#53277) 2024-06-07 [email protected] Roll Skia from b7f51dfcc342 to ad3c9f203f4e (1 revision) (flutter/engine#53276) 2024-06-07 [email protected] Roll Skia from 5fc83884a619 to b7f51dfcc342 (4 revisions) (flutter/engine#53275) 2024-06-07 [email protected] Revert "Widen CPU affinity set." (flutter/engine#53274) 2024-06-07 [email protected] Roll Skia from e36110f8b451 to 5fc83884a619 (1 revision) (flutter/engine#53273) Also rolling transitive DEPS: fuchsia/sdk/core/linux-amd64 from aVohW_hnfDaE to zpBZmUB_JC5A If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…visions) (#149944)" (#149960) Reverts: #149944 Initiated by: jason-simmons Reason for reverting: Regression affecting `integration_test/test/web_extension_test.dart` ``` PathNotFoundException: Cannot open file, path = '/chromium/canvaskit.wasm' (OS Error: No such file or directory, errno = 2) ``` (see https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8745735238400976001/+/u/run_test.dart_for_web_long_running_tests_shard_and_subshard_1_5/stdout) It looks like the p Original PR Author: engine-flutter-autoroll Reviewed By: {fluttergithubbot} This change reverts the following previous change: flutter/engine@1cdbebe...45cf05f 2024-06-07 [email protected] [web] add test for inefficient overlay allocation (flutter/engine#53284) 2024-06-07 [email protected] Update Chrome to 125. (flutter/engine#53282) 2024-06-07 [email protected] Roll Dart SDK from 4b693b16eec1 to d4f17e0bf28b (1 revision) (flutter/engine#53283) 2024-06-07 [email protected] Fixes a few issues in flutter_js (flutter/engine#53231) 2024-06-07 [email protected] Roll Fuchsia Linux SDK from aVohW_hnfDaE0smBX... to zpBZmUB_JC5AjG-f4... (flutter/engine#53279) 2024-06-07 [email protected] Roll Dart SDK from 7b239d7f4578 to 4b693b16eec1 (1 revision) (flutter/engine#53277) 2024-06-07 [email protected] Roll Skia from b7f51dfcc342 to ad3c9f203f4e (1 revision) (flutter/engine#53276) 2024-06-07 [email protected] Roll Skia from 5fc83884a619 to b7f51dfcc342 (4 revisions) (flutter/engine#53275) 2024-06-07 [email protected] Revert "Widen CPU affinity set." (flutter/engine#53274) 2024-06-07 [email protected] Roll Skia from e36110f8b451 to 5fc83884a619 (1 revision) (flutter/engine#53273) Also rolling transitive DEPS: fuchsia/sdk/core/linux-amd64 from aVohW_hnfDaE to zpBZmUB_JC5A If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
This addresses a couple things:
flutter/flutter#147610 (Treat
autorenderer properly)flutter/flutter#149443 (Add an entrypoint base url config option)
This also adds a
useLocalCanvasKitconfiguration option on the build config, which the flutter tool can use to fix flutter/flutter#148713