Is it me or Rails community is about to have something close to Clojure’s REPL experience ? https://hotwire.dev/
phoenix was inspired by rails, and now the circle closes with rails being inspired by phoenix
Ruby's REPL is called IRB https://en.wikipedia.org/wiki/Interactive_Ruby_Shell
That hotwire thing can work with things like compojure too!
That might be interesting to play around with... but I can't find something like a spec on how the backend should respond to turbo queries (or how websockets should work).
From a very cursory glance it also all seems a little too magical
Cool, though
Frames add events to links and forms such that they actionate via ajax instead standard, and the response replaces the frame as per directives. For how streams action, see https://github.com/hotwired/turbo-rails/blob/main/app/javascript/turbo/cable_stream_source_element.js
Go to intro video 8:10, where he shows a Rails console, interacting with the browser UI
it reminds me of elixir too, the cli interaction and also hotwire is just like phoenix liveview it seems
Does anyone use the --module-bind
argument of webpack? I was looking through the https://webpack.js.org/concepts/loaders/#cli and it seems like this flag doesn’t work
Is there another way to incorporate modules from the CLI?
(defn f [] 1)
=> #'cljs.user/f
(= f (with-meta f {:a 1}))
=> false
Is this a bug?looks like MetaFn
needs to implement IEquiv
?
https://ask.clojure.org/index.php/9966/function-with-meta-equality-fails
it's not a bug
=
on functions compares for identity
"metadata does not impact equality" https://clojure.org/reference/metadata
it's the same in clojure
functions are not compared via equality, but via identity
they don't have equality semantics
thanks @bronsa. I get a bit confused about when things are vars versus when things are the contents of the var
I'm almost afraid to ask this but what's the way to work with custom-elements in clojurescript? Usually in Javascript you create a new class extending HTMLElement. I'm not aware Clojurescript supports classes and inheritance in Javascript tradition. Can anyone suggests where to look?
In CLJS, you will have to create a new object and directly change its prototype: https://stackoverflow.com/a/61040931/564509
BTW the comments mention HTMLElement
. :)
it basically says I'm doomed 🙂
if you use shadow-cljs you can do class ... extends
using shadow.cljs.modern/defclass
looks something like this https://github.com/thheller/shadow-experiments/blob/master/src/main/shadow/experiments/grove/components.cljs#L151
only with (extends js/HTMLElement)
same position as (field ...)
Wow! Thanks @thheller for sharing!