Skip to content

chore(ci): wasm release#168

Closed
stormslowly wants to merge 2 commits intomainfrom
fix/wasm_release
Closed

chore(ci): wasm release#168
stormslowly wants to merge 2 commits intomainfrom
fix/wasm_release

Conversation

@stormslowly
Copy link
Collaborator

No description provided.

@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on preparing for a WebAssembly (WASM) release and updating native dependencies. It upgrades the resolver binding versions across various platforms to 0.2.7, introduces a new option for Yarn Plug'n'Play manifest paths, and significantly refines the WebAssembly System Interface (WASI) binding loading and resolution mechanisms. These changes aim to improve the robustness and compatibility of native module loading, particularly for WASM environments, and ensure the build system correctly handles WASM target triples.

Highlights

  • Native Binding Version Update: Updated native binding versions for various platforms from 0.2.5 to 0.2.7, ensuring compatibility with the latest resolver binding.
  • Yarn Plug'n'Play Support: Introduced a new pnpManifest option in NapiResolveOptions to specify the path to a Yarn Plug'n'Play manifest file, enhancing resolution capabilities.
  • WebAssembly (WASI) Binding Improvements: Improved WebAssembly System Interface (WASI) binding loading logic, including more robust error handling and explicit support for forcing WASI via NAPI_RS_FORCE_WASI.
  • WASM File Path Resolution: Enhanced the resolution of the WebAssembly file path in resolver.wasi.cjs to correctly locate the WASM binding using require.resolve.
  • WASM Target Triple Parsing: Extended the parseTriple utility function to properly recognize and parse wasm32-wasi and related target triples, facilitating WASM build processes.
  • Dependency Lockfile Update: Synchronized pnpm-lock.yaml to reflect the updated native binding versions and the inclusion of WASM-related optional dependencies.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • napi/index.d.ts
    • Added pnpManifest property to NapiResolveOptions interface.
  • napi/index.js
    • Updated expected native binding versions from 0.2.5 to 0.2.7 for all supported platforms.
    • Modified WASI binding loading to check process.env.NAPI_RS_FORCE_WASI and improved error handling for WASI binding failures.
  • napi/resolver.wasi.cjs
    • Changed WASM file path resolution to use require.resolve for the specific WASM file.
  • pnpm-lock.yaml
    • Updated optional dependencies for @rspack/resolver-binding-* packages to version 0.2.7.
    • Added new package entries for various @rspack/resolver-binding-* versions, including wasm32-wasi.
  • scripts/prepublish.mjs
    • Modified parseTriple function to correctly handle wasm32-wasi and similar triples.
Activity
  • No human activity was recorded for this pull request.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request appears to be a maintenance task for a WASM release. It involves updating version numbers for various native bindings, adding a new pnpManifest option for Yarn PnP, and adjusting WASM asset loading logic. The changes are mostly straightforward version bumps and configuration additions. My review includes suggestions to improve maintainability by replacing a repeated hardcoded version string with a constant, and to enhance clarity in the TypeScript definitions by using conventional JSDoc terms.

/**
* Path to yarn Plug'n'Play manifest file.
*
* Default `None`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

In JSDoc for TypeScript, it's more conventional to use undefined to describe the default for an optional property. None is more common in other languages like Rust and might be confusing for JavaScript/TypeScript developers.

Suggested change
* Default `None`
* Default `undefined`

Comment on lines 83 to 91
if (
bindingPackageVersion !== "0.2.5" &&
bindingPackageVersion !== "0.2.7" &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
) {
throw new Error(
`Native binding package version mismatch, expected 0.2.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`
`Native binding package version mismatch, expected 0.2.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`
);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The version string "0.2.7" is hardcoded here and in many other places in this file. This makes it difficult to update and prone to errors. Consider defining it as a constant at the top of the file and reusing it.

For example:

const EXPECTED_BINDING_VERSION = "0.2.7";

// ...

if (
  bindingPackageVersion !== EXPECTED_BINDING_VERSION &&
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
) {
  throw new Error(
    `Native binding package version mismatch, expected ${EXPECTED_BINDING_VERSION} but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`
  );
}

@stormslowly stormslowly closed this Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant