Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theinitialize_runtime
exported function and output the wizened module. It also runswasm-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 runcompile_src
orinvoke
will fail. We had three options for how to tackle this: (1) add an initialization command to Javy, (2) invokeinitialize_runtime
, or (3) expect plugin developers to runwizer
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
javy-cli
andjavy-core
do not require updating CHANGELOG files.