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

Create plugin-api crate and move most of core's logic into it #795

Merged
merged 3 commits into from
Oct 31, 2024

Conversation

jeffcharles
Copy link
Collaborator

Description of the change

Adds a library crate named javy-plugin-api with a lot javy-core's logic. The idea is a Javy plugin developer should make their Javy plugin cdylib dependent on this javy-plugin-api crate and it will handle most of the exports for them and let them configure their runtime.

Why am I making this change?

Part of #768. We don't want every plugin developer to have to re-implement most of the existing logic in javy-core themselves so this provides a crate they can depend on so they don't have to re-implement the existing logic.

I'm opting to leave the allocation function definitions in the javy library crate for this PR. I'll move the functions in the next PR.

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 marked this pull request as ready for review October 30, 2024 20:48
Copy link
Member

@saulecabrera saulecabrera left a comment

Choose a reason for hiding this comment

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

A couple of nits, but overall LGTM!

@@ -11,10 +11,9 @@ crate-type = ["cdylib"]

[dependencies]
anyhow = { workspace = true }
javy = { workspace = true, features = ["export_alloc_fns", "json"] }
once_cell = { workspace = true }
javy-plugin-api = { workspace = true, features = ["json"] }
Copy link
Member

Choose a reason for hiding this comment

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

Is it intended to have this dependency at the workspace level? I think it's not shared across any other crates in the workspace, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I can move it out of the workspace into javy-core. For some reason I thought the javy crate was only used by javy-core but I can see after looking that the fuzzer also uses it.

crates/plugin-api/src/lib.rs Outdated Show resolved Hide resolved
@jeffcharles jeffcharles merged commit d4d6f07 into main Oct 31, 2024
7 checks passed
@jeffcharles jeffcharles deleted the jc.add-plugin-api-crate branch October 31, 2024 14:43
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