Changelog History
Page 1
-
v0.10.5 Changes
โ Added a new
stopPropagation()
option to drab elements to stop the propagation of the event so it will not bubble. -
v0.10.1 Changes
January 11, 2019What could possibly go wrong?
๐ (bugfix release)
-
v0.10.0 Changes
November 28, 2018๐ Drab is now blessed and tested to work with Pheonix 1.4. Plus bugfixes.
-
v0.9.3 Changes
September 08, 2018๐ This is a maintenance release: few bugfixes.
-
v0.9.2 Changes
August 10, 2018๐ This is a slow evolution release, containing a number of bug fixes and a few new features:
- ๐ป Cookies function in
Drab.Browser
iex> set_cookie(socket, "mycookie", "value", max_age: 10) {:ok, "mycookie=value; expires=Thu, 19 Jul 2018 19:47:09 GMT"} iex> Drab.Browser.cookies(socket, decoder: Drab.Coder.Cipher) {:ok, %{"other" => 42, "mycookie" => "value"}}
Drab.{Live, Core, Element, Modal}
functions accept%Phoenix.HTML.Safe{}
That means you don't need to call
safe_to_string/1
anymore, just pass the safe:html = ~E"<strong><%= nick %>:</strong> <%= message %><br>" broadcast_insert socket, "#chat", :beforeend, html
- โ Tested with Elixir 1.7
Drab is now blessed to work with Elixir 1.7 and OTP 21.
- ๐ป Cookies function in
-
v0.9.1 Changes
July 15, 2018Drab.Modal
is not dependent onDrab.Query
anymore, and does not require jQuery to run! You may now use it out of the box, with standard Phoenix installation. Works with both Bootstrap 3 ๐ง and 4, while Bootstrap 3 is used by default. In case you want to use Bootstrap 4, configure it with:config :drab, :modal_css, :boostrap4
0๏ธโฃ
Drab.Modal
is now loaded by default, as it became the part of Standard Drab Modules.Also changed the Drab store storage, now it is encrypted, not only signed.
Templates for modal and buttons have been changed!
๐ If you are already using the custom templates for modal of for the button, please read the documentation and update them.
-
v0.9.0 Changes
June 29, 2018๐ This release finally introduces the final API. There is no intention to change it, unless very
significant errors are found.๐ง If you are using Drab already, prepare for the changes in the configuration and also in the code.
Drab.Live
API changedAs described in #127, API has changed. The most painful change is
Drab.Live.peek
, as it now
returns{:ok, value}
or{:error, why}
. RaisingDrab.Live.peek
is for convinience.โก๏ธ
Drab.Live.poke
returns tuple now as well, to catch update errors or disconnections.Redesigned
Drab.Config
๐ง Since this version, Drab is no longer configured globally. This means that you may use it in the
multiple endpoints environments.
๐ง This requires configuration API change. Most of the Drab options are now located under
the endpoint module:config :drab, MyAppWeb.Endpoint, otp\_app: :my\_app\_web, ...
The endpoint and application name are mandatory.
However, there are still few global options, like
:enable_live_scripts
. Please read
๐Drab.Config
documentation
for more information.More API changes
โฑ All functions returning
{:timeout, description}
now return just{:error, :timeout}
.Undeclared handler or shared commander raises
All handlers must now be strictly declared by using
Drab.Commander.defhandler
or
Drab.Commander.public
macro.defhandler my\_handler(socket, payload), do: ..
or
public :my\_handlerdef my\_handler(socket, payload), do: ...
The same is with shared commanders, if you want to use it, declare it with
Drab.Controller
:use Drab.Controller, commanders: [My.Shared.Commander]
Hard depreciations of various functions
- Drab.Client.js/2
- Drab.run_handler()
- ๐ป Drab.Browser.console!/2
- ๐ป Drab.Browser.redirect_to!/2
- Drab.Core.broadcast_js!/2
drab-event
anddrab-handler
combination no longer exists๐ The existing syntax
drab-event
anddrab-handler
is removed. Please use the new syntax of:<tag drab="event:handler"> <input drab="focus:input_focus blur:input_blur" <input drab-focus="input_focus" drab-blur="input_blur">
โก๏ธ Updating from <= v0.8.3
config.exs
Replace:
config :drab, main\_phoenix\_app: :my\_app\_web, endpoint: MyAppWeb.Endpoint
with:
config :drab, MyAppWeb.Endpoint, otp\_app: :my\_app\_web
๐ง Most of the configuration options now must be placed under the endpoint. Please read
๐Drab.Config
documentation for more info. -
v0.8.3 Changes
June 22, 2018This version brings two useful features: presence and ability to subscribe to topics in the runtime.
โฌ๏ธ Upgrading from =< 0.8.2
Please ensure you have set
:main_phoenix_app
in yourconfig.exs
. The way how Drab is searching
for the Phoenix app it is working on, has been changed.Subscribe and unsubscribe from external topics in a runtime
Finally, you are not limited to the compile-time topic youโve set with
broadcasting/1
macro in the
commander. Now you cansubscribe/2
to the external topic, receiving broadcasts sent to it.subscribe(socket, same\_action(MyApp.MyController, :index))subscribe(socket, same\_topic("user\_#{user\_id}"))
Presence
Conveniences for Phoenix.Presence
๐ง If configured (it is disabled by default), tracks the user presence on the topic. The following
example shows the number of connected users, live:defmodule MyAppWeb.MyCommander use Drab.Commander broadcasting "global" onconnect :connected ondisconnect :disconnected def connected(socket) do broadcast\_html socket, "#number\_of\_users", Drab.Presence.count\_users(socket) enddef disconnected(\_store, \_session) do topic = same\_topic("global") broadcast\_html topic, "#number\_of\_users", Drab.Presence.count\_users(topic) endend
0๏ธโฃ By default, presence map key is set as a browser UUID (which is shamelessly stored in the local
๐ป store in the browser), but it may be also any session value. This may be useful, if you have the
๐งuser_id
already in the session, just configure it:config :drab, :presence, id: :user\_id
โก๏ธ Updated enable/disable when processing behaviour
After launching an event from the page, the control (button) is disable until processing stops.
๐ Now it is even better, as it recognizes previously disabled controls (#146). -
v0.8.2 Changes
June 12, 2018This version is a preparation for v0.9.0, which is going to bring API changes, as described in #127.
- ๐ new functions in Drab.Element (#134, #135)
- ๐ new
Drab.Coder
for encoding terms to string (#137) - new
js_socket_constructor
config (#133), useful when using Drab with Webpack - all assigns are now peekable (#126)
broadcast_poke
now gets subject, not only socket (under some limitations) (#141)- โก๏ธ preserve csrf token if
poke
updates the form (fix for #130)
-
v0.8.1 Changes
May 18, 2018Very important role of Drab is to encourage beginners to try out
Elixir |> Phoenix |> Drab
. The goal is to have an environment, which is less scary than others, likeruby.rails.ajax
. This ๐ง is why all the configuration stuff should be minimized (but with options for power users).mix drab.install
๐ Bug Fixes
Again,
Drab.Live
engine has been redesigned to solve existing and future issues.