All Versions
47
Latest Version
Avg Release Cycle
27 days
Latest Release
-

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, 2019

    What 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.

  • v0.9.1 Changes

    July 15, 2018

    Drab.Modal is not dependent on Drab.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 changed

    As described in #127, API has changed. The most painful change is Drab.Live.peek, as it now
    returns {:ok, value} or {:error, why}. Raising Drab.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.

    Do You Want to Know More?

    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 and drab-handler combination no longer exists

    🚚 The existing syntax drab-event and drab-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">
    

    Do You Want to Know More?

    ⚡️ 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, 2018

    This 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 your config.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 can subscribe/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, 2018

    This 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, 2018

    Very 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, like ruby.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.