Support Phoenix 1.4
rodrigues opened this issue · comments
Hello, I've added drab to a new app:
{:phoenix, "~> 1.4.0-rc", override: true}
{:drab, "~> 0.9.3"}
Then I ran mix drab.install
and got:
** (Mix) Only Phoenix 1.3 is supported with the installer, please proceed with manual install
I've traced that this message was added when the task was created, and hadn't changed since then. Maybe it's already compatible with Phoenix 1.4+, except for this mix error?
Cheers
EDIT: I've followed the changes done in the files by the task, did the same in phx 1.4 and got to an error in the browser, drab's js does require('phoenix')
, but require
function isn't available.
Yes, installer specifically checks for the phoenix version. Drab does not support 1.4 yet. You must proceed with manual install.
About require is not defined, check this docs - https://hexdocs.pm/drab/Drab.Client.html#module-custom-socket-constructor-webpack-require-is-not-defined-fix
To get drab to work with phoenix 1.4 I had to change the signature of the connect
function in the __using__
macro in lib/drab/socket.ex
to def connect(%{"__drab_return" => _} = token, socket, _connect_info) do
, as well as implement the require is not defined fix. Did I miss something?