Packages
surface
0.6.1
0.12.3
0.12.2
0.12.1
0.12.0
0.11.5
0.11.4
0.11.3
0.11.2
0.11.1
0.11.0
0.10.0
0.9.5
0.9.4
0.9.3
0.9.2
0.9.1
0.9.0
0.8.4
0.8.3
0.8.2
0.8.1
0.8.0
0.7.6
0.7.5
0.7.4
0.7.3
0.7.2
0.7.1
0.7.0
0.6.1
0.6.0
0.5.2
0.5.1
0.5.0
0.4.1
0.4.0
0.3.2
0.3.1
0.3.0
0.2.1
0.2.0
0.1.1
0.1.0
0.1.0-alpha.2
0.1.0-alpha.1
0.1.0-alpha.0
A component based library for Phoenix LiveView
Current section
46 Versions
Jump to
Current section
46 Versions
Compare versions
15
files changed
+65
additions
-31
deletions
| @@ -1,5 +1,12 @@ | |
| 1 1 | # Changelog |
| 2 2 | |
| 3 | + ## v0.6.1 (2021-10-26) |
| 4 | + |
| 5 | + * Add `surface_formatter` dependency to `mix.exs` when running `mix surface.init` (#507) |
| 6 | + * Allow `Inputs` component inside the `Field` component (#492) |
| 7 | + * Fix using context with external `.sface` templates (#511) |
| 8 | + * Fix attribute name conversion (#512) |
| 9 | + |
| 3 10 | ## v0.6.0 (2021-10-21) |
| 4 11 | |
| 5 12 | * Compatibility with Phoenix `v1.6` and Liveview `v0.16` |
| @@ -52,7 +52,7 @@ end | |
| 52 52 | |
| 53 53 | * **Slots** - placeholders declared by a component that you can fill up with **custom content**. |
| 54 54 | |
| 55 | - * **Contexts** - allows a parent component to share data with its children without passing them as properties.. |
| 55 | + * **Contexts** - allows a parent component to share data with its children without passing them as properties. |
| 56 56 | |
| 57 57 | * **Compile-time checking** of the template structure, components' properties, slots, events and more. |
| 58 58 | |
| @@ -64,7 +64,7 @@ end | |
| 64 64 | Phoenix v1.6 comes with built-in support for LiveView apps. You can create a new phoenix application with: |
| 65 65 | |
| 66 66 | ``` |
| 67 | - mix phx.new my_app --live |
| 67 | + mix phx.new my_app |
| 68 68 | ``` |
| 69 69 | |
| 70 70 | > **Note:** In case you want to add Surface to an existing Phoenix application that doesn't have |
| @@ -76,7 +76,7 @@ Add `surface` to the list of dependencies in `mix.exs`: | |
| 76 76 | ```elixir |
| 77 77 | def deps do |
| 78 78 | [ |
| 79 | - {:surface, "~> 0.6.0"} |
| 79 | + {:surface, "~> 0.6.1"} |
| 80 80 | ] |
| 81 81 | end |
| 82 82 | ``` |
| @@ -121,7 +121,7 @@ please visit the [Getting Started](https://surface-ui.org/getting_started) guide | |
| 121 121 | Surface `v0.6.x` relies on the Liveview features available since `v0.16`. The main change |
| 122 122 | from the user perspective is that the stateless `Surface.Component` now is built on top of |
| 123 123 | `Phoenix.Component` instead of `Phoenix.LiveComponent`. This means the `mount/1`, `preload/1` |
| 124 | - and `udpate/2` callbacks are no longer available. If you initialize any assign or compute |
| 124 | + and `update/2` callbacks are no longer available. If you initialize any assign or compute |
| 125 125 | any value using those callbacks, you need to replace them with one of the new |
| 126 126 | [assign helpers](https://hexdocs.pm/phoenix_live_view/Phoenix.Component.html#module-assigns). |
| @@ -145,4 +145,4 @@ | |
| 145 145 | {<<"optional">>,false}, |
| 146 146 | {<<"repository">>,<<"hexpm">>}, |
| 147 147 | {<<"requirement">>,<<"~> 0.8.5">>}]]}. |
| 148 | - {<<"version">>,<<"0.6.0">>}. |
| 148 | + {<<"version">>,<<"0.6.1">>}. |
| @@ -111,9 +111,11 @@ defmodule Mix.Tasks.Surface.Init do | |
| 111 111 | Mix.shell().info("\nThe following dependencies were updated/added to your project:\n") |
| 112 112 | |
| 113 113 | for dep <- updated_deps do |
| 114 | - Mix.shell().info([" * #{dep}\n"]) |
| 114 | + Mix.shell().info([" * #{dep}"]) |
| 115 115 | end |
| 116 116 | |
| 117 | + Mix.shell().info("") |
| 118 | + |
| 117 119 | if assigns.yes || Mix.shell().yes?("Do you want to fetch and install them now?") do |
| 118 120 | Mix.shell().cmd("mix deps.get", []) |
| 119 121 | Mix.shell().cmd("mix deps.compile", []) |
| @@ -141,6 +143,9 @@ defmodule Mix.Tasks.Surface.Init do | |
| 141 143 | |
| 142 144 | defp patches_for(:formatter, %{formatter: true}) do |
| 143 145 | %{ |
| 146 | + "mix.exs" => [ |
| 147 | + Patches.add_surface_formatter_to_mix_deps() |
| 148 | + ], |
| 144 149 | ".formatter.exs" => [ |
| 145 150 | Patches.add_surface_inputs_to_formatter_config(), |
| 146 151 | Patches.add_surface_to_import_deps_in_formatter_config() |
| @@ -58,6 +58,27 @@ defmodule Mix.Tasks.Surface.Init.Patches do | |
| 58 58 | |
| 59 59 | # Formatter patches |
| 60 60 | |
| 61 | + def add_surface_formatter_to_mix_deps() do |
| 62 | + %{ |
| 63 | + name: "Add `surface_formatter` dependency", |
| 64 | + update_deps: [:surface_formatter], |
| 65 | + patch: &Patchers.MixExs.add_dep(&1, ":surface_formatter", ~S("~> 0.6.0")), |
| 66 | + instructions: """ |
| 67 | + Add `surface_formatter` to the list of dependencies in `mix.exs`. |
| 68 | + |
| 69 | + # Example |
| 70 | + |
| 71 | + ``` |
| 72 | + def deps do |
| 73 | + [ |
| 74 | + {:surface_formatter, "~> 0.6.0"} |
| 75 | + ] |
| 76 | + end |
| 77 | + ``` |
| 78 | + """ |
| 79 | + } |
| 80 | + end |
| 81 | + |
| 61 82 | def add_surface_inputs_to_formatter_config() do |
| 62 83 | %{ |
| 63 84 | name: "Add file extensions to :surface_inputs", |
| @@ -104,12 +125,7 @@ defmodule Mix.Tasks.Surface.Init.Patches do | |
| 104 125 | %{ |
| 105 126 | name: "Add `surface_catalogue` dependency", |
| 106 127 | update_deps: [:surface_catalogue], |
| 107 | - patch: |
| 108 | - &Patchers.MixExs.add_dep( |
| 109 | - &1, |
| 110 | - ":surface_catalogue", |
| 111 | - ~S("~> 0.2.0") |
| 112 | - ), |
| 128 | + patch: &Patchers.MixExs.add_dep(&1, ":surface_catalogue", ~S("~> 0.2.0")), |
| 113 129 | instructions: """ |
| 114 130 | Add `surface_catalogue` to the list of dependencies in `mix.exs`. |
Loading more files…