Has anyone tried this roc-esbuild
repo? I get a failure when I run the test in the examples/
folder: https://github.com/vendrinc/roc-esbuild/blob/adc3b55592d962f5e38e9d0b653939c1a8eb2f53/examples/exclaim.test.js
+ Expected: "Hi, World!"
- Received: "\"Hi, World\"!"
I tried passing in a number to exclaim
and it works and gives back "123!"
as the result (no extra quotes). Strange because it says it is Str -> Str
: https://github.com/vendrinc/roc-esbuild/blob/adc3b55592d962f5e38e9d0b653939c1a8eb2f53/examples/src/main.roc#L6
I wonder if somewhere in the platform it's supposed to be a JSON value instead? https://github.com/vendrinc/roc-esbuild/blob/adc3b55592d962f5e38e9d0b653939c1a8eb2f53/examples/src/platform/main.roc#L2
Would appreciate any pointers if there is something in this example that is out of date!
@Richard Feldman
ah yeah it's probably out of date, I haven't worked on it in awhile :sweat_smile:
@Dillon Kearns what are you looking to do with it?
Hey Richard! Yeah, I figured it probably got a bit out of date. I was hoping to put together a little demo of directly invoking Roc code from elm-pages
using https://package.elm-lang.org/packages/dillonkearns/elm-pages/latest/BackendTask-Custom. That feature allows you to directly call NodeJS code from elm-pages as a BackendTask
and send/receive JSON data from an async function.
Would be extra cool if I could use glue (create a glue spec, is that the right term for that?) to automatically create those bindings.
Do you think it would be a better idea to try doing that using roc-esbuild
, or something else? elm-pages
does have a Vite integration, so I could define a Vite plugin there, not sure if that would be a good direction for it.
ah gotcha! Yeah if it's just sending JSON, I can take a look at updating the roc-esbuild
example
I might have time after work tonight or maybe tomorrow!
Sounds good! No rush, but if anything obvious sticks out then that would definitely be helpful!
Last updated: Jul 06 2025 at 12:14 UTC