Skip to content
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 init-plugin subcommand #798

Merged
merged 1 commit into from
Nov 1, 2024
Merged

Add init-plugin subcommand #798

merged 1 commit into from
Nov 1, 2024

Conversation

jeffcharles
Copy link
Collaborator

Description of the change

Adds a new subcommand called init-plugin. This subcommand will validate a Javy plugin and then initialize it by running Wizer on the initialize_runtime exported function and output the wizened module. It also runs wasm-opt on the resulting module. This does not include documentation changes as I want to tackle documentation changes more holistically to take into account all of the steps involved.

Why am I making this change?

Part of #768. Out-of-the-box plugins will not have a Javy runtime present in their runtime OnceCell so trying to run compile_src or invoke will fail. We had three options for how to tackle this: (1) add an initialization command to Javy, (2) invoke initialize_runtime, or (3) expect plugin developers to run wizer themselves with the correct arguments. (2) imposes an unacceptable performance penalty and (3) is prone to human error, so we've opted to go with (1).

Checklist

  • I've updated the relevant CHANGELOG files if necessary. Changes to javy-cli and javy-core do not require updating CHANGELOG files.
  • I've updated the relevant crate versions if necessary. Versioning policy for library crates
  • I've updated documentation including crate documentation if necessary.

@jeffcharles jeffcharles merged commit 40b6883 into main Nov 1, 2024
7 checks passed
@jeffcharles jeffcharles deleted the jc.add-init-plugin branch November 1, 2024 14:32
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.

2 participants