second-state / wasmedge-quickjs

A high-performance, secure, extensible, and OCI-complaint JavaScript runtime for WasmEdge.
Apache License 2.0
494 stars 60 forks source link

support rust async && support https client #107

Closed L-jasmine closed 10 months ago

juntao commented 1 year ago

Hello, I am a code review bot on flows.network. Here are my reviews of code commits in this PR.


Overall Summary:

The pull request includes several key changes, such as support for Rust async and support for HTTPS client. There are potential issues and errors that need to be addressed.

In the first pull request, there are potential problems related to the renaming of the "socket" function, modification of the Cargo.toml file, and updates to the examples and modules. The changes to multiple files and the commented-out code in the examples should also be reviewed.

In the second pull request, potential problems arise from the bumped version of libquickjs.a and the removal of constants in the binding.rs file. More context and explanations for these changes would be helpful.

The third pull request introduces potential problems with changes to multiple files, the large number of insertions and deletions, and the introduction of a new file "src/quickjs_sys/js_promise.rs". The updated and added dependencies should be reviewed, along with the purpose of the new "aho-corasick" dependency.

The fourth pull request raises concerns about the absolute path in the .cargo/config.toml file, the use of "println!" statements for debugging purposes, and the presence of commented-out sections in the code.

In the fifth pull request, issues arise from the use of "println!" statements, modifications to the fread and fwrite functions, and the lack of support for Rust async or HTTPS client as mentioned in the title.

Finally, the sixth pull request sees potential problems due to the absence of tests for the new HTTPS functionality, changes to multiple files, the removal of src/event_loop/poll.rs, changes to the Cargo.toml and Cargo.lock files, and conditional changes related to the "tls" feature.

Overall, there are common themes among the pull requests, such as the lack of sufficient explanations, potential issues with dependencies, and the need for proper testing. It would be beneficial to address these issues and provide more context to improve the review process and ensure the quality of the code changes.

Details

Commit 7547923419e957a8a5ad0b2f6207b1f467d0252f

Key changes:

Potential problems:

Commit 6309458867ca7357999ae58417fda8c95c07ace8

Key Changes:

Potential Problems:

Overall, it would be beneficial to have more context and explanation for the changes made in this patch.

Commit 8590011a7c945f951d22b1216eba656b8b51a9e4

Key changes:

Potential problems:

Additional Review Comments:

Commit 41c92700ee5450d5f1f0f53cea1ae700d986732c

Key changes:

Potential problems:

  1. The .cargo/config.toml file changes the target to a specific path. It is unusual to include an absolute path in the configuration file. This might make the code harder to run or use in different environments.
  2. The addition of println! statements is helpful for debugging, but they should not be included in a production-ready codebase. It's important to remove or comment out these statements before merging the code.
  3. There are commented-out sections in the code, such as the main function and parts of the async_run_with_context implementation. These sections should be reviewed to ensure they are not relevant to the changes being made.

Overall, the patch contains changes that are mainly related to debugging and target configuration. It would be beneficial to address the potential problems mentioned above before merging the code.

Commit ebad9e7487507f9d7e05676772db98c46c265afc

Key Changes:

Potential Problems:

Commit e0c237ec7379e49d8c3240cdd2f3ab16876f18bb

Key Changes:

Potential Problems:

Overall, the patch introduces HTTPS support and adds a new dependency for handling TLS connections. However, it would be good to address the potential problems mentioned above before merging the changes.

Commit e724d981ad3ebe14425d7ca3eb8bd1d8c69cf726

Key Changes:

Potential Problems:

  1. The patch updates the version of WasmEdge without providing any information about why this change is necessary. It's unclear if this change might introduce compatibility issues or other problems.
  2. There is a mismatch between the version mentioned in the download link for the WasmEdge plugin (0.12.0-alpha.1) and the updated version of WasmEdge (0.13.3). This might be an error or oversight.
  3. It's unclear why the Rustls plugin is being downloaded and installed. The purpose and impact of this change should be documented.
  4. The patch moves the Rustls plugin to /usr/local/lib/wasmedge/, but it's unclear if this is the correct location or if any additional configuration steps are required.
  5. The Https fetch example job is added without any explanation of its purpose or expected behavior. Additional details should be provided.
  6. The timeout-minutes for the Node fs module test job is changed from 10 to 15, but there is no explanation for this change. The reason for the increased timeout should be clarified.

Commit b38cf2cae2db76d60831dd7926d8c0dfe40b6e36

Key changes:

Potential problems:

Overall, the change seems minor, but it is important to ensure that the relative path resolves correctly and verify the reason behind the change.

Commit 74d2016ac8abeda156c0696ec7d19b90b96469db

Key changes:

Potential problems:

Commit 8e3920075a11b4d5e2fe0d90a0763fba394b10f1

Key Changes:

Potential Problems:

Commit 4afed4460a0db22be1b16d2bbfc83d328e3cefae

Key Changes:

Potential problems:

Suggestions:

chenhdc commented 10 months ago

@L-jasmine hi,I have a question, how to compile QuickJs to libquickjs.a? use wasi-sdk-20? Looking forward to your reply, thanks