Components are now a thin layer over template partials, compiling to calls to `render/3` and `render_layout/4` under the hood.
To upgrade your components the new syntax, you can copy your component markup and paste it into the `render/1` macro inside the component module and references to `@children` can be updated to `@inner_content`.
Components can are also referenced differently than before when using them. Before, one would simply call `flex` to render a component named `Flex`. Now, one must use the keyword `c` to render a component, passing the keyword the component module along with any assigns.
##### Before
```elixir
# definition
div class: "flex #{@class}" do
@children
end
# usage
flex class: "justify-between" do
for item <-@itemsdo
div do
item.name
end
end
end
```
##### After
```elixir
# definition
defmodule MyAppWeb.Component.Flex do
use Temple.Component
render do
div class: "flex #{@class}" do
@inner_content
end
end
end
# usage
alias MyApp.Component.Flex # probably located in my_app_web.ex
You can now use `mix temple.gen.live Context Schema table_name col:type` in the same way you can with Phoenix.
### Other
- Make a note in the README to set the filetype for Live temple templates to `lexs`. You should be able to set this extension to use Elixir for syntax highlighting in your editor. In vim, you can add the following to your `.vimrc`
```vim
augroup elixir
autocmd!
autocmd BufRead,BufNewFile *.lexs set filetype=elixir
-`Temple.Form.phx_label`, `Temple.Form.submit`, `Temple.Link.phx_button`, `Temple.Link.phx_link` now correctly parse blocks. Before this, they would escape anything passed to the block instead of accepting it as raw HTML.