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

JavaScript plugin support #5

Closed
olanod opened this issue Nov 24, 2020 · 2 comments
Closed

JavaScript plugin support #5

olanod opened this issue Nov 24, 2020 · 2 comments

Comments

@olanod
Copy link
Member

olanod commented Nov 24, 2020

Writing a JS plugin should be as easy as exporting an async function that receives a request and returns a response.

This issue tracks the required bits to make writing JS plugins easy like any helper libraries or code in the host that loads the scripts and runs the right function. For JavaScript support in the server see #12

@sezna
Copy link

sezna commented Dec 27, 2020

What exactly differentiates the work required for this issue from #12? It seems that in order for this to be sensible, the deno runtime must be integrated simultaneously. I'd like to attempt this once I get a better idea of what the desired architecture is here.

@olanod
Copy link
Member Author

olanod commented Dec 27, 2020

I think I'll probably close this issue once #10 is merged. This issue is about the API of how a JS plugin writer should expose his/her handler. I ended up tackling this as well in the PR by loading the JS or WASM plugin with the import('/some/module.js') and expecting the file to be a module that(at least for now) exports an async handler function that receives a JS Request and returns a JS Response, when written in Rust compiled to WASM the proc_macro converts the JS Request and Response to the http_types equivalents.
#12 is the real deal, it's the one to bring the JS runtime to the server side with Deno.

@olanod olanod closed this as completed Feb 12, 2021
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

No branches or pull requests

2 participants