-
Notifications
You must be signed in to change notification settings - Fork 130
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
add dart2wasm support #226
Conversation
This is a blocker at the moment: Which has been fixed. This should work with the next Version of dart. For non wasm compilition it should already work. So it could be merged in my eyes? |
@Ephenodrom Do you see any issues with this? |
@konsultaner I am not very familiar with Dart / Flutter on web, due to i only use it on CLI or for apps running on different operating systems, therefore my knowledge is limited but I see no problem with the PR. I will check the unit tests and see if they are good. |
@konsultaner There are several tests that fail with the following error : "Failed to load "test/stream/eax_test.dart": The "buf" argument must be an instance of ArrayBuffer or ArrayBufferView. Received an instance of Array". Please take a look. The tests are run with "dart run test -p node" and use the latest dart version 3.3.1 |
@Ephenodrom I'm on it. I forgot to test it with node. seems a bit tricky, but I know why the tests fail. |
@Ephenodrom I fixed it. Could you try again? I just also want to notice that you might want to change |
@konsultaner This looks good so far. I already merged the PR in the origin repo. When I run the test for the node environment via "dart run test -p node ", there are some tests that fail. Is this intended at the moment? |
@Ephenodrom no it is not intended. It should not fail at all. Thats strange. All tests were successful when I tested it locally. Ill have another look at it. Could you run the github Actions again? |
@Ephenodrom I checked everything again and ran What errors do you get? |
@konsultaner I receive for example the following error : 00:28 +119 -1: loading test/key_generators/rsa_key_generator_test.dart [E]
Failed to load "test/key_generators/rsa_key_generator_test.dart": Value of "this" must be of type nullish or must be the global object
org-dartlang-sdk:///lib/_internal/js_runtime/lib/js_string.dart 202:5 global.cryptoThisCheck
org-dartlang-sdk:///lib/_internal/js_runtime/lib/math_patch.dart 253:9 _JSSecureRandom._JSSecureRandom
org-dartlang-sdk:///lib/_internal/js_runtime/lib/math_patch.dart 251:3 <fn>
org-dartlang-sdk:///lib/_internal/js_runtime/lib/math_patch.dart 74:30 PlatformWeb.PlatformWeb
package:pointycastle/src/platform_check/web.dart 15:3 <fn>
package:pointycastle/src/platform_check/web.dart 65:39 _generationTests.<fn>.<fn>.<fn> |
@Ephenodrom I tried it again on node 21.7.1, dart 3.1.1 on linux with the command:
And the same result, all tests run perfectly. Could you please start the workflow to have the github ci test it too? |
@konsultaner The checks look good so far. I have contacted someone from bouncycastle to sync the repository, if this is done I will create a new release on pub.dev. I keep you updated. |
@konsultaner The changes are now live on pub.dev with version 3.8.0. Thank you very much for the PR. |
It's including the js package, so it's not WASM compatible. Please fix. dart:js_interop, which replaces package:js and dart:js |
@sgehrman I can't find either of the old packages in the current code. Please link the code, so I can fix it. |
fixes #221
Random.secure()
needs to be fixed by the sdk team