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 async/await & promise support to Bun runner #135

Merged
merged 2 commits into from
Mar 1, 2024

Conversation

reesericci
Copy link
Contributor

This PR adds support for async/await and promises for the Bun runner.

This allows for importing libraries using dynamic imports:

const Plot = await import("@observablehq/plot")

@reesericci reesericci marked this pull request as ready for review October 6, 2023 03:12
@casperisfine
Copy link

A test case would be appreciated.

@reesericci
Copy link
Contributor Author

How would I go about writing one? I've never written a ruby test before.

@byroot
Copy link
Member

byroot commented Oct 8, 2023

Have a look at the existing ones https://github.com/rails/execjs/blob/master/test/test_execjs.rb

Even with limited Ruby knowledge you should be able to figure out the structure. You just want to invoke some JS code that make use of an async function.

@reesericci
Copy link
Contributor Author

I did some cleanup on the code and added a test case

@byroot byroot merged commit ea4731d into rails:master Mar 1, 2024
17 checks passed
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.

3 participants