lustre-labs / lustre

An Elm-inspired framework for building HTML templates, single page applications, and server-rendered components in Gleam!
https://hexdocs.pm/lustre
MIT License
727 stars 52 forks source link

Question: Possible to use without lustre_dev_tools? #131

Closed johannesvollmer closed 1 month ago

johannesvollmer commented 1 month ago

Hi! Is there a simple way to launch a lustre app without using the lustre_dev_tools? (It seems to require Erlang.) Is there a way to include the compiler output in an HTML file? Sorry if this is a beginner question, I'm just starting out.

hayleigh-dot-dev commented 1 month ago

Gleam doesn't bundle JavaScript itself so you have two options:

You might find this blog post helpful. You might also want to ask on the gleam discord server, there are folks I know there that are using vite or other tools instead of lustre's dev tools and they may be able to help too :)


The absolute simplest thing you can do right now to get something on the screen is to:

this will get something showing in the browser at least :)

johannesvollmer commented 1 month ago

Thank you for your help and for taking the time. The blog post looks very valuable, and the code snippet looks delightfully simple.

For simple projects, not caring about old browsers or any optimization, would you recommend this simple setup, or would you not recommend this approach?

johannesvollmer commented 1 month ago

Would you accept a contributions to the lustre documentation concerning this approach?

hayleigh-dot-dev commented 1 month ago

Not right now, I don't have the bandwidth to make sure instructions like these are up-to-date or support users that get stuck taking that approach.

I'd like to encourage the community to write more blog posts and tutorials covering things like this, and over time I will come up with a way to surface them so other folks can find them. I own the lustre.build domain and am slowly working on a site that will feature community packages and blog posts.

johannesvollmer commented 1 month ago

Thank you again :) Cheers