Skip to content

Commit cfc9bc2

Browse files
author
selenil
committed
bump v0.3.1
1 parent c167476 commit cfc9bc2

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@ Lissome is a library to integrate the [Gleam](https://gleam.run/) frontend frame
99

1010
First, make sure you have the Gleam compiler installed. Instructions can be found [here](https://gleam.run/getting-started/installing/)
1111

12-
1. Add `lissome` to your `mix.exs` file:
12+
1. Add `lissome` and `lustre` to your `mix.exs` file:
1313

1414
```elixir
1515
def deps do
1616
[
1717
...,
18-
{:lissome, "~> 0.3.0"},
18+
{:lissome, "~> 0.3.1"},
19+
{:lustre, "~> 4.6.3", app: false, manager: :rebar3}
1920
]
2021
end
2122
```
@@ -184,13 +185,14 @@ Check out the project in the `example` directory for a complete code example.
184185

185186
## SSR
186187

187-
Thanks to the ability of Gleam to compile to both Erlang and JavaScript, we can do server-side rendering of Lustre without having to install Node.js. We only need to make sure we compile the Gleam project to Erlang too. For that, add the `:gleam` compiler to your list fo compilers:
188+
Thanks to the ability of Gleam to compile to both Erlang and JavaScript, we can do server-side rendering of Lustre without having to install Node.js. We only need to make sure we compile the Gleam project to Erlang too. For that, install Lustre in your Elixir project and add the `:gleam` compiler to your list fo compilers:
188189

189190
```elixir
190191
# mix.exs
191192
def project do
192193
[
193-
compilers: Mix.compilers() ++ [:gleam]
194+
compilers: Mix.compilers() ++ [:gleam],
195+
deps: deps()
194196
]
195197
end
196198
```
@@ -229,6 +231,8 @@ The type your flags has must be public too. Lissome will use this type to constr
229231
/>
230232
```
231233

234+
Remember to add to your `mix.exs` file any other dependencies your Gleam project needs apart from Lustre and the Gleam standard library. You can add Gleam dependencies to Mix like any other dependency, but with the `app: false` and `manager: :rebar3` options.
235+
232236
## Communicating with Phoenix LiveView
233237

234238
`Lissome` includes helpers for communicating with a LiveView running in the server from Gleam code, using [Lustre's effects for managed side effects](https://hexdocs.pm/lustre/guide/03-side-effects.html). To enable this bidirectional communication, you need to construct your app with `lissome.application`. This is a wrapper around `lustre.application` that allows your `init` and `update` function to receive the LiveView hook instance as an argument. This instance could be used to communicate with the server by passing it to the functions in the `lissome/live_view` module.

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule Lissome.MixProject do
22
use Mix.Project
33

4-
@version "0.3.0"
4+
@version "0.3.1"
55

66
@repo_url "https://github.com/selenil/lissome"
77

0 commit comments

Comments
 (0)