- 👍 Better whitespace control
You can now use a "bang" version of any nonvoid tag to forgo the internal whitespace.
span do "So much room for activities!" end # <span> # So much room for activities! # </span> span! do "It's a little cramped in here!" end # <span>It's a little cramped in here!</span>
- [breaking] Attributes who values are boolean expressions will be emitted as boolean attributes.
- Class "object" syntax. Conditionally add classes by passing a keyword list to the
🐛 Bug fixes
- Compile void elements with zero attrs #135
🐛 Bug fixes
- Only collect slots in the root of a component instance #127
👍 Temple now is written to be fully compatible with Phoenix LiveView! This comes with substantial internal changes as well as a better component API.
Temple now outputs LiveView compatible EEx at compile time, which is fed right into the normal LiveView EEx engine (or the traditional HTML Engine if you are not using LiveView).
Temple now has a more complete component API.
Components work with anywhere, whether you are writing a little plug app, a vanilla Phoenix app, or a Phoenix LiveView app!
👀 Please see the documenation for more information.
To migrate component from the 0.5.0 syntax to the 0.6.0 syntax, you can use the following as a guide
- Components can now use slots.
- Markup is 100% live view compliant.
@inner_contentis removed in favor of invoking the default slot.
- 🚚 The
compactreserved keyword for elements has been removed. This is not really intentional, just a side effect of getting slots to a usable place. I expect to add it back, or at least similar functionality in the future.
- Can pass a keyword list to be evaluated at runtime as attrs/assigns to an element.
- 🛠 Fix a bug where lists would not properly compile
- Compile functions/macros that take blocks that are not if/unless/for
👀 Please see the README for more details regarding the Component API