workspace
stringclasses
4 values
channel
stringclasses
4 values
text
stringlengths
1
3.93k
ts
stringlengths
26
26
user
stringlengths
2
11
elmlang
general
With ports and base64-encoded strings, it can be done but it’s rather hacky
2019-04-23T07:21:47.215700
Huong
elmlang
general
(got a bunch of dependencies that depend on `elm/http` v1)
2019-04-23T07:21:52.215800
Kimbery
elmlang
general
I guess there's no way to install from github with 0.19? (I see there's a pending PR against elm-http-builder)
2019-04-23T07:25:24.216300
Kimbery
elmlang
general
There is <https://github.com/Skinney/elm-git-install> but are you going to have two versions of `elm/http` in your app?
2019-04-23T07:26:50.216700
Lynne
elmlang
general
I was going to fork http-builder and merge the PR in.
2019-04-23T07:27:26.217300
Kimbery
elmlang
general
Ah, then that tool might help
2019-04-23T07:27:42.217800
Lynne
elmlang
general
does elm-git-install work with 0.19?
2019-04-23T07:27:46.217900
Kimbery
elmlang
general
Yes
2019-04-23T07:27:50.218100
Lynne
elmlang
general
oh awesome - phew
2019-04-23T07:27:57.218400
Kimbery
elmlang
general
that gets me out of a tricky spot
2019-04-23T07:28:02.218600
Kimbery
elmlang
general
always used elm-github-install with 0.18, exactly for moments like this
2019-04-23T07:28:44.219300
Kimbery
elmlang
general
hopefully the PR for elm-http-builder will be merged fairly soon
2019-04-23T07:28:58.219800
Kimbery
elmlang
general
Actually, I don't know but someone mentioned here it was updated if I remember correctly
2019-04-23T07:29:08.220100
Lynne
elmlang
general
looks like it from the readme yeah
2019-04-23T07:29:19.220300
Kimbery
elmlang
general
`elm-git-install` was specifically made for 0.19. It just clones the dependency and adds it to your source-directories, so it’s not quite the same thing as installing a regular package (i.e. won’t work for packages with kernel code etc, which essentially means it’s a pretty safe thing to do!)
2019-04-23T07:32:04.221700
Huong
elmlang
general
It used to exist in 0.18 as well
2019-04-23T07:32:43.222100
Lynne
elmlang
general
that seems fine, shame it has to do a clone but I can live with it temporarily
2019-04-23T07:32:59.222400
Kimbery
elmlang
general
different author, different tool :slightly_smiling_face:
2019-04-23T07:33:24.222600
Huong
elmlang
general
Only the name stays :smile:
2019-04-23T07:33:53.222800
Lynne
elmlang
general
close enough - elm-git-install &lt;-&gt; elm-github-install :smile:
2019-04-23T07:34:24.223000
Huong
elmlang
general
Ah, I did not realize it was github-install
2019-04-23T07:35:38.223300
Lynne
elmlang
general
so to recap, it’s a different tool with a different name by a different author, solving a related but different problem (elm-github-install specifically wanted to make it possible to install kernel code) :smile:
2019-04-23T07:36:48.223500
Huong
elmlang
general
Yeah, duck test seems to pass
2019-04-23T07:38:10.223700
Lynne
elmlang
general
is there a way to check if there are any pending Cmds still being processed? Ie. I do a Cmd.batch of HTTP requests, and I want to know if any of them are still loading?
2019-04-23T07:58:02.225200
Gertrude
elmlang
general
There's no way of doing it via Cmds, you'd need to track their status yourself in the Model.
2019-04-23T08:01:25.225900
Kimbery
elmlang
general
Depending on your needs you might consider <https://package.elm-lang.org/packages/krisajenkins/remotedata/latest/RemoteData>
2019-04-23T08:02:06.226200
Kimbery
elmlang
general
<https://package.elm-lang.org/packages/elm/http/latest/Http#Progress>
2019-04-23T09:11:19.226600
Lea
elmlang
general
hmm, can i somehow install a global event handler in elm?
2019-04-23T09:13:12.227200
Emilee
elmlang
general
You mean like keypresses and suchlike? I don’t know of a generic way, although Browser.Events covers a lot of the most common stuff.
2019-04-23T09:24:17.228000
Dede
elmlang
general
scrolling, in particular
2019-04-23T09:27:03.229700
Emilee
elmlang
general
ISTR having to write a global handler in JS and wire it up with ports, although I can’t find the relevant code lying around right now.
2019-04-23T09:34:39.230600
Dede
elmlang
general
Something like `_window.addEventListener('scroll', scrolledOrResized);` which I just snagged from <http://guupa.com/elm-scroll-resize-events/>
2019-04-23T09:35:03.231000
Dede
elmlang
general
i see :slightly_smiling_face: i thought there was some change that made it possible to register global (body-level) handlers from within elm, but that might have just been a fever dream :wink:
2019-04-23T09:35:36.231700
Emilee
elmlang
general
i may just resort to grabbing animationframe, since scrolling doesn't actually catch every case I might recalculate my logic anyway. a lot of message spam, but that's okay i think^^
2019-04-23T09:36:26.232800
Emilee
elmlang
general
i hope the application doesn't become too much of a cpu hog that way ^^'
2019-04-23T09:36:45.233200
Emilee
elmlang
general
no you can't check for "pending Cmds", and `Http.Progress` isn't really for this either
2019-04-23T10:17:39.233900
Nana
elmlang
general
you can however have some value in the model which you update whenever you make a request, and when you get a response
2019-04-23T10:20:56.234200
Nana
elmlang
general
Is there a pass-thru decoder for `elm/bytes`? I'm downloading a file with progress using http and I'm using `expectBytes` which takes a message and a decoder. I want the decoder to just return the same bytes instead of decoding it into an elm value. (The bytes will be passed onto `File.Download.bytes`)
2019-04-23T11:17:35.237600
Caroline
elmlang
general
<@Caroline> Probably need to whip something up with `expectBytesResponse`: <https://package.elm-lang.org/packages/elm/http/latest/Http#expectBytesResponse>
2019-04-23T11:20:43.238300
Earnest
elmlang
general
<@Earnest> thanks - found a possible answer here I think - <https://stackoverflow.com/questions/52054917/downloading-file-from-post-request-with-elm>
2019-04-23T11:22:19.239300
Caroline
elmlang
general
Any Miami Elm developers here?
2019-04-23T11:54:26.239900
Frieda
elmlang
general
Orlando here, kinda close!
2019-04-23T12:00:09.240400
Alicia
elmlang
general
Couldn't find anything on client-side hydration with elm. Can elm be configured to recycle/hydrate existing HTML before rendering the page?
2019-04-23T12:15:12.241400
Maxwell
elmlang
general
Say I have an app that renders this HTML on the page `&lt;div&gt;&lt;div&gt;10&lt;/div&gt;&lt;button&gt;Increment&lt;/button&gt;&lt;/div&gt;`.
2019-04-23T12:17:42.243300
Maxwell
elmlang
general
If I serve my index.html with some pre-existing HTML that matches the HTML I wrote above, will elm reuse the nodes ("hydrate") or ignore it (duplicating the HTML by default)?
2019-04-23T12:18:59.245500
Maxwell
elmlang
general
In Elm, how much work triggered by an msg is synchronous? Is the call to `update` synchronous, the following render, calls make to Ports, etc…
2019-04-23T12:21:45.247900
Leoma
elmlang
general
It depends. Certain DOM events will call `update` synchronously and redraw the DOM synchronously afterwards (to prevent the jumping cursor type bugs). Other events, like an HTTP response coming in, will asynchronously trigger `update`, and `update` will then asynchronously schedule a render. Ports are (afaik) always triggered synchronously.
2019-04-23T12:24:40.248100
Huong
elmlang
general
Note that a lot of this changed between 0.18 and 0.19, but most of those changes shouldn’t have obvious impact on users, except a few things have now transparently become possible (such as trigger things through a port JS in response to a click event, within the same tick)
2019-04-23T12:25:55.248300
Huong
elmlang
general
Thanks. I wanted to call `.focus` on mobile safari. I’d have to do it over a port. Problem is that mobile Safari devs thought it would be nicer to only have `.focus` behave if called synchronousely from a user event.
2019-04-23T12:25:58.248500
Leoma
elmlang
general
So, I think this is impossible with Elm.
2019-04-23T12:26:19.248700
Leoma
elmlang
general
You should be able to do that in 0.19
2019-04-23T12:26:23.248900
Huong
elmlang
general
if it is in response to a user event, that is
2019-04-23T12:26:39.249100
Huong
elmlang
general
Oh. So the update via user event will be sync. And the render, AND the port calls?
2019-04-23T12:27:05.249300
Leoma
elmlang
general
pretty much!
2019-04-23T12:27:23.249500
Huong
elmlang
general
Oh great news! I’ll give that a go. THANK YOU for the info.
2019-04-23T12:27:45.249700
Leoma
elmlang
general
<@Maxwell> it’s not really supported right now, you can do it if you are using `Browser.element` because of a quirk of the implementation (it doesn’t clear out the node), but if you are using `Browser.application` there is no way
2019-04-23T12:35:03.251400
Alicia
elmlang
general
So, I can't find it now, perhaps I was hallucinating. ISTR there was an issue where batched Cmds could run asynchronously where the individual ones would run synchronously.
2019-04-23T12:35:27.251600
Dede
elmlang
general
relevant bits are <https://github.com/elm/browser/blob/master/src/Elm/Kernel/Browser.js#L45-L53> and <https://github.com/elm/browser/blob/master/src/Elm/Kernel/Browser.js#L83>
2019-04-23T12:35:40.251900
Alicia
elmlang
general
Perhaps it's closed, or I'm misremembering the details.
2019-04-23T12:35:41.252000
Dede
elmlang
general
Thanks <@Cleotilde>. I made this ellie to show what I mean: <https://ellie-app.com/5mg8w4VdnBLa1>
2019-04-23T12:36:07.252500
Maxwell
elmlang
general
I'll check out Browser.element.
2019-04-23T12:36:14.252700
Maxwell
elmlang
general
I've always wondered, is Elm's kernel JavaScript code, e.g., (src/Elm/Kernel/Browser.js) written by hand or by a compiler?
2019-04-23T12:42:24.254000
Maxwell
elmlang
general
hand
2019-04-23T12:42:32.254200
Huong
elmlang
general
Oh, I see.
2019-04-23T12:42:43.254600
Maxwell
elmlang
general
Hi. What are the guaranties regarding call order of cmd ports subscriptions on the javascript side? I have a case where 2 calls of my top-level update function writes to a port. The 1st call also returns a Random.generate. The unexpected behavior is that the data written to my port by the second update is passed to my javascript subscription before the data written by the first update. I know the commands execution order is not at all guaranteed, but I always thought it applied only to the commands emitted by a single update. Should I consider the behavior I observe as being normal?
2019-04-23T12:47:45.259900
Barney
elmlang
general
<@Erlene> You could hash (and possibly base64 encode) the string. That would make for a valid and unique class name.
2019-04-23T12:57:54.260000
Kenya
elmlang
general
I think it will work with `Browser.sandbox` as well, if you click `Compile` in ellie it will start with that `10` as the initial value in the HTML, and it won’t change until it re-renders
2019-04-23T14:45:01.260700
Alicia
elmlang
general
if you set the initial value to 10 on the elm side it should be seamless
2019-04-23T14:45:14.260900
Alicia
elmlang
general
Nope.
2019-04-23T14:45:38.261100
Maxwell
elmlang
general
As you can see in the ellie I posted, the DOM nodes are created from scratch every time.
2019-04-23T14:45:52.261300
Maxwell
elmlang
general
(That's what the animation/keyframes is for there in the CSS; to show a fade-in animation).
2019-04-23T14:46:23.261500
Maxwell
elmlang
general
A better question might be: where does Elm stand wrt SSR? Is it even desirable?
2019-04-23T14:49:11.261900
Maxwell
elmlang
general
oh I see what you mean, I guess it is not possible then :disappointed:
2019-04-23T14:56:11.262200
Alicia
elmlang
general
I thought it would diff starting from the node you give it and only replace if needed
2019-04-23T14:56:26.262400
Alicia
elmlang
general
Do you think this would be a desirable thing to have?
2019-04-23T14:56:52.262600
Maxwell
elmlang
general
I think so, there’s been talk about it before, server side rendering was going to be part of 0.19 but was dropped due to time constraints
2019-04-23T14:57:29.262800
Alicia
elmlang
general
How would SSR work in elm (in theory) since the compiler generates javacript that runs in the browser?
2019-04-23T14:58:55.263000
Maxwell
elmlang
general
oh, got a lead, it looks like it works when you aren’t in debug mode
2019-04-23T15:02:05.263300
Alicia
elmlang
general
None
2019-04-23T15:02:55.263500
Alicia
elmlang
general
In your gif, when you start clicking the button, the app has already started.
2019-04-23T15:05:46.263900
Maxwell
elmlang
general
There's a 1.5 second delay before calling `Elm.Main.init`.
2019-04-23T15:06:23.264200
Maxwell
elmlang
general
That's on purpose to see if the nodes are created twice.
2019-04-23T15:06:35.264400
Maxwell
elmlang
general
try it out, with `debug` on it replaces it twice like this
2019-04-23T15:28:10.264700
Alicia
elmlang
general
but without debug on it doesn’t replace it, the events only get hooked up after the 1.5s delay, but the nodes are there
2019-04-23T15:29:54.265100
Alicia
elmlang
general
I am trying to find out if I can start a good PWA project using Elm. Please help
2019-04-23T16:03:23.266100
Jesenia
elmlang
general
Elm(TEA)+PWA=?
2019-04-23T16:05:06.266400
Jesenia
elmlang
general
what is PWA?
2019-04-23T16:28:13.266800
Willodean
elmlang
general
Progressive Web App?
2019-04-23T16:29:18.267000
Briana
elmlang
general
Any Bulgarian Elm developers here? Please PM me.
2019-04-23T17:03:53.267600
Dayna
elmlang
general
<@Jesenia> : Try Create-elm-app from NPM. Two simple CLI commands and your Elm PWA is running :) Its amazing both for development and production.
2019-04-23T17:11:36.271400
Monnie
elmlang
general
<#C4HTCLHPV|server-side-renderer> i think you want to ask in here
2019-04-23T17:50:23.271600
Keneth
elmlang
general
<@Dayna> Just a stab at it: if the derivation happens within view code then the reference being compared can be to the unchanging value from the model.
2019-04-23T17:58:40.272000
Milda
elmlang
general
I'm trying to have a layout manager that I can reuse across different applications, that will manage each application component in a container that its responsible for. The way I'm trying to set it up right now is to have messages on the layout manager side that are specific to it (e.g. `type LayoutMsg = Resize | Move | Add | Remove | ... `), &amp; the content that its containing will have application-level messages (e.g. `type AppMsg = NoOp | QueryBackendForSomething | ChangeViews | LayoutMessage Layout.LayoutMsg | ... `). Right now I'm running into issues with 2 different message types (generic `msg` which is the app-level message and `LayoutMsg`) not being able to exist in one div's attributes (styling &amp; event handlers for the container, using `LayoutMsg`s) &amp; html (what the container is containing, which has `AppMsg`s that will get handled by the application's model update). I get the feeling that this isn't the right approach for this problem, so I'm wondering what the correct direction might be.
2019-04-23T20:06:51.279600
Fidela
elmlang
general
<@Fidela> you need another type to unify your LayoutMsg with your AppMsg
2019-04-23T20:11:46.280900
Earlean
elmlang
general
something in layout like, `type LayoutMsg msg = AppMessage msg | Resize | Move | Add | Remove | ... `?
2019-04-23T20:12:44.282600
Fidela
elmlang
general
Yep
2019-04-23T20:14:14.282900
Earlean
elmlang
general
in retrospect that makes sense; I kept trying to think how to join them on the application level; thank you :slightly_smiling_face:
2019-04-23T20:14:48.283500
Fidela
elmlang
general
Thanks you two, that was exactly the kind of insight I was hoping for
2019-04-23T23:51:12.285100
Jillian
elmlang
general
Hey everyone, is there any way on 0.19 to detect user leaving the current view? Meaning if user clicks the anchor we're handling loading new way as defined by stuff in `Browser.application` and that results in next requests. Would it be technically possible to found out currently loaded view and call functions producing commands for specific requests that are being tracked? Next thing is, I guess, to just combine cancel commands and new commands to init next view according to next URL
2019-04-24T00:40:19.287200
Floy
elmlang
general
I’m not sure I completely follow what behavior you’re after. It seems like you’re familiar with `Browser.application`, and therefore I assume `onUrlRequest` and `onUrlChange`…?
2019-04-24T00:44:24.288200
Dede