-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[flutter_svg] wasm compatibility #8014
Changes from 3 commits
6c3cc75
7b397a4
6a62471
d857895
5784d44
4c522e1
435719f
d2cfe33
2f2e450
bcfe1ea
3721055
6029722
32fbf69
0ca88ce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
## 1.1.14 | ||
|
||
* Makes the package WASM compatible. | ||
|
||
## 1.1.13 | ||
|
||
* Fix execution on the web with WebAssembly. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ | |
# See https://github.com/flutter/flutter/issues/157626 before publishing a new | ||
# version. | ||
publish_to: none | ||
version: 1.1.13 | ||
version: 1.1.14 | ||
|
||
environment: | ||
sdk: ^3.4.0 | ||
|
@@ -22,7 +22,7 @@ dev_dependencies: | |
flutter_test: | ||
sdk: flutter | ||
# See https://github.com/flutter/flutter/issues/157626 | ||
vector_graphics_compiler: ">=1.1.11+1 <= 1.1.12" | ||
vector_graphics_compiler: ">=1.1.11+1 <= 1.1.13" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1.1.13 doesn't exist; what's the purpose of this change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the same as #8014 (comment) |
||
|
||
platforms: | ||
android: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,9 +18,9 @@ import 'src/svg/theme.dart'; | |
import 'src/vector_instructions.dart'; | ||
|
||
export 'src/_initialize_path_ops_io.dart' | ||
if (dart.library.html) 'src/_initialize_path_ops_web.dart'; | ||
if (dart.library.js_interop) 'src/_initialize_path_ops_web.dart'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
(It feels a little bit weird to export "web" first though, but that's just me because I've almost always started from a mobile implementation!) |
||
export 'src/_initialize_tessellator_io.dart' | ||
if (dart.library.html) 'src/_initialize_tessellator_web.dart'; | ||
if (dart.library.js_interop) 'src/_initialize_tessellator_web.dart'; | ||
export 'src/geometry/basic_types.dart'; | ||
export 'src/geometry/matrix.dart'; | ||
export 'src/geometry/path.dart'; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ | |
# See https://github.com/flutter/flutter/issues/157626 before publishing a new | ||
# version. | ||
publish_to: none | ||
version: 1.1.12 | ||
version: 1.1.13 | ||
|
||
executables: | ||
vector_graphics_compiler: | ||
|
@@ -36,7 +36,7 @@ dev_dependencies: | |
sdk: flutter | ||
test: ^1.20.1 | ||
# See https://github.com/flutter/flutter/issues/157626 | ||
vector_graphics: ">=1.1.11+1 <= 1.1.12" | ||
vector_graphics: ">=1.1.11+1 <= 1.1.14" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1.1.14 doesn't exist yet, so we don't know if it'll be compatible under the versioning system There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not on pub.dev, but I just bumped it here https://github.com/flutter/packages/pull/8014/files#diff-ae3c1055bc547ec174edea702c972431d2d3d46fb9bd78a31378cacf0fd051eaR8 If I don't bump the constraints here, how is it supposed to work? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, I missed that you were changing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're right. Didn't notice someone already made vector_graphics wasm compatible. I just fixed the dev_dependency constraint to use the minimum the WASM version. Do you prefer another PR for a single line change (just dev_dependency)? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As long as the changes aren't interdependent, they can be in a single PR. If there are still any cases where you need to both change a package, and change the minimum dependency on that package in another package, that must be multiple PRs because it won't compile in CI. If you're only changing a dev dependency in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't 1.1.13 the minimum required for wasm compatibility? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. vector_graphics was already at 1.1.13, I bumped it to 1.1.14 but the v1.1.13 was not used here, no idea why There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You bumped the maximum, not the minimum. The CHANGELOG entry says this PR makes the package wasm compatible, which would generally involve also setting the minimum versions of any dependencies to wasm-compatible versions. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're right, updated it right now |
||
vector_math: ^2.1.2 | ||
|
||
platforms: | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1 +1 @@ | ||||||
export '_file_io.dart' if (dart.library.html) '_file_none.dart'; | ||||||
export '_file_io.dart' if (dart.library.js_interop) '_file_none.dart'; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sadly, this might still rank this package as NOT wasm-compatible in pub due to issues with configuration specific imports. Better to do
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Other PRs that this one relies on have already landed using this version since #8014 (comment) didn't raise any objection. Could you elaborate on the issue? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No I can confirm this works because I did it with the fork I published, flutter_svg_plus You can check the platform support inside the score here https://pub.dev/packages/flutter_svg_plus/score There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have no doubt that it works at runtime. I'm concerned that the wasm classification on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See https://pub.dev/api/packages/flutter_svg/metrics Search for package:flutter_svg/src/utilities/file.dart There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you think the score for wasm on pub.dev is wrong, I assure you it is not. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm confused; I don't see anything in that issue that says that a conditional import based on
Why are we looking at the published version of |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ name: flutter_svg | |
description: An SVG rendering and widget library for Flutter, which allows painting and displaying Scalable Vector Graphics 1.1 files. | ||
repository: https://github.com/flutter/packages/tree/main/third_party/packages/flutter_svg | ||
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+flutter_svg%22 | ||
version: 2.0.11 | ||
version: 2.0.12 | ||
|
||
environment: | ||
sdk: ^3.4.0 | ||
|
@@ -13,9 +13,9 @@ dependencies: | |
sdk: flutter | ||
http: ^1.0.0 | ||
# See https://github.com/flutter/flutter/issues/157626 | ||
vector_graphics: ">=1.1.11+1 <= 1.1.12" | ||
vector_graphics: ">=1.1.11+1 <= 1.1.14" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same notes here as in the other package. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the same as #8014 (comment) |
||
vector_graphics_codec: ">=1.1.11+1 <= 1.1.12" | ||
vector_graphics_compiler: ">=1.1.11+1 <= 1.1.12" | ||
vector_graphics_compiler: ">=1.1.11+1 <= 1.1.13" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same question here as in the other package. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the same as #8014 (comment) |
||
|
||
dev_dependencies: | ||
flutter_test: | ||
|
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 code was changed for wasm support in #7991; why is it being re-changed here?
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.
Because I didn't now this one works too, I always used the inverse with
dart.library.js_interop
to be consistent