« Back to channel list

#elixir-lang - 14 May 2019

« Back 1 day Forward 1 day »
[00:04:26] craigp_: has joined #elixir-lang
[00:25:06] orbyt_: has joined #elixir-lang
[01:07:04] carldd: has joined #elixir-lang
[01:30:19] Exuma: has joined #elixir-lang
[01:33:28] iamcz: has joined #elixir-lang
[01:36:24] franco: has joined #elixir-lang
[01:47:23] tomterl: has joined #elixir-lang
[01:47:48] ur5us: has joined #elixir-lang
[02:00:13] ephemera_: has joined #elixir-lang
[02:05:22] Cloudflare: has joined #elixir-lang
[02:31:10] duaneb: has joined #elixir-lang
[02:52:43] tnez: has joined #elixir-lang
[02:59:47] rpip: has joined #elixir-lang
[03:15:31] duaneb: has joined #elixir-lang
[03:17:19] Saukk: has joined #elixir-lang
[03:20:45] Nicd-: nickjj: you should just ask your question generally so anyone can answer :P
[03:21:53] nageV: is anyone able to access this Erlang Factory slide deck? I keep getting Service Unavailable :( http://www.erlang-factory.com/upload/presentations/688/Percept2ErlangFactory2012.pdf
[03:22:23] Nicd-: opened fine for me
[03:22:44] Nicd-: try this https://usercontent.irccloud-cdn.com/file/hRdHh5hI/Percept2ErlangFactory2012.pdf
[03:22:50] carldd: has joined #elixir-lang
[03:23:33] nageV: Nicd-: awesome, that worked, thanks! :)
[03:27:42] griffinbyatt: has joined #elixir-lang
[03:35:21] fastfresh: Can someone explain genserver hibernation?
[03:37:00] laut: has joined #elixir-lang
[03:37:19] fastfresh: Is hibernated process still gets scheduled to check if a message has arrived, or it is done somewhere and, and on message recevie the process is waked by the VM?
[03:37:31] Nicd-: > Hibernating a GenServer causes garbage collection and leaves a continuous heap that minimises the memory used by the process.
[03:38:01] Nicd-: looks like it just does a GC and then goes back to waiting like a normal process
[03:40:02] fastfresh: So it's not real hibernation? Process has to be running to check it's mailbox.
[03:40:23] FancyEagle: has joined #elixir-lang
[03:40:46] Nicd-: well if a process is waiting for a message it's sleeping
[03:41:24] Nicd-: > the process is hibernated and will continue the loop once a message is in its message queue
[03:42:32] Nicd-: technical info: http://erlang.org/doc/man/erlang.html#hibernate-3
[03:44:14] mbuf: has joined #elixir-lang
[03:48:34] fastfresh: Thank you. I'm new to elixir. Who is checking if there is a new message in the queue? Do sleeping processes still get their CPU time?
[04:13:15] gvaughn: has joined #elixir-lang
[04:21:10] mwbrown: has joined #elixir-lang
[04:40:57] kapilp: has joined #elixir-lang
[05:08:49] voltone: has joined #elixir-lang
[05:11:51] lauromoura_: has joined #elixir-lang
[05:12:06] __charly__: has joined #elixir-lang
[05:14:08] gvaughn: has joined #elixir-lang
[05:31:55] Nicd-: fastfresh: sleeping processes do nothing. the VM schedulers handle waking them up when there are messages
[05:35:09] ur5us: has joined #elixir-lang
[05:35:47] FancyEagle: has joined #elixir-lang
[05:39:24] FancyEagle: has joined #elixir-lang
[05:46:21] proteusguy: has joined #elixir-lang
[06:12:21] DTZUZO: has joined #elixir-lang
[06:15:03] FancyEagle: has joined #elixir-lang
[06:19:46] gvaughn: has joined #elixir-lang
[06:33:32] jegaxd26: has joined #elixir-lang
[06:36:26] jegaxd26: has joined #elixir-lang
[06:37:55] Gazler: has joined #elixir-lang
[06:40:55] lexmag: has joined #elixir-lang
[06:43:23] FancyEagle: has joined #elixir-lang
[06:48:13] jegaxd26: has joined #elixir-lang
[06:48:27] FancyEagle: has joined #elixir-lang
[06:51:42] squall: has joined #elixir-lang
[06:53:51] Avinash: has joined #elixir-lang
[07:00:10] jegaxd26: has joined #elixir-lang
[07:01:52] jeffro: has joined #elixir-lang
[07:10:08] hypercore: has joined #elixir-lang
[07:10:12] kansi: has joined #elixir-lang
[07:18:53] kyrylo: has joined #elixir-lang
[07:23:51] rpip: has joined #elixir-lang
[07:25:08] netrino: has joined #elixir-lang
[07:27:13] gvaughn: has joined #elixir-lang
[07:45:02] PragTob: has joined #elixir-lang
[07:55:30] za1b1tsu: has joined #elixir-lang
[08:00:39] jeffro_: has joined #elixir-lang
[08:09:23] DarkSeid: has joined #elixir-lang
[08:11:48] lexmag: has joined #elixir-lang
[08:12:06] mbuf: has joined #elixir-lang
[08:21:46] mblarsen: has joined #elixir-lang
[08:24:19] serafeim: has joined #elixir-lang
[08:31:37] za1b1tsu: is there built-in function similar to Rails humanize? ("CARD_ON_DELIVERY" => "Card on delivery"). I have found String.capitalize, but that only does a part of the job "CARD_ON_DELIVERY" => "Card_on_delivery"
[08:32:49] gvaughn: has joined #elixir-lang
[08:34:18] dysfun: za1b1tsu: see the 'recase' library
[08:34:42] dysfun: https://hexdocs.pm/recase/readme.html
[08:35:15] dysfun: this one appears to be called 'sentence'
[08:35:29] za1b1tsu: dysfun, hmmm, thanks for recommendation
[08:37:00] dysfun: i havent used 'sentence', but i've been happy with a couple of the other functions from there
[08:39:42] serafeim: hello, in this page: https://hexdocs.pm/phoenix/Phoenix.Token.html I see the line: token = Phoenix.Token.sign(MyApp.Endpoint, "user salt", user_id). can somebody explain to my what's this "user salt" ?
[08:40:06] serafeim: i know what salt is (cryptographically)
[08:40:34] serafeim: but i see that they pass some constant string there. is this ok ? should I change it with a random-per-user-generated string ?
[08:41:27] gabrielpoca: has joined #elixir-lang
[08:41:55] netrino_: has joined #elixir-lang
[08:42:48] Nicd-: from reading those docs, their recommendation seems to be a static string common for all users
[08:42:50] Nicd-: > The second argument is a cryptographic salt which must be the same in both calls to sign/4 and verify/4. For instance, it may be called "user auth" when generating a token that will be used to authenticate users on channels or on your APIs.
[08:43:34] serafeim: ok so i guess I could generate a random string and save it to my application settings
[08:44:08] Nicd-: you don't need to
[08:45:28] dysfun: yes and no
[08:45:31] Nicd-: it uses the secret key base from your config: https://gitlab.com/code-stats/code-stats/blob/master/config/test.exs#L8
[08:45:33] serafeim: so just put "user auth" there ? if that's the case then what's the purpose of this parameter ?
[08:45:47] dysfun: we just use a randomly generated one for each env, because we're paranoid fucks
[08:46:10] serafeim: so it's there for a little bit of extra security ?
[08:46:19] Nicd-: I think that secret key base is concatenated with the salt to form the used secret
[08:47:41] serafeim: ok i understand
[08:47:53] dysfun: yes, that's what it does
[08:48:02] dysfun: we just generate a random one per env
[08:48:08] dysfun: along with a random secret key
[08:49:03] serafeim: excellent i understand now how it works
[08:49:24] serafeim: it's a great tool for authenticating websocket requests
[08:49:37] serafeim: but i guess i won't need it in my crud app :)
[08:50:34] wonko7: has joined #elixir-lang
[08:54:35] BitBot: has joined #elixir-lang
[08:59:17] dysfun: be careful of time zones though :)
[08:59:55] dysfun: we had a client go to australia and use the site and websocket stopped working, which was fun to investigate
[09:00:49] jegaxd26: has joined #elixir-lang
[09:08:51] azod: has joined #elixir-lang
[09:10:35] azod: has joined #elixir-lang
[09:14:38] azod: has joined #elixir-lang
[09:24:12] serafeim: why it stopped working ?
[09:24:20] azod: why did what stop working?
[09:25:02] dysfun: we were using plug's token thing to authenticate websocket with short lived tokens and somewhere along the line, the local time was being used
[09:25:42] dysfun: consequently the tokens were not considered valied
[09:26:01] azod: has joined #elixir-lang
[09:38:50] gvaughn: has joined #elixir-lang
[09:41:05] azod: has joined #elixir-lang
[09:52:42] BitBot: has joined #elixir-lang
[10:12:01] netrino: has joined #elixir-lang
[10:14:02] azod: has joined #elixir-lang
[10:14:14] azod: whoops, sorry..
[10:29:38] voltone: has joined #elixir-lang
[10:32:59] azod: has joined #elixir-lang
[10:34:41] voltone: has joined #elixir-lang
[10:35:09] dysfun: 6. not sorry :)
[10:36:45] jegaxd26: has joined #elixir-lang
[10:43:00] serafeim: is there an e-z way to install elixir on a Centos 6.5 server or I'll need to install from source ?
[10:44:05] serafeim: it'd be great if i didn't need to install from source :/
[10:44:32] serafeim: also even if i need to install from src, are there any good instructions somwhere ?
[10:46:52] Nicd-: if you have erlang installed, installing elixir from source is very easy
[10:47:03] Nicd-: (provided you know how to use git and you also have make on the system)
[10:47:57] serafeim: hm ok... the centos 6.5 repos have erlang R14B-04.3.el6
[10:48:11] serafeim: should i use that or try to find a different version ?
[10:48:47] Nicd-: that is too old
[10:49:23] Nicd-: elixir requires erlang 20 or later
[10:50:03] mbuf: has joined #elixir-lang
[10:50:31] serafeim: should i download from here https://packages.erlang-solutions.com/erlang/ ?
[10:50:56] Nicd-: if they have packages for your OS version, yes
[10:54:57] nickjj: Nicd-, it was this: https://gist.github.com/nickjj/33558aaed9741ac379b7ebfaed078813 , my concern is the plug now knows some inner details about my repo schema
[10:55:13] nickjj: but maybe there's no reasonable way around that?
[10:57:23] serafeim: ok the erlang packages has 21.3.8
[10:57:28] serafeim: so i'll install that
[10:58:16] Nicd-: nickjj: if your context communicates out with those structs then it's totally fine (as in, you can get those structs as return from functions in the context)
[10:58:29] gvaughn: has joined #elixir-lang
[10:58:38] Nicd-: if your conn assigns have such a struct then it is exposed anyway
[10:59:14] DeadTrickster__: has joined #elixir-lang
[10:59:51] nickjj: Nicd-, the accounts context does have some functions for getting specific user related things
[11:01:43] mbuf: has joined #elixir-lang
[11:07:19] inoas: has joined #elixir-lang
[11:27:13] voltone: has joined #elixir-lang
[12:02:39] Cthalupa: has joined #elixir-lang
[12:12:42] jegaxd26: has joined #elixir-lang
[12:15:50] serafeim: so. do you serve your elixir apps directly through cowboy or you use some reverse proxy ?
[12:16:03] serafeim: are there any security/performance considerations if i use cowboy ?
[12:16:36] za1b1tsu: has joined #elixir-lang
[12:16:41] serafeim: i'll probably use a reverse proxy because i host multiple apps in my server so i don't want to bind to port 80/443 but i like to know
[12:16:42] gvaughn: has joined #elixir-lang
[12:17:20] Nicd-: I use nginx as reverse proxy to deal with multiple sites and TLS termination
[12:20:08] serafeim: yes that's what i'll do. however i just wanted to know if it is possible to use only cowboy
[12:20:29] Nicd-: it's possible, yes. some people do that
[12:20:59] Nicd-: if you only have one service or you handle load balancing / TLS termination on another machine then it may make sense to serve with cowboy directly
[12:21:24] tnez: has joined #elixir-lang
[12:24:11] serafeim: because of example it's not advisable to serve directly through gunicorn
[12:24:17] serafeim: or serve static files through it
[12:27:24] dysfun: yes, but this is erlang and that is python
[12:38:32] serafeim: dysfun i know
[12:38:39] Nicd-: nice OTP 22 out
[12:39:03] dysfun: Serafeim: we're built for scalability :)
[12:40:10] dysfun: that was quick
[12:40:16] dysfun: i only just heard OTP22 was out :)
[12:40:45] Nicd-: hmm is this a joke
[12:41:15] josevalim: i just ran the test suites against it and it all passed
[12:41:29] josevalim: but then i realized i was running against 21 :( i forgot to change my $PATH
[12:41:38] Nicd-: or is there something that my ignore list removed that I did not see just now?
[12:42:39] josevalim: Nicd-: "[Github] (elixir-lang/elixir) josevalim pushed 6d98af49 to v1.8: v1.7 and v1.8 are compatible with Erlang/OTP 22"
[12:43:39] Nicd-: I assume Elixir will benefit from running on OTP 22 due to the optimisations?
[12:43:48] Nicd-: or does it require bumping minimum OTP version?
[12:44:50] kunzz: has joined #elixir-lang
[12:45:08] nox: "The length/1 BIF used to calculate the length of the list in one go without yielding, even if the list was very long. Now it yields when called with long lists." nice
[12:46:18] timCF: has joined #elixir-lang
[12:46:47] timCF: can any AST experts help me with this question? https://elixirforum.com/t/how-to-expand-ast-fully/22396
[12:47:27] josevalim: Nicd-: if you use the precompiled elixir, then no benefits
[12:47:34] josevalim: but if you compile it, then yes
[12:47:40] Nicd-: yes but I meant compiled on 22 :)
[12:48:38] either|or: has joined #elixir-lang
[12:48:39] inoas: do I see it correctly that while the controller part goes away with LiveView (aka the View is a real one like in traditional desktop MVC) the context layer that is suggested in Programming Phoenix should still be utilized?
[12:48:56] inoas: in case you have a database backend or something stateful that is
[12:49:03] inoas: persistent
[12:49:03] kunzz: hi there! i'm doing some elixir exercises on exercism (sounds like a tonguetwister...), specifically one where i'm implementing basic functions from scratch without using the stdlib. when implementing map, for example, is there a way to append to the accumulator list instead of prepending (like in [f.(h) | acc])? or do i just reverse the list at the end, as inefficient as that might be?
[12:51:03] Nicd-: usually you prepend to list as many times as you need and then reverse it
[12:51:44] kunzz: is that how the elixir map function is implemented?
[12:51:57] Nicd-: if you append, you need to iterate to the end of the list every time
[12:52:23] Sgeo: has joined #elixir-lang
[12:54:06] Nicd-: I'm not sure how Elixir's map is implemented, but I would guess it calls some builtin Erlang function
[12:55:21] kunzz: yeah well i mean if it's like that in principle :) prepending and then reversing
[12:56:07] Nicd-: prepending is O(1), appending is O(n), reversing is O(n) afaik
[12:56:37] josevalim: "The internal documentation for *Compiler* documents the API for the Core Erlang modules. While we will not change those APIs without good reason, we don't give the same guarantees about backward compatibility as for the rest of the APIs in OTP."
[12:56:59] josevalim: they did just so they don't have to ever hear from nox again
[12:57:34] nox: Did they actually include the docs, or are they still hidden somewhere?
[12:57:39] jegaxd26: has joined #elixir-lang
[12:58:50] josevalim: http://erlang.org/doc/apps/compiler/internal_docs.html
[13:01:17] nox: josevalim: So stupid.
[13:02:10] nox: Meanwhile, in the kernel app… http://erlang.org/doc/apps/kernel/index.html
[13:02:19] nox: Who even knows that half of these modules are for?
[13:02:25] nox: s/that/what/
[13:11:18] duaneb: has joined #elixir-lang
[13:16:43] dysfun: nox: they're for annoying you, clearly
[13:18:41] rodolfojcj: has joined #elixir-lang
[13:24:38] jegaxd26: has joined #elixir-lang
[13:27:14] hypercore: has joined #elixir-lang
[13:29:16] gvaughn: has joined #elixir-lang
[13:30:43] hypercore: is there a way to isolate live view events to their respective elements? (instead of updating the whole form)
[13:31:34] hypercore: at the moment i have a click event, but when it runs any other inputs that have values typed into them are cleared (this is for new.html.leex)
[13:53:44] sacredfrog: has joined #elixir-lang
[14:04:15] gvaughn: has joined #elixir-lang
[14:32:01] impl: has joined #elixir-lang
[14:38:24] hypercore: has joined #elixir-lang
[14:41:08] kansi: hi, I have a gen_stage producer and consumer process which are started in my supervision tree. The producer reads records from db and sends to consumer. This causes an issue when doing `mix test` i.e. i see `%DBConnection.OwnershipError{}`
[14:42:08] kansi: how can I avoid this error ?
[14:43:53] targaf: has joined #elixir-lang
[14:57:38] gabrielpoca: has joined #elixir-lang
[15:01:23] gabrielpoca: has joined #elixir-lang
[15:01:47] inoas: has joined #elixir-lang
[15:01:51] wsieroci: has joined #elixir-lang
[15:02:42] inoas: has joined #elixir-lang
[15:03:27] inoas: has joined #elixir-lang
[15:14:35] warmwaffles: has joined #elixir-lang
[15:25:21] aalmazan: has joined #elixir-lang
[15:39:38] Exuma: has joined #elixir-lang
[15:39:46] pera: has joined #elixir-lang
[15:42:36] Phylock: has joined #elixir-lang
[15:48:43] Exuma: has joined #elixir-lang
[15:52:04] Cthalupa: has joined #elixir-lang
[15:53:44] wonko7: has joined #elixir-lang
[15:59:50] gvaughn_: has joined #elixir-lang
[16:04:50] jegaxd26: has joined #elixir-lang
[16:15:21] Saukk: has joined #elixir-lang
[16:20:55] hypercore: has joined #elixir-lang
[16:26:42] jmiven: has joined #elixir-lang
[16:35:49] hypercore: how would you guys suggest building a form where several fields have events which reset all other fields when activated? (live view)
[16:37:16] thomasross_: has joined #elixir-lang
[16:46:30] sacredfrog: has joined #elixir-lang
[16:47:39] sacredfrog: has joined #elixir-lang
[16:58:39] gonz_: They have events as in on submit they'll fire an event that also clear other forms?
[17:00:43] gonz_: I have a feeling this is one of those situations where posting code on ElixirForum will probably get you to where you need to go.
[17:04:26] kapilp: has joined #elixir-lang
[17:08:19] jegaxd26: has joined #elixir-lang
[17:11:00] hypercore: gonz_: as in i have a complex field which requires some real time features using phx-click
[17:11:32] hypercore: but running this phx-click handle_event resets the other fields' input values
[17:19:23] benwilson512: wooooow just now seeing the `live` thing in router
[17:23:49] jsehop9: has joined #elixir-lang
[17:28:19] hypercore: benwilson512: which file?
[17:28:39] hypercore: lib/myapp_web/router.ex?
[17:28:55] benwilson512: the ability to do `live "/path", MyLiveView`
[17:30:02] hypercore: pretty neat isn't it
[17:39:52] laut: has joined #elixir-lang
[17:40:04] tnez: has joined #elixir-lang
[17:43:57] josevalim: controllers are dead, long live live views!
[17:45:28] josevalim: ACTION proceeds to like all comments in the forum thread about food
[17:49:34] benwilson512: josevalim: it's definitely an interesting possibility
[17:49:40] mexicat: has joined #elixir-lang
[17:50:07] benwilson512: the application we're building is querying all of its data from an API anyway so it's almost more natural to just write pages that accord with whatever our UX flow should be
[17:51:11] benwilson512: on a practical note: If I have @organization in my app.html.eex, it isn't possible to populate that from a live view is it?
[17:51:35] benwilson512: and if not, how does that work with `live` in a controller where there isn't really a place to put layout assigns
[17:51:54] josevalim: you can think the live view mount does the job of the controller
[17:55:56] josevalim: benwilson512: not sure if it helps
[17:56:48] squall: has joined #elixir-lang
[17:57:33] benwilson512: josevalim: does mount get called before the application layout is rendered?
[17:58:45] benwilson512: looks like it, cool, so I'm just doing something wrong
[18:02:28] jeffro: has joined #elixir-lang
[18:02:48] chrismccord: this dumpster fire of a thread going on and keathley has started a side conversation on bbq and pimento cheese :D
[18:03:01] chrismccord: lol finding light in the darkness
[18:03:13] keathley: Look I just want to talk about something important
[18:03:54] chrismccord: benwilson512 : you can use assign_new
[18:04:17] chrismccord: but you will need to put the org id in the session as well. Using assign_new will let you skip the extra lookup on the initial LV mount
[18:04:32] chrismccord: assign_new references the parent assigns, which in the case of the root LV, is the conn assigns
[18:05:00] benwilson512: chrismccord: does assign not reference the parent assigns?
[18:05:19] benwilson512: when you say "references" what do you mean?
[18:05:22] benwilson512: to describe the concrete issue, I'm getting `assign @organization not available in eex template.`
[18:05:36] chrismccord: but assign_new will allow you to copy them, falling back to the session for lookup if needed
[18:06:00] drincruz: has joined #elixir-lang
[18:06:05] chrismccord: benwilson512 : how are you loading the org? If it's in the controller, I would kill it and make the LV do everything
[18:06:34] benwilson512: https://www.irccloud.com/pastebin/xqUUBQzv/
[18:06:57] benwilson512: https://www.irccloud.com/pastebin/uVyC64E3/
[18:07:15] hypercore: hey chrismccord, could i ask you a question about live view? having some trouble with a (non-simple) form
[18:07:47] benwilson512: chrismccord: i'm visiting http://localhost:4000/organizations/123/live_shipments
[18:08:11] Adkron: has joined #elixir-lang
[18:08:48] benwilson512: I'm misunderstanding something fundamental I think
[18:09:06] hypercore: chrismccord: cool, so i have form with a js-enhanced field, but the problem is that whenever i make a change to the form, the js for this input breaks
[18:09:28] hypercore: (this is the poste -> https://elixirforum.com/t/live-view-causing-issues-with-element-targeted-javascript/22196/5)
[18:10:07] hypercore: i tried using phx-ignore, but it didn't seem to have an effect
[18:10:19] benwilson512: hypercore: are you on the latest live view?
[18:10:31] hypercore: benwilson512: er not sure... let me check
[18:10:37] benwilson512: `mix deps.update phoenix_live_view
[18:10:59] chrismccord: benwilson512 : ah so it's just a layout thing?
[18:11:11] benwilson512: chrismccord: yes
[18:11:22] chrismccord: benwilson512 : you can try this PR https://github.com/phoenixframework/phoenix_live_view/pull/211
[18:12:12] chrismccord: benwilson512 : I think that's what we want, but I need to think a little more about it because the layout will be static, so if you wanted to update anything there, you'd need to move it within the LV
[18:12:42] benwilson512: chrismccord: completely understood, and in our situation it may make sense to use some traditional controllers and just render some parts within it live but
[18:12:57] benwilson512: it's a fair bit more boilerplate just for basically populating layout stuff
[18:13:18] chrismccord: benwilson512 : it may or may not. The "widget style" LVs are handy for times when the app is already built and you want isoalted bits of interaction without rewriting
[18:13:21] benwilson512: definitely tricky, I'm still trying to sort out when it makes sense to render_live vs live routes vs live partials
[18:13:27] chrismccord: but if this is greenfield, I don't see a reason to go that route
[18:14:23] hypercore: so then i removed phx_change in my form statement, but i have an event (phx-click) on another input field which when clicked resets the values of all others fields (https://elixirforum.com/t/phx-click-on-field-is-causing-all-other-fields-to-reset-in-new-html-leex-liveview-template/22415)
[18:14:32] hypercore: bit stuck with this
[18:14:58] chrismccord: hypercore : "the input is still being validated"
[18:15:02] chrismccord: which is happening server side, no?
[18:15:27] chrismccord: phx-ignore only disables us from patching that elementm, but if you phx-change/submit, the form gets all input values always
[18:15:37] chrismccord: so I berlieve it's working as expected?
[18:15:54] hypercore: chrismccord: oh ok, then i misunderstood what phx-ignore does
[18:16:17] hypercore: basically i wanted to use an input with phx-change being triggered
[18:18:41] benwilson512: chrismccord: seems to have worked btw
[18:19:37] chrismccord: benwilson512 : ok cool. I will likely merge, but to be clear the layout won't update like its child leex template does
[18:19:48] chrismccord: so if you ref'd an assign in the layout and then updated it, it won't change
[18:19:58] benwilson512: chrismccord: well so it also seems that an assign I was adding at the plug level is no longer available
[18:20:20] chrismccord: benwilson512 : correct. You will need to use assign_new + the session fallback
[18:20:37] chrismccord: we reconnect back over websockets, so we have no plug anything
[18:20:49] chrismccord: so the model demands a separation from the plug pipeline
[18:21:27] benwilson512: session stuff should be fine though?
[18:21:32] chrismccord: benwilson512 : also, not sure if your `token` thing is needed or not. Keep in mind anything put into the LV session is signed (via a token)
[18:21:42] benwilson512: chrismccord: that's an external API token
[18:21:43] chrismccord: so the data is trusted and tamper proof
[18:22:12] chrismccord: yeah session should be the minimal data necessary to rebuild your state
[18:22:23] chrismccord: so the `organization_id`, not the `organization` struct
[18:22:46] benwilson512: is mount called again when reconnect happens
[18:22:50] chrismccord: That's what José mean't by the controller layer falling away. It can do very little
[18:23:10] chrismccord: same code path for initial HTTP request, websocket connect, and websocket connection recovery
[18:23:25] benwilson512: this is totally sort of component oriented UIs
[18:23:38] benwilson512: but without all the JS madness
[18:23:56] hypercore: is live view mature enough to handle these types of relatively complex forms, or are my coding abilities just not good enough? :P
[18:24:05] mexicat: has joined #elixir-lang
[18:24:05] hypercore: probably the latter
[18:26:38] chrismccord: hypercore : you can do it like this: `<input ... oninput="event.stopImmediatePropagation()`
[18:27:10] chrismccord: hypercore our greater js interop story is TBD
[18:27:21] chrismccord: so our js interop is not "mature" (it doesn't exist)
[18:27:56] chrismccord: but we will provide the escape hatches. The DOM triggers still work since it's DOM, so you do have options
[18:29:20] benwilson512: chrismccord: is there prior art for having a live view template that contains a D3 graph inside?
[18:29:44] chrismccord: benwilson512 : if you did require a dynamic layout, making the root LV the layout would be the way to go. If it's simply a matter of showing static values like @org.title, then static is fine. So I think both approaches are valid depending on needs
[18:29:59] benwilson512: your root layout can be leex?
[18:30:04] chrismccord: benwilson512 : is "D3 graph" updated/populated/etc via js?
[18:30:58] benwilson512: on the server side I have a link to a CSV file containing the data, and I just want to embed that in the HTML, and have D3 fetch the csv and draw its contents
[18:31:07] chrismccord: benwilson512 : it can be, but not in the traditional layout sense. So to be clear, your plug layout would only render the shell, and your LV "layout" would be a root view which rendered (or live_rendered) the child content
[18:31:41] benwilson512: yeah I gotta get familiar with this live parent / child thing
[18:31:54] chrismccord: benwilson512 : so d3 takes raw csv string and renders it?
[18:32:41] drincruz_: has joined #elixir-lang
[18:32:55] chrismccord: we are going to provide a way to push json data from the LV on the side as part of our js interop, but for this usecase, you could embed the data in the DOM and listen for phx:update on window
[18:34:42] chrismccord: <script type="text/csv" id="csv"><%= @csv %></script>
[18:35:32] chrismccord: document.addEventListener("phx:update", () => D3.DoCSV(document.getElementById("csv").innerText))
[18:35:41] benwilson512: if javascript is disabled, how do forms work on the live routes thing?
[18:35:46] benwilson512: w/ no controller create / update
[18:35:48] chrismccord: except you want to check that the csv content exists or has chagned
[18:35:56] chrismccord: phx:update is fired after every dom patch, but you get the idea
[18:36:03] chrismccord: benwilson512 : they don't
[18:36:26] benwilson512: so that's a situation where the standard controller approach may be best
[18:36:30] chrismccord: I'm not targeting noscript. You could make the form have an action and fallback to regular restful form stuff, but up to you
[18:38:10] icecreamcohen: has joined #elixir-lang
[18:39:12] benwilson512: yeah no worries we don't need to target noscript, this is a control tower UI
[18:39:16] benwilson512: the whole point is that it's live
[18:39:24] benwilson512: you don't do noscript with a live UI
[18:39:35] benwilson512: or if you do, you get no sympathy from me
[18:39:44] euler_: has joined #elixir-lang
[18:45:46] atomicnumber1: has joined #elixir-lang
[18:46:41] hypercore: chrismccord: thanks for the response chris, just wondering is there a way to stopPropogation to the liveview.js code (but not to my typehead.js code)?
[18:47:31] chrismccord: hypercore add it on the DOM element
[18:48:05] chrismccord: if it's a phx form, <%= text_input f, ..., oninput: "event.stopImmediatePropagation()" %>
[18:48:23] hypercore: chrismccord: won't that break the typehead script though?
[18:49:21] chrismccord: Oh I see, you have other bound stuff. Probably will break it. No idea how it works
[18:52:09] hypercore: yeah that's the problem i'm having when using phx_change: :validate with js-enhanced elements. I tried removing phx_change: :validate, and that solved this particular issue, but it also meant that whenever i clicked on another field in my form that had a LV event attached (<button phx-click="some-event">click me</button>), this would remove all the inputs i'd given for every other field (if it was a new
[18:54:07] chrismccord: hypercore : the bigger issue is typeahead.js probably doesn't do live bindings?
[18:54:31] chrismccord: looks like it's jquery selector based. LiveView DOM can appear/be removed at any time, so how are you binding the typahead stuff?
[18:54:57] chrismccord: even if we solve the change issue, I'm not sure it will play nice with the typeahead init
[18:54:58] hypercore: chrismccord: using mutation observers
[18:55:07] chrismccord: ahhh, okay that would work then
[18:55:08] hypercore: (which feels extremely hacky)
[18:55:16] hypercore: just doesn't feel clean
[18:56:23] hypercore: but i think it's going to be an issue for most js-enhancing libraries (typehead, selectize, etc etc), at least when phx_change is set
[18:57:46] serafeim: has joined #elixir-lang
[18:59:27] hypercore: it's quite a complicated issue, i could write a summary documenting my attempts if that would help
[18:59:57] hypercore: i imagine many others will face it down the road too
[19:03:36] hypercore: also regarding mutation observers, i haven't figured out how to implement them optimally either, they are usually triggered 3 or 4 times for a single change to an input
[19:06:45] work_: has joined #elixir-lang
[19:09:08] paxis: has joined #elixir-lang
[19:09:23] sacredfrog: has joined #elixir-lang
[19:10:51] paxis: has joined #elixir-lang
[19:15:44] PragTob: has joined #elixir-lang
[19:17:00] josevalim: BBQ enthusiasts saving the forum
[19:19:03] gonz_: This thread was illuminating, actually. It wasn't bad in the least. If anything it probably galvanized the cultists even more which you should like.
[19:19:41] keathley: I just want to talk about something important
[19:21:31] josevalim: gonz_: why do you insist on personal attacks?
[19:22:04] gonz_: I think you showed that you'd ideally have this cult of personality around you, is all.
[19:22:17] gonz_: You seem to have a willfully naive outlook on your position in the community
[19:22:25] gonz_: Which I can only assume is just an act
[19:22:40] josevalim: gonz_: quite the opposite. I was very clear, mutiple times, including on the previous thread, that I would like to be treated like a regular person
[19:23:00] gonz_: That's the naive part about it
[19:23:16] gonz_: Why do you even believe you're just "a regular person" in this context?
[19:23:39] josevalim: because I am, there is literally nothing special about me
[19:24:08] gonz_: Anyone who has the platform you have can't simply be "a regular person" in the community
[19:24:14] gonz_: Same goes for chrismccord
[19:25:03] gonz_: And that was my whole point 3-4 at the end of last year, that chrismccord would either be so unaware of the community or simply not care isn't really acceptable, IMO
[19:25:11] josevalim: which platform?
[19:25:13] gonz_: That whole thing was handled terribly
[19:25:43] chrismccord: I missed the points, so lack the contex
[19:25:44] gonz_: Do you legitimately not understand or are you just being obtuse? You have a platform with which you can announce, speak, change outlooks
[19:26:01] chrismccord: but for real keathley, as a vegetarian what are my bbq options
[19:26:15] chrismccord: I'm a pimento cheese fan, if it helps
[19:26:23] josevalim: gonz_: I understand, I just don't agree. At the end of the day, it is irrelevant
[19:26:25] gonz_: chrismccord: I raised the point that I think LiveView was handled terribly in terms of how it impacted the community. You stepped all over Drab, for example, when you could've taken the opportunity to integrate it
[19:26:28] keathley: chrismccord: at least at my house you're good with essentially all sides besides baked beans
[19:26:52] gffranco: has joined #elixir-lang
[19:27:08] gonz_: josevalim: Yes, we have a fundamentally incompatible view of what your position and responsibility is in the community
[19:27:13] gonz_: It won't change
[19:27:21] gonz_: And that's fine
[19:27:22] keathley: good baked beans have pork or bacon in them so those are gunna be a non-starter. Do you eat fish at all?
[19:27:22] josevalim: gonz_: it is the same inconsistency you point out in the forum. you hate the cult of personality but at the same time you are strongly promoting it
[19:27:43] gonz_: No, I'm actually asking you to take more responsibility in moderating the effects of it
[19:27:47] icecreamcohen: you can bbq jackfruit with pretty good results
[19:27:54] chrismccord: gonz_ : I didn't read the thread. I was unaware of what has happening in Drab outside of "jquery for the server". Regardless, "when you could've taken the opportunity to integrate it" is not a snap of the fingers
[19:27:54] gonz_: You seem to be resistant to the idea that people form these cults
[19:27:59] chrismccord: and we have very different approaches
[19:28:16] josevalim: gonz_: no, i understand people form cults
[19:28:22] chrismccord: gonz_ : it's another case of demanding others to contribute more
[19:28:29] josevalim: gonz_: what i am saying is that you and others should just stop forming those cults
[19:28:43] chrismccord: which I'm not interested in debating. keathley for real I had an egg sandwhich at a bbbq get together
[19:28:52] chrismccord: I took two buns and an egg and slathered in bbq saucse
[19:28:54] josevalim: gonz_: do you understand you whole argument is strenghtning the whole idea of a cult?
[19:28:54] chrismccord: does this count as bbq?
[19:28:56] chrismccord: It was amazing
[19:29:12] gonz_: josevalim: I don't agree at all, no
[19:29:21] gonz_: It's not a question of "understanding" that
[19:29:28] keathley: chrismccord: eh...ish? I strongly endorse icecreamcohen's suggestion of jackfruit.
[19:29:32] gonz_: You have that opinion but you also lack any and all perspective on this
[19:29:53] icecreamcohen: you can actually BBQ it and get a smoky flavor
[19:29:57] keathley: bbq-sauce does not bbq make IMO
[19:30:11] gonz_: Like I said, none of this will change and that's fine
[19:30:17] keathley: yeah the first time I had jackfruit it blew my mind how good it was
[19:30:30] icecreamcohen: chrismccord: have you ever had it?
[19:30:35] gonz_: You've made a terrific language but the community is turning into an obnoxious echo chamber
[19:30:36] josevalim: gonz_: you know that i could literally say the same to you, right? "You have that opinion but you also lack any and all perspective on this"?
[19:30:47] chrismccord: icecreamcohen : no, but now I want to :)
[19:30:51] josevalim: this type of personal attacks does not help move the discussion forward, and you spread them all over the place
[19:31:11] icecreamcohen: It’s really good. When are you coming back out here?
[19:31:58] josevalim: i am too tired to see where it falls on the list of fallacies. but you are literally not arguing against the point of being made
[19:32:23] josevalim: you just decide that i don't have any perspective on it as an excuse to not discuss the topic in question
[19:32:45] gonz_: You're not even willing to see the basic premise
[19:32:56] gonz_: It's completely pointless to even go further with this
[19:33:14] josevalim: gonz_: what is the premise?
[19:33:34] icecreamcohen: josevalim: when you have a moment, I’d like to ask a couple questions about nimble_parsec
[19:33:39] gonz_: icecreamcohen: If you hadn't noticed my 3 last messages have pretty much been "Let's just stop"
[19:33:50] icecreamcohen: but you’re not
[19:33:54] icecreamcohen: so let’s move on
[19:33:57] gonz_: Do you not ever read the chat?
[19:34:14] gonz_: Or do you have josevalim on ignore?
[19:34:25] gonz_: Because how on earth do you not see who's continuing the conversation?
[19:34:32] josevalim: gonz_: warn
[19:34:48] jegaxd26: has joined #elixir-lang
[19:34:52] icecreamcohen: yeah, I’m bad at reading. you’re right.
[19:35:19] icecreamcohen: josevalim: in nimble_parsec, is there a way to get column information other than calculate it via the offet and line?
[19:35:50] josevalim: icecreamcohen: i don't think so because column information is expensive to compute
[19:35:59] josevalim: so we don't want to do it by default
[19:36:06] josevalim: i think there were some discussions about that
[19:36:09] icecreamcohen: i figured that was the reason.
[19:36:28] icecreamcohen: basically, if you want to compute it, you have to make a source map
[19:36:32] icecreamcohen: or something like that.
[19:37:37] benwilson512: icecreamcohen: we compute column information in the absinthe parser if you'd like an example
[19:37:43] benwilson512: although bruce wrote it, I don't know the first thing about it
[19:38:05] benwilson512: https://github.com/absinthe-graphql/absinthe/blob/master/lib/absinthe/lexer.ex
[19:38:06] icecreamcohen: I computed it myself too by creating a map of offet -> {line, column} tuples
[19:38:36] serafeim: has joined #elixir-lang
[19:38:47] icecreamcohen: I just wanted to make sure I wasn’t missing something
[19:38:58] josevalim: icecreamcohen: please apologize, but i will continue the discussion
[19:39:04] josevalim: gonz_: again, please enlighten me of the premise
[19:39:13] icecreamcohen: apologize for?
[19:39:26] josevalim: icecreamcohen: the message i sent just after :P
[19:40:26] benwilson512: idiom mismatch I think. In any case, anyone know how to get vscode to treat leex as eex?
[19:40:38] icecreamcohen: josevalim: I’m not understanding. Did I say something wrong here?
[19:40:49] josevalim: icecreamcohen: ohhhhhh, sorry
[19:40:51] benwilson512: icecreamcohen: he meant "accept my apology"
[19:41:04] josevalim: yes, i have the habit of skipping pronouns, sorry
[19:41:14] icecreamcohen: You made a killer lexer and you’re apologizing. Lol.
[19:41:16] josevalim: and that is really bad in english
[19:41:27] josevalim: but totally works in portuguese
[19:41:50] icecreamcohen: I thought I upset ya.
[19:41:57] icecreamcohen: which would be tough
[19:49:51] pera: has joined #elixir-lang
[19:53:20] icecreamcohen: has joined #elixir-lang
[19:55:43] josevalim: yes, watch out, i am a very important person, leader of a very powerful cult
[19:55:50] josevalim: i have a platform that can reach millions of people!
[19:56:06] josevalim: so you better stay on my good side
[19:56:50] icecreamcohen: do you have a bad side?
[19:57:51] kyrylo: has joined #elixir-lang
[19:58:06] josevalim: sure. people who see it don't live to tell about it
[19:58:32] josevalim: btw, the cult meeting will start tomorrow at 10am. bring your donations (i may as well start capitalizing on this)
[19:59:05] josevalim: and after the meeting we will go for BBQ
[19:59:14] josevalim: due to popular demand
[20:00:05] icecreamcohen: as long as it’s jackfruit
[20:02:27] icecreamcohen: Yeah, it’s a sweet fruit that you can shred and BBQ like pulled pork
[20:02:41] icecreamcohen: when you do, it gets that great smoky BBQ flavor
[20:02:54] icecreamcohen: chrismccord: is a veg, so no pork
[20:03:01] josevalim: sounds interesting!
[20:03:24] josevalim: yes, we will have jackfruit. anything to strengthen the cult and galvanize my position
[20:04:07] icecreamcohen: I don’t understand the position tbh, I’m here to get work done
[20:04:11] icecreamcohen: not join a cult
[20:04:17] icecreamcohen: though I am a bit of a zealot
[20:06:10] josevalim: too late, you joined the cult as soon as you entered this chat
[20:06:14] josevalim: and this is like hotel california
[20:06:57] icecreamcohen: so to be fair, once I checked in to elixir, I knew I’d forever miss a bunch of the things that it gives you.
[20:08:03] icecreamcohen: is that a cult, or is that just realizing what the erlang community has known for 30 years?
[20:09:04] josevalim: it is cults all the way down
[20:09:24] josevalim: and if you disagree you are lacking perspective
[20:09:52] icecreamcohen: what I don’t like is the reappropriation of words to mean things that they dind’t mean before.
[20:09:55] tristanm_: its why MononcQc always warns against drinkingi the koolaid
[20:10:53] wsieroci: has joined #elixir-lang
[20:11:15] Gika: has joined #elixir-lang
[20:16:44] jegaxd26: has joined #elixir-lang
[20:19:47] icecreamcohen: josevalim: are you still here?
[20:19:52] icecreamcohen: I had one more question
[20:19:54] josevalim: icecreamcohen: yes
[20:20:11] icecreamcohen: do you have suggestions for dialyzer and nimble_parsec?
[20:20:21] josevalim: i have but you may not like them?
[20:20:23] icecreamcohen: I got a bunch of “this function is never called” errors
[20:20:34] josevalim: don't use dialyzer :P
[20:20:57] josevalim: i guess we need to mark the code generated by nimble_parsec as generated?
[20:21:03] icecreamcohen: what should I use?
[20:21:31] josevalim: so the issue is that we generate tons of code in nimble-parsec
[20:21:45] josevalim: and we inline tons of stuff
[20:22:13] icecreamcohen: that makes sense
[20:22:25] josevalim: so i guess dialyzer can see some of those can never be reached and complain
[20:22:25] icecreamcohen: I was slightly concerned that I wasn’t doing something correctly
[20:22:42] josevalim: we should raise if that happens
[20:23:50] icecreamcohen: some of my errors are actually on the non-generated code though
[20:24:03] icecreamcohen: or is that just part and parcel to the approach taken by nimble_parsec?
[20:34:28] josevalim: icecreamcohen: so maybe there are actual errors in there
[20:34:38] josevalim: icecreamcohen: can you reach those clauses during manual testing?
[20:35:18] icecreamcohen: some of the clauses are absolutely essential for the grammar
[20:38:20] icecreamcohen: it’s not the biggest deal
[20:38:29] icecreamcohen: I can ignore them
[20:39:16] duaneb: has joined #elixir-lang
[20:40:12] lexmag: has joined #elixir-lang
[20:42:29] dimitarvp: has joined #elixir-lang
[20:42:32] icecreamcohen: has joined #elixir-lang
[20:52:35] ur5us: has joined #elixir-lang
[21:05:19] kiltzman: has joined #elixir-lang
[21:11:56] icecreamcohen: has joined #elixir-lang
[21:54:22] notzmv: has joined #elixir-lang
[21:55:41] Gika: has joined #elixir-lang
[22:03:54] icecreamcohen: has joined #elixir-lang
[22:06:46] helmut_1: has joined #elixir-lang
[22:09:44] helmut_1: has left #elixir-lang: ()
[22:30:42] __charly__: has joined #elixir-lang
[22:32:30] drincruz_: has joined #elixir-lang
[22:38:31] tutti: has joined #elixir-lang
[22:41:55] icecreamcohen: has joined #elixir-lang
[22:59:25] jegaxd26: has joined #elixir-lang
[23:12:44] duaneb: has joined #elixir-lang
[23:30:48] jegaxd26: has joined #elixir-lang
[23:35:05] nickjj: josevalim, this has probably been asked a bunch of times, but if mix format warns about deprecations where you should be using the raw erlang function instead of elixir, would it be possible to have the warning convert your elixir code into valid erlang?
[23:37:14] craigp_: has joined #elixir-lang