- Fix dialyzer errors
- Support Liveview
v0.18
- Fix dialyzer errors
- Add
:globalpseudo-class to the Scoped CSS's API - Declare props
container,sessionandstickyonSurface.LiveView - Fix CSS tokenizer not handling empty strings
- Fix CSS parser for declarations with commas or variants
- Fix scoped styles on void elements
- Fix dialyzer issue in EExEngine (#655)
- Remove compile-time deps from components, avoiding unnecessary recompilation of extra files due to transitive deps (#653)
- Fix components oversized beam files (#651)
- Fix error on layout templates containing
<style>
- Fix surface compiler when setting a different
css_output_file(#646) - Fix formatter for
:debug
- Support scoped CSS styles for components using either inline
<style>tags or colocated.cssfiles (#621) - Add
render_sface/1to allow overridingrender/1and compute/update assigns when using external.sfacefiles - Add
--tailwindoption tomix surface.initto bootstrap a project with TailwindCSS support - Add
--layoutsoption tomix surface.initto replace.heexlayout files with corresponding.sfacefiles - Add
--web-moduleoption tomix surface.initto override the default web module (#638) - Support using the
:hookdirective to point to thedefaulthook exported in the.hooks.jsfile - Add option
from_contexttopropanddatato allow setting values directly from the context - Add
Context.put/3andContext.get/2to allow manipulating the context inside lifecycle callbacks andrender/1 - Add prop
context_putto<#slot>to pass context values directly to a slot without propagating context values to other components - Add config
:propagate_context_to_slotsto restrict context propagatiion, optimizing diff tracking - Add functions
Context.copy_assign/3,Context.maybe_copy_assign/3andContext.maybe_copy_assign!/3 - Add
catalogue_test/1macro to generate basic tests for catalogue examples and playgrounds - Add module
Surface.Catalogue.Examplesto allow defining multiple stateless examples in a single module - Support editing slot values as text in playgrounds (Catalogue)
- Fix context propagation in dynamic components
- Fix context propagation in recursive components
- New API for Slot arguments and generator (#613)
- Deprecate
<InputContext>in favor of declarative optionfrom_context - Slots (#613)
- Option
:argshas been deprecated, useslot arg: :stringinstead ofslot args: [:name]slot arg: %{name: :string, age: number}instead ofslot args: [:name, :age]
- Attribute
forhas been deprecated, use<#slot {@header}>instead of<#slot for={@header}> - Attributes
nameandindexhave been deprecated, use<#slot {col}>instead of<#slot name={"col"} index={index}> - Directive
:argshas been deprecated, use<#slot {@default, name}>instead of<#slot :args={name: name}><#slot {@default, name: name, age: age}>instead of<#slot :args={name: name, age: age}>
- Option
- Drop support for Elixir <
v1.12 - Context values are no longer automatically propagated through slots. Components that need to
pass values to the parent scope via slots must explicitly set
propagate_context_to_slots: truein their configuration - Slots (#613)
- New option
:generator_propuseslot default, generator_prop: :itemsinstead ofslot default, args: [item: ^items], associated prop:itemsmust be of type:generator - New attribute
generator_valueuse<#slot generator_value={item} />instead of<#slot :args={item: item} /> <#template slot="slot_name">has been removed in favor of<:slot_name>(#575)
- New option
- Support Elixir
v1.14
- Support using vanilla phoenix function components with slots in surface templates
- Optimize the surface compiler for assets generation
- Improve support for JS hooks in umbrella projects (#591)
- Suppress
Mix.Tasks.Formatbehaviour warning on Elixir <v0.13
- Fix loading component prop's default values
- Support more extensions other than
.jsas colocated hooks (jsx,tsandtsx) (#576) - Update the
surface.inittask to set up the catalogue tov0.4
- Fix wrong target handling in forms
- Fix setting
@moduledoc falsein catalogue examples (#565) - Support Inputs' property
foras string (#564)
- Support Liveview
v0.17 - Support rendering
.sfacetemplates for regular (dead) views (#543) - Support passing properties to slots using the shorthand format, e.g.
<:col label="Name"> - Add built-in formatter supporting integration with
mix format(#535) - New
<LiveComponent>component to inject dynamic live components (#518) - Optimize rendering of HTML class attributes literals so they can be treated as static text
- Add property
forto<#slot/>so it can render the slot content directly (without usingindex)
- Add
surface_formatterdependency tomix.exswhen runningmix surface.init(#507) - Allow
Inputscomponent inside theFieldcomponent (#492) - Fix using context with external
.sfacetemplates (#511) - Fix attribute name conversion (#512)
- Compatibility with Phoenix
v1.6and Liveviewv0.16 - New
mix surface.inittask - Add support for function components
- Add support for dynamic function components via
<Component> - Add support for recursive function components
- Optimize change tracking for contexts
- Fix race condition when compiling tests
- Fix recompilation of used components
- Add property
valuesto form inputs - Handle doctype as text
- Improve error message when
default_translatoris not configured forErrorTag(#449) - Raise on invalid attribute/directive in
<#slot>(#456) - Raise error on
{#case}without{#match}(#443) - Raise on blocks without expression
- Fix error line on missing closing tag
- Add
<:slotname>shorthand for<#template slot="slotname"> - Introduce block expressions for surface templates (e.g.,
{#if}..{/if}) - Introduce
{#if}block expression with support for{#elseif}and{#else}sub blocks - Introduce
{#for}block expression with support for{#else}sub block - Introduce
{#unless}block expression - Introduce new shorthand notation for dynamic attributes/props using the
{... }tagged expression - Introduce new shorthand notation for attribute assignment using the
{= }tagged expression - Support private comments using
{!-- --}for comments that are not supposed to hit the browser - Introduce
s-prefix as an alternative to:for directives (i.e.s-ifand:ifare now equivalent) - Introduce
:valuesdirective for generating multiplephx-value-attributes - Added a convert task to aid migrating to the new syntax
- Evaluate literal attribute values at compile time instead of runtime
- Fix compile error when using single quotes as attribute value delimiters
- Add
quote_surface/2macro to generate Surface AST from template snippets.
- Replace the sigil
~Hwith~Fto avoid conflict withHEEx - Replace interpolation delimiters
{{and}}with{and} - Remove support for interpolation inside
<style>...</style>and<script>...</script>nodes - ErrorTag: Renamed prop
phx_feedback_fortofeedback_for - Slot directive
:propshas been renamed to:args - Option
:propsfor theslot/2macro has been renamed to:args - The use of
<template>has been removed in favor of<#template> - The use of
<slot>has been removed in favor of<#slot> - The use of
<If>has been removed in favor of{#if}...{/if} - The use of
<For>has been removed in favor of{#for}...{/for} MacroComponent.eval_static_props!/3evaluates and returns only props with optionstatic: true
- Support for passing non-string attribute values as literals (i.e.
selected=trueortabindex=3) has been removed. Any non-string value should be passed as an expression (i.e.selected={true})
- Fix warning on Phoenix Live View >= 1.15.6
- Call render when defined in slotable components (#283)
- Support defining form fields as strings. Consequently, fields defined as literal strings will
no longer be auto-converted to
:atomand will keep the original value (#319) - Deprecate auto-conversion of attribute values passed as string literals into atoms
- Do not encode HTML entities when passing attribute values as string literals (#323)
- Extract the Markdown macro component in its repository (#316)
- Renamed
Surface.Components.ButtontoSurface.Components.Link.Button(#350)
- Warn if prop is required and has default value (#282)
- Warn if slot is required and has a fallback content (#296)
- Warn on
LiveComponentwith anotherLiveComponentas root - Support escaped three double-quotes in
Markdowncontent - Improve
Labelcomponent compatibility with Phoenixlabel/2(#284) - Update props according to new types (#297)
- Fix copying JS hooks multiple times (#294)
- Fix
index.jsgeneration when no hooks are available - Fix loading hooks from dependencies
- Support
<Link>with scheme (#273)
- Autoload JS hooks via new surface compiler (#271)
- New
<Link>and<Label>implementation without depending oncontent_tagto allow receiving child components in slots (#264) - Don't validate undefined assigns outside render (#263)
- Load subject's default props values before sending them to playgrounds
- Allow different catalogue options for examples and playgrounds
- Introduce new testing API using
render_surface/1 - Add experimental support to create examples and playgrounds for catalogues
- Raises compile error if slots are not declared
- Raises compile error on duplicate built-in assign
- Allow defining the assign name for slot through the :as option (#230)
- Implement the
:showdirective via hidden attribute (#244) - Add new
<DateSelectComponent>component - Remove default value from
Formmethod prop - Reintroduce opts prop for the
<Select>component - Fix markdown syntax warning in
<Form>docs - Fix error when using :if + :props in slots (#224)
- Fix line offset when using single-line
~Hvariants (#246) - Fix UnicodeConversionError when using string literals inside interpolation
- Add explicit props for the main opts of Checkbox, Select, MultipleSelect, FileInput and Form (#215).
- Add new
slot_assigned?/1macro to check if a slot has been filled in (#211). - Fix attribute value encoding
- Update liveview to v0.15
- Add new
Surface.Components.Form.ErrorTagto render error messages in forms (#199). - Disable validation for required props if
:propsis passed (#204)
- Update liveview to latest v0.15-dev (f986171)
- New wrapper components
Surface.Components.{For, If}for when the:forand:ifdirectives aren't sufficient (#184) - Allow double braces within interpolation (#171)
- Add new
Surface.Components.FieldContextto support form fields without wrapping divs (#172) - Improve error message for unloaded modules (#174)
- Fix issue with
:formodifiers on components (#176) - Expose form instance as slot prop on
Surface.Components.Form(#183) - Don't initialize data assigns without default value (#195)
- Fix support for Elixir >= v1.11
- Update liveview to latest v0.15-dev (597c5dd)
- Add undefined assign check for
Surface.{LiveComponent,Component,LiveView} - New form controls wrappers:
<DateTimeSelect>and<TimeSelect>. - Force recompilation of the parent component after fixing errors on any of its children.
- Update LiveView to v0.15-dev (0f592a4).
- Make
<slot>mandatory instead ofinner_content. - Add attribute
indexto<slot>to allow rendering individual named slot items. - Rename macro
propertytoprop. - Remove macro
contextand add a<Context>component to be used instead. - Rename directives
:on-phx-[event]to:on-[event]. - Add support for co-located template files using
.sfacesuffix. - Add
Surface.init/1to initialize internal assigns when not usingSurface.LiveView. - Add
:propsdirective to pass dynamic props to a component. - Add
:attrsdirective to pass dynamic attributes to a tag. - Add new modifiers
indexandwith_indexfor:for. - Update html tag generation to remove the tag if it's value computes to
nil. - Add support for a
transform/1callback to allow components to manipulate its own node at compile-time. - New form controls:
<Inputs>,<Checkbox>,<Select>,<MultipleSelect>,<HiddenInputs>,<FileInput>and<OptionsForSelect>.
- New Markdown component
- New Link component
- New form components Form, Field, TextArea, Label, TextInput, RadioButton, HiddenInput, ColorInput, DateInput, DateTimeLocalInput, EmailInput, NumberInput, PasswordInput, RangeInput, SearchInput, TelephoneInput, TimeInput, UrlInput, Reset and Submit.
- Automatically define a required :id property for live components that implement
handle_event/3 - New config API for components
- Update LiveView to v0.13
- Add support for slots
- Add built-in LivePath and LiveRedirect components
- Drop automatic camel-to-kebab conversion for CSS class name
- Drop support for
inner_content.(). Useinner_content.([])instead - Update LiveView to v0.11.1
- Initial alpha release