Closed tankorsmash closed 1 month ago
Howdy! Gleam is not designed to have a single project handle separate erlang/javascript applications. It sounds like you might be doing some full-stack work and want to use Lustre for the frontend?
In these cases the best approach is a monorepo-style project where you have separate Gleam projects for both your frontend and your backend.
Thank you, that makes sense!
Hey!
I'm not sure if the terminology is correct but I'm trying to integrate lustre into my toy Gleam app, and it makes use of several Erlang-dependant things, like processes, its http client etc. I had thought my hello world Lustre wouldn't care because it doesn't import any of that stuff, but compiling my Gleam project with javascript as a target fails. This question might be better suited for Gleam itself, rather than Lustre, but just in case:
gleam run -m lustre/dev build
seems to call something likegleam run -t javascript
which fails. I can get around it by annotating certain functions with@external(javascript, "EMPTY", "EMPTY")
but that is pretty sloppy, and my imports toerlang/process
still fail.Should I absolutely avoid using any Erlang things at all with my Lustre app?