parse-community / Parse-SDK-Flutter

The Dart/Flutter SDK for Parse Platform
https://parseplatform.org
Apache License 2.0
575 stars 194 forks source link

parseIsWeb doesn't work on WASM #1018

Open sgehrman opened 1 month ago

sgehrman commented 1 month ago

const bool parseIsWeb = identical(0, 0.0);

fails on wasm.

Why not do the normal thing?

I see this code is dart and not flutter. Flutter does it this way which I assume works.

const bool parseIsWeb = bool.fromEnvironment('dart.library.js_util');

parse-github-assistant[bot] commented 1 month ago

Thanks for opening this issue!

mtrezza commented 4 weeks ago

@mbfakourii do you understand what is meant here?

mbfakourii commented 3 weeks ago

@mbfakourii do you understand what is meant here?

What they mean is the new wasm option, which is used to increase the output of Flutter Web.

This feature is currently at the beginning of the work and many packages still do not support this feature, including the dependencies that are in the Parse Flutter project.

mtrezza commented 3 weeks ago

Got it. So we'd need to wait until all the dependencies support the option before the Parse SDK can support it?

mbfakourii commented 3 weeks ago

Got it. So we'd need to wait until all the dependencies support the option before the Parse SDK can support it?

Yes, we should wait

mtrezza commented 3 weeks ago

Do we have to wait until all Parse SDK dependencies support the wasm option? Or is the issue only related to that one single code line that has been mentioned above, and is the solution to change

https://github.com/parse-community/Parse-SDK-Flutter/blob/a3449f4a1c4060f6afea71f50b204cb5e5a37bd2/packages/dart/lib/src/base/parse_constants.dart#L89

to

const bool parseIsWeb = bool.fromEnvironment('dart.library.js_util');

?

mbfakourii commented 3 weeks ago

Do we have to wait until all Parse SDK dependencies support the wasm option?

No, all dependencies need to be supported

mtrezza commented 3 weeks ago

I don't understand your response. Do you mean "Yes we need to wait for all dependency maintainers to support WASM, before we can support WASM?", or "No, we can make changes in our SDK to support WASM without waiting for the dependencies"?