grych
Creator of Drab
Hi folks,
Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixir (here). Finally, first beta has been released!
- Source and installation instruction: GitHub - grych/drab: Remote controlled frontend framework for Phoenix. · GitHub
- Home page: Drab: Server Side User Interface Access - with live examples
- Documentation with more examples: https://tg.pl/drab/docs
And of course it is available as a hex package.
In the meantime I’ve changed the API, so it is - I believe - easier to remember. If you think about webpage as a database which contains DOM objects, it is natural to query:
select(:text, from: "p:first")to get text of the first paragraph orselect(attr: :href, from: "a")for all links in the document,
update some object(s) withupdate(css: :border, set: "3px solid red", on: this(sender)),
add new nodes or attributesinsert("<b>IMPORTANT</b>", before: "p:first"),
or remove something withdelete(class: "btn", from: "#the_button"),
and more, like synchronous modal which - launched on the server side - waits for user input.
Any suggestions, criticism, ideas welcome!
–
Grych
Trending in Announcing
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries.
offset-based pagination with...
New
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New
I released Doggo, a collection of unstyled Phoenix components.
https://github.com/woylie/doggo
Features
Unstyled Phoenix components....
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hello
Published a new library - ProcessHub!
ProcessHub is a library designed to manage process distribution within the Elixir cluster. ...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
It’s not that it’s vocabulary is too advanced. It’s something worse.
I get lost trying to follow even a paragraph written by Claude. It’...
New
This showed up on my feed.. anyone heard of it? Just hype?
Ox Alpha is a reasoning model designed for coding, sustained ag...
New
Hey folks,
I just published a post about Hologram’s funding and where the project goes next - the short version:
Curiosum as Main Spons...
New
Today we’re releasing Oban for Python. Not an Oban client in Python. Not a pythonx wrapper embedded in Elixir. Nope, it’s a fully operati...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 231 to 240- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
grych
Are you updating the assigns with the partial given?
?
robobakery
Thanks, I’ve totally forgot to include partial template when I call poke.
grych
Cool.
I am thinking about changing this behavior, so when you not specify the template name, it changes it in all.
tnt
Did you manage to do that? Having to return to eex templates would be a real show-stopper for me.
tmbb
No, sorry, I didn’t try. I’ve started aorking on my own thing instead…
piex
Drab looks really interesting and I am hoping it will be a fit for an experimental project I m working on. I am trying to get drab working but running into an error “Erlang error: :notsup” when executing page render DrabExample.PageView.“index.html”/1
After digging a bit it seems to be coming from lib/plug/crypto/message_encryptor.ex. The call that fails is :crypto.block_encrypt(:aes_gcm, key, iv, {aad, plain_text})
This is likely an issue with my environment (OS X Sierra 10.12.6), OpenSSL 1.0.2l 25 May 2017
iex> :crypto.supports()
[hashs: [:sha, :sha224, :sha256, :sha384, :sha512, :md4, :md5, :ripemd160],
ciphers: [:des3_cbc, :des_ede3, :des3_cbf, :des3_cfb, :aes_cbc, :aes_cbc128,
:aes_cfb8, :aes_cfb128, :aes_cbc256, :aes_ctr, :aes_ecb, :aes_ige256,
:des_cbc, :des_cfb, :des_ecb, :blowfish_cbc, :blowfish_cfb64, :blowfish_ofb64,
:blowfish_ecb, :rc2_cbc, :rc4],
public_keys: [:rsa, :dss, :dh, :ec_gf2m, :ecdsa, :ecdh, :srp]]
iex> :ssl.versions
[ssl_app: ‘8.1.1’, supported: [:“tlsv1.2”],
available: [:“tlsv1.2”, :“tlsv1.1”, :tlsv1, :sslv3]]
My past Phoenix projects have not hit any issue, but may not have exercised this particular crypto path. Asking here in case anyone has had this issue or has an idea how to resolve it.
Any advice is greatly appreciated.
OvermindDL1
That does not seem like a drab error, rather that sounds like some application is not started that should have been started. What is your entire
mix.exsfile and your projects application file?grych
Hey @piex,
Yes, Drab is using Plug’s MessageVerifier to sign the tokens.
And yes, it looks like your environment issue. You are missing
:aes_gcm.On my system it’s there:
Not sure it is openssl version or erlang. I am using built-in openssl in macOS Sierra (
OpenSSL 0.9.8zh 14 Jan 2016) andOpenSSL 1.0.1t 3 May 2016on Debian.piex
Thanks grych, that confirmation was all I needed. I had been using the Erlang Solutions installer to manage switching between several Erlang versions but all of their builds seem to be missing :aes_gcm cipher. I switched to point to the brew installed version of Erlang and it includes :aes_gcm and now works. Thanks much.
grych
Maybe it would be good to report it to plug team? They may want to check if you have a cipher before trying to use it, and change it, or at least give a better error message.