packages
packages copied to clipboard
[camera_web] Migrate to `package:web`
Fixes https://github.com/flutter/flutter/issues/139748
Notes:
- Some fields are no longer nullable in
package:web. We need to decide if we want to make them nullable again.
Pre-launch Checklist
- [x] I read the Contributor Guide and followed the process outlined there for submitting PRs.
- [x] I read the Tree Hygiene page, which explains my responsibilities.
- [x] I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use
dart format.) - [x] I signed the CLA.
- [x] The title of the PR starts with the name of the package surrounded by square brackets, e.g.
[shared_preferences] - [x] I linked to at least one issue that this PR fixes in the description above.
- [x] I updated
pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes. - [x] I updated
CHANGELOG.mdto add a description of the change, following repository CHANGELOG style, or this PR is exempt from CHANGELOG changes. - [x] I updated/added relevant documentation (doc comments with
///). - [x] I added new tests to check the change I am making, or this PR is test-exempt.
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel on Discord.
I figured out how to run the tests compiled to WASM. Working on resolving the issues.
Alright I think all the tests pass when compiled to WASM now
The example app is having this issue: https://github.com/flutter/flutter/issues/146539
I figured out how to run the tests compiled to WASM. Working on resolving the issues.
@Rexios80 Please describe? :)
@ditman it's just flutter drive -d chrome --wasm
Probably requires master channel
This is just a reminder to myself to merge with main and update https://github.com/flutter/packages/blob/main/script/configs/exclude_all_packages_app_wasm.yaml to remove this plugin from the exclusions
(away from dev computer right now)
Will work on this next, will try to get the update with main done and review locally. Thanks @Rexios80!
Force-pushed the rebase, but I think I broke:
integration_test/zoom_level_capability_test.dart is being served at http://localhost:7357
It seems to be timing out :/
I'm not sure what the Flutter team's policy is for rebase vs merge commits but I much prefer merge commits for the future if that's okay with you. It appears that the rebase invalidated my commit signing and we also lost easy access to the old CI runs.
@ditman It runs fine for me individually
Okay the test hangs locally too... but the Chrome dev console says the tests pass
This app is linked to the debug service: ws://127.0.0.1:64966/3_JgbVVF6ak=/ws
dart_sdk.js:37972 00:00 +0: CameraWebException sets all properties
dart_sdk.js:37972 00:00 +1: CameraWebException toString includes all properties
dart_sdk.js:37972 00:00 +2: (tearDownAll)
dart_sdk.js:37972 00:00 +3: All tests passed!
:7357/$dwdsSseHandler?sseClientId=InjectedClient-25923bcd-467a-457b-98b1-ba47d869a2ac:1
Failed to load resource: net::ERR_CONNECTION_REFUSED
Is this an issue with the test driver?
Related to https://github.com/flutter/flutter/issues/151561#issuecomment-2226200260 maybe?
This is happing in a PR without these changes so it's not this PR's fault
https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8742583604102720209/+/u/Run_package_tests/drive_examples/stdout
I much prefer merge commits for the future if that's okay with you.
Yep, apologies @Rexios80, I normally only rebase in my own branches or things that are "one commit away" from landing, didn't mean to mess the branch too badly!
About running the tests in --wasm, it's a nice to have, but shouldn't be a blocker. Maybe the test that I saw hanging happened because my flutter master wasn't new enough to get the --canvaskit fixes (?).
I'll come back to this PR ASAP!
@ditman The reason I think WASM integration tests should block this is because I'm 100% sure they are failing even if the canvaskit tests pass. I think https://github.com/flutter/flutter/issues/146539 is the biggest issue right now for compiling plugins to WASM that have platform views. I'm willing to bet every single plugin that deals with platform views has failing WASM integration tests because of that issue.
Actually it looks like a possible fix for that issue was recently merged. Let me test it.
Welp video_player_web needs updated to package:web version 1.0.0 to test that. I'm really confused how the example is even resolving dependencies right now. Isn't 0.x.x to 1.x.x supposed count as a major version increase? But somehow the example is resolving web: 1.0.0 even though video_player_web depends on a 0.x.x version?????? Which is causing compile time errors. Is this known behavior? If not that's a pretty bad bug in dependency resolution.
The pub get is failing in CI which is even more confusing. I'm on the latest Flutter commit locally and flutter pub get succeeds in packages/camera/camera/example and resolves web: 1.0.0
I have some good news! The fix for platform view rendering seems to work for google_maps_flutter at least. You can see it in action here: https://beta.madadmaps.com/
I'm still having issues with pointer_interceptor when compiled to WASM. Maybe WASM integration tests would help catch that issue? Tracking here: https://github.com/flutter/flutter/issues/152109
Welp
video_player_webneeds updated topackage:webversion1.0.0to test that. I'm really confused how the example is even resolving dependencies right now. Isn't0.x.xto1.x.xsupposed count as a major version increase? But somehow the example is resolvingweb: 1.0.0even thoughvideo_player_webdepends on a0.x.xversion?????? Which is causing compile time errors. Is this known behavior? If not that's a pretty bad bug in dependency resolution.
It's actually resolving the version of video_player_web before package:web was added which is... I guess technically correct? But quite unfortunate.
I'm still having issues with pointer_interceptor when compiled to WASM. Maybe WASM integration tests would help catch that issue? Tracking here: https://github.com/flutter/flutter/issues/152109
This is being currently looked at (by @eyebrowsoffire), IIRC this is also affecting dart devtools, so it's a high priority!
It's actually resolving the version of video_player_web before package:web was added which is... I guess technically correct? But quite unfortunate.
Yikes, I didn't see this one coming, I guess there can be multiple plugins with the same issue with the way that we version. I'll see what's up with the package:web 1 stuff.
Because every version of cross_file from path depends on web ^0.5.0
and every version of camera_web from path depends on web ^1.0.0,
cross_file from path is incompatible with camera_web from path.
I'm going to try and create a migration from web:^0.5.0 to ^1.0.0, so this change lands more smoothly.
@ditman You'll probably have to migrate all packages to web 1.0.0 to fix that error. That's just the first issue dependency resolution ran into. There's an issue to track that migration here: https://github.com/flutter/flutter/issues/151981
Getting
UnimplementedError: CrossFile is not available in your current platform.
when running integration tests compiled to WASM. Caused by cross_file not supporting web: 1.0.0 yet.
Blocked on
- https://github.com/flutter/packages/pull/7202
https://github.com/flutter/packages/pull/7202 is ready to land.
https://github.com/flutter/packages/pull/7202 landed!
@ditman Is there an issue to track cleaning up code related to script/configs/exclude_all_packages_app_wasm.yaml after this PR lands?
@Rexios80 just created this one:
- https://github.com/flutter/flutter/issues/152716
(I have some time, I'm going to rebase this branch to make it match the rest of the repo!)
type 'Null' is not a subtype of type 'YamlList' in type cast
...
#6 PackageCommand._expandYamlInPackageList (package:flutter_plugin_tools/src/common/package_command.dart:292:8)
#7 PackageCommand.getExcludedPackageNames (package:flutter_plugin_tools/src/common/package_command.dart:298:9)
...
Hehe, looks like the tool doesn't like the exclusion yaml file to be completely empty!