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

Embeded gleam into k6 extension #3

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

wingyplus
Copy link
Contributor

@wingyplus wingyplus commented May 13, 2024

Add a k6 extension to transpile gleam source into javascript and bundling it with k6pack, a wrapper api around esbuild.

How to build

$ cd xk6-gleam
$  xk6 build v0.50.0 --with github.com/tsloughter/k6_gleam/xk6-gleam=. --output k6

The k6 binary will present under xk6-gleam. You can use that binary to run gleam source under gleam project.

@wingyplus wingyplus marked this pull request as draft May 13, 2024 16:29
@tsloughter
Copy link
Owner

Ooops, meant to put the "take more time to review" comment on this one :)

Does this PR replace the others?

@wingyplus
Copy link
Contributor Author

Ooops, meant to put the "take more time to review" comment on this one :)

Does this PR replace the others?

It based on #1, so we can that PR first and continue working on this. :)

@tsloughter
Copy link
Owner

tsloughter commented May 14, 2024

k, done (with the merge of #1)

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
* Get rid of `k6/build.gleam` and `k6/internal.gleam`.
* Remove runner_js scaffolding out of `k6/new.gleam`.
* Runner js is now removed.

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
@wingyplus wingyplus marked this pull request as ready for review May 14, 2024 19:35
wingyplus added 3 commits May 15, 2024 02:36
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
@wingyplus
Copy link
Contributor Author

The PR is now ready to review. Here is the summarize:

  • k6/build got removed in flavor of xk6-gleam.
  • k6/run is now generate only Gleam file, no runner js.
  • xk6-gleam is the extension of the k6 to build gleam source file and load it into k6 during run. The extension needs to pack by xk6 to produce k6 extension bundled command.

@tsloughter
Copy link
Owner

@wingyplus this got merged grafana/k6#3456 -- I think it gives us more options?

@wingyplus
Copy link
Contributor Author

wingyplus commented Aug 4, 2024

@tsloughter yes, the esbuild is not necessary now. 🎉🎉

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