Parse-SDK-Flutter icon indicating copy to clipboard operation
Parse-SDK-Flutter copied to clipboard

parseIsWeb doesn't work on WASM

Open sgehrman opened this issue 1 year ago • 15 comments

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');

sgehrman avatar Oct 24 '24 01:10 sgehrman

Thanks for opening this issue!

@mbfakourii do you understand what is meant here?

mtrezza avatar Oct 25 '24 09:10 mtrezza

@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.

mbfakourii avatar Oct 27 '24 09:10 mbfakourii

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

mtrezza avatar Oct 27 '24 15:10 mtrezza

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

mbfakourii avatar Oct 27 '24 15:10 mbfakourii

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');

?

mtrezza avatar Oct 29 '24 10:10 mtrezza

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

No, all dependencies need to be supported

mbfakourii avatar Oct 30 '24 03:10 mbfakourii

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"?

mtrezza avatar Oct 30 '24 13:10 mtrezza

Do we have a list of packages that does not support WASM and is a dependency?

2shrestha22 avatar Dec 08 '24 06:12 2shrestha22

Do we have a list of packages that does not support WASM and is a dependency?

Based on the reviews, we have a change in the parse_websocket_html.dart class. Also, the following packages need to be updated

package_info_plus: ^5.0.1 => package_info_plus: ^6.0.0

parse_server_sdk: ^6.4.0 in parse_server_sdk_flutter => last version

Dio must use dio_web_adapter: ^2.0.0 in last version

Note that package_info_plus must be updated according to our versioning policy.

mbfakourii avatar Dec 09 '24 05:12 mbfakourii

I would be happy to help to make it wasm compatible. May be I need know where to start from.

2shrestha22 avatar Dec 09 '24 05:12 2shrestha22

I would be happy to help to make it wasm compatible. May be I need know where to start from.

Most likely in Feb 2025 we will support Wasm.

mbfakourii avatar Dec 09 '24 05:12 mbfakourii

Why in Feb 2025? Is there anything blocking this done before that?

2shrestha22 avatar Dec 09 '24 05:12 2shrestha22

Why in Feb 2025? Is there anything blocking this done before that?

For our versioning policy.

mbfakourii avatar Dec 09 '24 15:12 mbfakourii

To clarify, you can submit a PR at any time, but when it can be merged depends on its implications on our compatibility policy.

mtrezza avatar Dec 10 '24 10:12 mtrezza