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

feat: add support for host functions to browser runtime #306

Merged
merged 4 commits into from
Apr 25, 2023

Conversation

zshipko
Copy link
Contributor

@zshipko zshipko commented Apr 6, 2023

  • Adds ability to define host functions when creating ExtismPlugins in the browser runtime
  • The API is a little simpler than the Rust runtime
    • Functions don't handle userdata, userdata should be captured by the function declaration

@bhelx
Copy link
Contributor

bhelx commented Apr 6, 2023

Functions don't handle userdata, userdata should be captured by the function declaration

so you mean userdata should be captured through scope in the closure?

@zshipko
Copy link
Contributor Author

zshipko commented Apr 6, 2023

Functions don't handle userdata, userdata should be captured by the function declaration

so you mean userdata should be captured through scope in the closure?

yeah, I was debating how close it needs to be to the rust runtime. this was much simpler but I could add a userdata argument if you think it would be more usable.

@bhelx
Copy link
Contributor

bhelx commented Apr 6, 2023 via email

@zshipko
Copy link
Contributor Author

zshipko commented Apr 24, 2023

@bhelx, @nilslice: were either of you able to test this? I forgot I hadn't merged it yet and don't want to let this get stale!

@bhelx
Copy link
Contributor

bhelx commented Apr 24, 2023

@zshipko i will test tonight

@bhelx
Copy link
Contributor

bhelx commented Apr 24, 2023

Looks good to me @zshipko 👍

@zshipko zshipko merged commit 6bec3f8 into main Apr 25, 2023
@zshipko zshipko deleted the browser-host-functions branch April 25, 2023 15:42
@bhelx bhelx mentioned this pull request May 1, 2023
bhelx added a commit that referenced this pull request May 1, 2023
Publishes the latest changes, including #306
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.

None yet

2 participants