workspace stringclasses 4
values | channel stringclasses 4
values | text stringlengths 1 3.93k | ts stringlengths 26 26 | user stringlengths 2 11 |
|---|---|---|---|---|
elmlang | general | Why do you think that would help? | 2019-04-17T07:57:46.346500 | Danika |
elmlang | general | <https://gist.github.com/hansv/79e3b91eb38ea06d47886da5083cbd0b> | 2019-04-17T08:12:04.346700 | Kathryn |
elmlang | general | That looks just like mine. :slightly_smiling_face: I just realized I’m in the same boat as you! :disappointed: | 2019-04-17T08:32:11.346900 | Jeanene |
elmlang | general | I think I’ve ignored it b/c my package is just 40kb :confused: | 2019-04-17T08:33:43.347100 | Jeanene |
elmlang | general | Thanks <@Augustus>…This is gonna take a while for me. I’m trying to refactor elm-spa-example to use elm/http 2.0 and it’s a B. | 2019-04-17T08:34:33.347300 | Jeanene |
elmlang | general | The quest for Webpacker configuration continues. | 2019-04-17T08:36:13.347500 | Kathryn |
elmlang | general | Does webpacker auto configure elm? | 2019-04-17T08:47:40.347800 | Agustin |
elmlang | general | Is it a bug with them? | 2019-04-17T08:47:45.348000 | Agustin |
elmlang | general | they should probably migrate to *Parcel* instead :joy: | 2019-04-17T08:51:02.348500 | Lionel |
elmlang | general | :package: | 2019-04-17T08:51:22.348700 | Danika |
elmlang | general | The config you need to generate is, `options: { optimize: true }` inside the `use` statement for `elm-webpack-loader` (assuming you’re using that) | 2019-04-17T08:51:45.348800 | Agustin |
elmlang | general | I’m not sure Rails has Parcel integration :wink: | 2019-04-17T08:52:42.349500 | Agustin |
elmlang | general | (If they’re using webpack*er* then its because of Rails, not Elm). | 2019-04-17T08:52:55.349900 | Agustin |
elmlang | general | there's this: <https://github.com/michaldarda/parcel-rails> | 2019-04-17T08:53:47.350100 | Danika |
elmlang | general | I've never touched ruby/rails in my life, though | 2019-04-17T08:53:58.350500 | Danika |
elmlang | general | Webpacker became the blessed way to do assets in Rails | 2019-04-17T09:09:08.350900 | Agustin |
elmlang | general | Thus it is considered a good idea ™ to use it | 2019-04-17T09:09:16.351200 | Agustin |
elmlang | general | You can't make use of the Monad instance of Reader in Elm. In Haskell, for example, you can write
```
view :: Reader Session
view = do
session <- ask
return $ div [] [] -- etc.
```
In Elm it's pretty much useless because you would have to do the wrapping/unwrapping yourself and it doesn't bring a lot of va... | 2019-04-17T09:10:25.351400 | Dayna |
elmlang | general | Thanks Jon, that did the trick. Rails generates an elm.js file and that is where I added the optimize: true. Deployed and I get no more warnings about dev mode. | 2019-04-17T09:23:17.351900 | Kathryn |
elmlang | general | It's important to keep those pages (and packages) working for those who are still running apps on 0.18 and older | 2019-04-17T09:42:46.352700 | Carman |
elmlang | general | I agree having a banner at the top saying "This package only supports Elm 0.18" would be a big win | 2019-04-17T09:43:08.352900 | Carman |
elmlang | general | :clap::skin-tone-3: is this in the docs for elm-webpack-loader?? | 2019-04-17T10:11:26.353300 | Jeanene |
elmlang | general | passes options thru to elm make | 2019-04-17T10:12:00.353500 | Jarvis |
elmlang | general | from what I read it seems to be meant to quickly access large configs/structures without having to pass it around so much? in this case it would be helpful to access the model and its fields in a large view, wherever it was necessary | 2019-04-17T10:13:44.353700 | Vilma |
elmlang | general | is there something similar which works in Elm? | 2019-04-17T10:16:28.353900 | Vilma |
elmlang | general | Not really, there is a Reader library for Elm: <https://package.elm-lang.org/packages/bigbinary/elm-reader/latest/>, you can try that out if you want | 2019-04-17T10:24:35.354100 | Dayna |
elmlang | general | I’m sure I solved this in the past already but maybe someone can give me a pointer: why do my `post` request do not correctly set a session cookie when sent from Elm but are correctly set when I send the requests from a rest client (like insomnia or postman). Do I need to set a custom/extra header in Elm that allows se... | 2019-04-17T15:06:21.357700 | Moshe |
elmlang | general | How do people connect to AWS RDS via Elm? I found ktonon/elm-aws-core but it looks like it hasn’t been updated for 0.19 yet. | 2019-04-17T16:01:38.358800 | Wendell |
elmlang | general | I suppose I could just make Http requests but wondering if there is something nicer for querying. | 2019-04-17T16:02:14.359500 | Wendell |
elmlang | general | <@Wendell> I would do it from the server side rather than on the front end, to do it on the frontend you’d need to give the client side credentials to hit the database and they wouldn’t be secret there | 2019-04-17T16:09:54.360700 | Alicia |
elmlang | general | it is likely CORS preventing it, you have to use `withCredentials` to pass them <https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials>
And the server you are connecting to has to return an `Access-Control-Allow-Credentials` header saying that it is OK | 2019-04-17T16:11:22.360800 | Alicia |
elmlang | general | Yeah that’s a good point. I’ve been trying to test the limits of serverless but this might be pushing it too far. | 2019-04-17T16:27:18.362100 | Wendell |
elmlang | general | I’m not familiar with doing it in serverless, but I’m sure something similar to what you can do on AWS is possible, there you’d have an API gateway with some routes set up to call your lambda function, and then the lambda function could run the actual query | 2019-04-17T16:55:42.363600 | Alicia |
elmlang | general | in elm you can do that here | 2019-04-17T17:25:43.363800 | Mozella |
elmlang | general | <https://package.elm-lang.org/packages/elm/http/latest/Http#riskyRequest> | 2019-04-17T17:25:45.364000 | Mozella |
elmlang | general | Is there a simple way to xor two strings together? I notice that I can convert them to bytes using `elm/bytes`, but then there are no available functions for operations on those bytes | 2019-04-17T17:29:11.365000 | Isaiah |
elmlang | general | This problem _seems_ simpler than it is. There are multiple ways to represent the same string in bytes - utf8, utf-16, utf-32, ... | 2019-04-17T17:34:56.365100 | Huong |
elmlang | general | so you have to pick a binary representation, and then xor. Then there's the issue that the result may no longer be a valid representation of a string | 2019-04-17T17:35:34.365300 | Huong |
elmlang | general | So what I'd probably do, is, use something like <https://package.elm-lang.org/packages/zwilias/elm-utf-tools/latest>, pick a representation, turn both strings into the same type of bytes, `List.map2 Bitwise.xor` them, and finally try to turn the result into a string again | 2019-04-17T17:37:18.365500 | Huong |
elmlang | general | Thanks, I'll give that a try | 2019-04-17T17:47:54.365800 | Isaiah |
elmlang | general | What’s your objective in doing this? | 2019-04-17T17:56:03.366000 | Dede |
elmlang | general | I'm implementing the SCRAM-SHA-1 algorithm for authentication | 2019-04-17T17:56:59.366200 | Isaiah |
elmlang | general | I’m guessing the formal defintion defines with painstaking precision how you’re supposed to represent all the bits :slightly_smiling_face: | 2019-04-17T18:01:46.366400 | Dede |
elmlang | general | Yeah, username/password should be encoded as utf8 and normalized using the SASLpref profile of the stringprep algorithm (or, alternatively, disallow non US-ASCII unicode codepoints) | 2019-04-17T18:05:18.366600 | Huong |
elmlang | general | I'm wondering how to have `onKeyDown` and `preventDefault` (e.g. for the `TAB` key in a game. Can anybody help? :) | 2019-04-17T18:28:09.368200 | Millie |
elmlang | general | I guess here are no options: <https://package.elm-lang.org/packages/elm/browser/latest/Browser-Events#onKeyDown> | 2019-04-17T18:28:39.368300 | Millie |
elmlang | general | But a custom html event listener could work: <https://package.elm-lang.org/packages/elm/html/1.0.0/Html-Events#on> | 2019-04-17T18:29:02.368500 | Millie |
elmlang | general | I think you do it with this: <https://package.elm-lang.org/packages/elm/html/latest/Html-Events#preventDefaultOn> | 2019-04-17T18:30:31.368700 | Dede |
elmlang | general | Which is like `on` but with the extra magic. | 2019-04-17T18:30:40.368900 | Dede |
elmlang | general | Jap, I think I've trouble registering keypresses. Could be me doing something wrong. | 2019-04-17T19:19:01.369100 | Millie |
elmlang | general | ```listener =
preventDefaultOn "keydown" <| Decode.map (\m -> ( m, True )) <| Decode.succeed (KeyDown "a")
``` as en example | 2019-04-17T19:20:28.369300 | Millie |
elmlang | general | This helped: It has to do with focus and tabindex: <https://package.elm-lang.org/packages/Gizra/elm-keyboard-event/latest/Keyboard-Event> | 2019-04-17T19:29:17.369600 | Millie |
elmlang | general | So this is the example how to use the "outermost" div and focus and tabIndex to workaround the missing preventDefault in "onKeyDown": <https://gizra.github.io/elm-keyboard-event/OutermostDiv.html> | 2019-04-17T19:49:21.369800 | Millie |
elmlang | general | I used to have a 0.19 version of elm, but today I installed a 0.18 version of elm using "npm install -g", which made me unable to open elm now. Who has a good solution? | 2019-04-17T21:46:02.370400 | Carrie |
elmlang | general | you can either `npm uninstall -g elm` to remove the npm binary and let the original binary take precedence again. or you can `npm install -g elm@0.19` and get the latest version through npm | 2019-04-17T22:27:32.370500 | Lashawnda |
elmlang | general | I tried and it turned out that this was the case. | 2019-04-17T22:49:06.370700 | Carrie |
elmlang | general | Download installer
<https://guide.elm-lang.org/install.html> | 2019-04-17T22:59:32.371100 | Rebekah |
elmlang | general | What should I do? There are already two versions of my computer. | 2019-04-18T00:49:44.371300 | Carrie |
elmlang | general | <@Alicia> Aaaah. Right! I think that was the problem. Thanks for the heads up :slightly_smiling_face: | 2019-04-18T02:13:19.371700 | Moshe |
elmlang | general | Is there any way in Elm to detect if on focusout the entire container loses focus? You get this event for child nodes as well if you navigate between child nodes for example. But I would like to know when the entire container loses "focus". In JavaScript people seem to do that by checking if the document.activeElement ... | 2019-04-18T03:27:55.373400 | Erlene |
elmlang | general | Write an event handler for focusout that stops propagation? | 2019-04-18T03:31:42.373800 | Earnest |
elmlang | general | <@Earnest> the focusout fires only once. | 2019-04-18T03:32:05.374200 | Erlene |
elmlang | general | But if you set it on a container it seems it is also set on the children. | 2019-04-18T03:32:25.374500 | Erlene |
elmlang | general | So when one of the children loses focus, it fires too. | 2019-04-18T03:32:41.375000 | Erlene |
elmlang | general | At the moment I can't seem to distinguish between the case where the focus moves between children, or away from the container. | 2019-04-18T03:33:04.375500 | Erlene |
elmlang | general | So it's still called on the parent if you stop propagation from the children? | 2019-04-18T03:34:04.375900 | Earnest |
elmlang | general | Html events bubble by default, the event object has a `target` field that is the *specific* element that fired the event.
In javascript I might do something like: `e.target.matches(‘#myParentNode’)` or `e.target === e.currentTarget`.
The second solution should be doable in Elm no problem. | 2019-04-18T03:36:41.379100 | Danika |
elmlang | general | <@Earnest> haven't tried this exactly, but the child has the blur element which does not bubble. Exactly what I need. But there's only one focusout event, not one for the child and then one for the parent. | 2019-04-18T03:40:35.380500 | Erlene |
elmlang | general | <@Danika> the target is always the child node. | 2019-04-18T03:40:49.380800 | Erlene |
elmlang | general | The child node has tabindex="0", so it has focus. If I tab out, the focusout event fires with target this child node. | 2019-04-18T03:41:14.381500 | Erlene |
elmlang | general | But the currentTarget is your parent node, they aren’t the same. | 2019-04-18T03:41:53.382300 | Danika |
elmlang | general | <@Danika> true, but that doesn't help me. If I move between child nodes currentTarget is still the container element. | 2019-04-18T03:46:17.383300 | Erlene |
elmlang | general | Oh I misread the last sentence, hmm.. | 2019-04-18T03:47:11.384100 | Danika |
elmlang | general | Ah, it seems I can actually use relatedTarget. Just need to see if the parent of related target is my container or not. Let me try that. | 2019-04-18T03:49:27.384700 | Erlene |
elmlang | general | what's the nicest way to update Browser.Dom.getElement exactly when the result would change? so i guess on window size change, layout change and scroll position change? | 2019-04-18T04:32:01.385500 | Emilee |
elmlang | general | i could just chuck an animationFrame sub in there, but would that needlessly be called when nothing's being repainted? | 2019-04-18T04:32:25.386100 | Emilee |
elmlang | general | (i want to have a dropdown open to the top or bottom depending on where there's more space^^) | 2019-04-18T04:32:59.386600 | Emilee |
elmlang | general | <@Erlene> I didnt know about relatedTarget, hope it works! | 2019-04-18T04:39:48.387200 | Danika |
elmlang | general | Anyone have opinions about Apprun.js | 2019-04-18T04:46:28.387400 | Carlo |
elmlang | general | I’m working on something similar but for audio apps, so hopefully some positive ones | 2019-04-18T05:12:23.388000 | Danika |
elmlang | general | related: <https://elmlang.slack.com/archives/C4F9NBLR1/p1554859211186000?thread_ts=1554856744.185800&cid=C4F9NBLR1> | 2019-04-18T06:46:17.388300 | Velia |
elmlang | general | hmm, when my viewport gets smaller than my scene the result of `getViewport` doesn't shrink any further O.o | 2019-04-18T07:01:30.389000 | Emilee |
elmlang | general | so basically the smallest `height` of a viewport i get is the `height` of the scene | 2019-04-18T07:58:05.390000 | Emilee |
elmlang | general | <@Emilee> all the tasks in `Browser.Dom` wait for the next animation frame | 2019-04-18T07:58:14.390200 | Earlean |
elmlang | general | a viewport is always smaller than the scene that it's a viewport in to | 2019-04-18T08:00:12.390700 | Earlean |
elmlang | general | umm, i have exactly the opposite situation | 2019-04-18T08:00:28.391000 | Emilee |
elmlang | general | ah okay, not opposite | 2019-04-18T08:00:44.391300 | Emilee |
elmlang | general | it's always the same size here | 2019-04-18T08:00:51.391700 | Emilee |
elmlang | general | sure, you'll get that if your viewport is the whole scene | 2019-04-18T08:01:19.392200 | Earlean |
elmlang | general | yes, but if my viewport is smaller than the scene (my browser gets a scrollbar, etc.) they're still the same height | 2019-04-18T08:02:00.392800 | Emilee |
elmlang | general | as far as elm is concerned | 2019-04-18T08:02:06.393000 | Emilee |
elmlang | general | Are you familiar with this? <https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/UsingtheViewport/UsingtheViewport.html> | 2019-04-18T08:05:03.393600 | Dede |
elmlang | general | (I’m not sure if it’s relevant, I’m just pattern matching.) | 2019-04-18T08:05:12.394000 | Dede |
elmlang | general | <@Emilee> is it the window that has the scrollbar? or an element inside the window? | 2019-04-18T08:09:53.394900 | Earlean |
elmlang | general | should be the window. the viewport *does* move (changes `y`) when i scroll | 2019-04-18T08:27:53.395300 | Emilee |
elmlang | general | sorry I kind of got interrupted by a cleanup bug that I had to fix^^ | 2019-04-18T08:28:35.395800 | Emilee |
elmlang | general | Turns out if you keep an animation frame sub running your elm app doesn't get gc'ed :sweat_smile: | 2019-04-18T08:29:11.396500 | Emilee |
elmlang | general | I'll have to look into the viewport stuff again tomorrow, i gotta go now. thanks for all your help :slightly_smiling_face: | 2019-04-18T08:29:44.396900 | Emilee |
elmlang | general | Was anyone faced with problems with the Firefox GC using most of the time due to full nursery ? Elm or otherwise. | 2019-04-18T09:52:18.398500 | Caron |
elmlang | general | I ran into problems because I had over 20,000 virtual dom nodes. I solved it by only constructing vnodes that were visible on screen, bringing it down to under 700 vnodes. | 2019-04-18T11:11:02.400700 | Isaiah |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.