workspace
stringclasses 4
values | channel
stringclasses 4
values | text
stringlengths 1
3.93k
| ts
stringlengths 26
26
| user
stringlengths 2
11
|
---|---|---|---|---|
elmlang | general | Elm's definitely on the curve described here: <https://krausefx.com/blog/scaling-open-source-communities> There are natural tensions that are not easily resolved. | 2019-01-31T10:44:06.665000 | Dede |
elmlang | general | Hey <@Alison> long time no see :wave: | 2019-01-31T11:08:17.665200 | Teddy |
elmlang | general | I think it's ok that there are not a lot of Browser API suggestions. Building nice APIs is really much much harder than it seems. The `viewport` APIs in 0.19 are a really nice example of this IMO. It's a wonderful API that my team recently used in working with tooltips that made the process far easier than it's ever been in JS, but my understanding is that it took many revisions and failed attempts to get to what we have now. | 2019-01-31T11:27:27.665800 | Claretta |
elmlang | general | I'm also hoping that more collaboration on building nice APIs with ports can help inform the process of planning native APIs | 2019-01-31T11:28:18.666000 | Claretta |
elmlang | general | Hiya, Justin! Indeed | 2019-01-31T11:28:40.666500 | Alison |
elmlang | general | I’m not sure the process needs to be standardized at the current scale. There was an attempt previously to do a committee and apparently it wound up very bureaucratic and unpleasant for all involved.
Of course, processes are really hard and often need to change. Personally I think it’s something that could use improvement, either in how it works or at least how that’s communicated (but probably both).
There’s definitely an advantage to going to meetups and being able to talk through it with people in public, but that’s also a really big disadvantage to people who don’t live in big cities or near a person well-known and trusted in the community. | 2019-01-31T11:52:40.672700 | Cammy |
elmlang | general | Hello all anyone have an example how to make kanban board in js | 2019-01-31T12:17:00.673200 | Libby |
elmlang | general | This Slack is mostly about making things in Elm rather than directly in JS. | 2019-01-31T12:34:07.673700 | Dede |
elmlang | general | maybe <https://github.com/manjula91/trello-vanilla-javascript> | 2019-01-31T13:54:13.674400 | Alicia |
elmlang | general | None | 2019-01-31T16:41:28.674800 | Carman |
elmlang | general | Inspired by this conversation yesterday with <@Rutha> and <@Antonette> on handling conditional logic in the view, I created a diagram with some of the principles discussed. | 2019-01-31T16:43:01.676300 | Carman |
elmlang | general | None | 2019-01-31T16:43:13.676400 | Carman |
elmlang | general | I like to think of these as forming 3 sides of a triangle. This is the same principle viewed from slightly different perspectives | 2019-01-31T16:43:19.676800 | Carman |
elmlang | general | This :arrow_down: mentions and links to `Browser.Env`, but it doesn’t exist? :thinking_face:
<https://package.elm-lang.org/packages/elm/time/latest/Time#Zone> | 2019-01-31T17:24:13.677700 | Bernardo |
elmlang | general | <@Bernardo> Probably means `Browser.element` since you need to send a Cmd for `here` | 2019-01-31T17:32:41.678200 | Earnest |
elmlang | general | Ah, that could make sense, so it’s just a typo? <https://github.com/elm/time/commit/95b0e10bba9f01decfabf1dac68d7d126adaa0af#diff-9c6450089d61430cea09d4e9c512ad74R103> | 2019-01-31T17:35:42.678600 | Bernardo |
elmlang | general | <@Bernardo> I think it was something that was going to exist in Elm 0.19, but was decided against. | 2019-01-31T17:57:00.679800 | Earlean |
elmlang | general | Aha! This: <https://github.com/elm/package.elm-lang.org/pull/285> | 2019-01-31T18:19:19.680200 | Bernardo |
elmlang | general | hmm, for such a simple thing I'd rather do this though:
```
message : Bool -> Html a
message condition =
if condition then
div [class "active"] [ text "true" ]
else
div [ ] [ text "false" ]
```
shorter and no jumping between definitions | 2019-01-31T18:51:41.680300 | Nana |
elmlang | general | the first example is definitely ugly though :stuck_out_tongue: | 2019-01-31T18:53:22.680500 | Nana |
elmlang | general | and it'd be arguably even uglier with elm-format :smile: | 2019-01-31T19:00:23.680700 | Nana |
elmlang | general | another issue with splitting things up into smaller functions (when it's not done for reuse) is that it makes the reader wonder "is this function also used elsewhere?", but when it's inline you know it's not | 2019-01-31T19:10:16.681000 | Nana |
elmlang | general | Modeling state and module imports after one’s app UI seems to be a fairly intuitive thing to do, but it’s the biggest mistake one can make in a elm app as it grows.
It then leads to problems like:
how to do parent child communication
- exposing global Msgs
- exposing type aliases and reaching into children state
how to pass state between routes
- duplicate state
- exposing internal states
I’ve observed this tendency in my predecessor’s code, my own code (after I refactored their code) and in others on my team.
I’m starting to think this is a big problem. | 2019-01-31T19:28:17.686400 | Ruthann |
elmlang | general | <@Ruthann> If a child needs to communicate with an abstraction boundary beyond it's scope, I'll have it return a `Maybe OutMsg` type that the main update can case match against and make the given adjustments. For duplicate states, I'll keep anything re-usable between views in the top-level module and pass them to my views/updates as arguments, instead of keeping them in the subpage's model. | 2019-01-31T20:17:09.688500 | Earnest |
elmlang | general | Hiding the internals is only necessary if you need to ensure some variant holds for all potential values/transformations of the type. | 2019-01-31T20:20:24.690500 | Earnest |
elmlang | general | <@Ruthann> I feel the same way, and have started using the the outMsg with a defined structure | 2019-01-31T21:08:58.691100 | Euna |
elmlang | general | works fairly well and doesnt add too much boilerplate | 2019-01-31T21:09:08.691400 | Euna |
elmlang | general | > If a child needs to communicate with an abstraction boundary beyond it’s scope,
then something like OutMsg is good, we have our own way of handing that which we call `Job a` that contains global msgs. Since we still have some 3+ level nesting, OutMsgs would have to repeat themselves on the way up to a distant cousin making it impractical.
However, I’m talking more about the process of thinking which ends up needing a OutMsg. Time and time again, I catch myself modelling close to or being affect by the UI when thinking about state. | 2019-01-31T21:31:26.694300 | Ruthann |
elmlang | general | Or modules rather… I prolly need to write this out, pretty vague atm. | 2019-01-31T21:32:56.695300 | Ruthann |
elmlang | general | It’s almost as if, there is just the ( init, update, Msg, type alias ) in one module and that is completely independent of UI or should be.
Then there is the ( view ) all by itself which is happily nested like the UI. | 2019-01-31T21:34:10.696400 | Ruthann |
elmlang | general | And I’m finding it hard to separate the two. | 2019-01-31T21:34:26.696700 | Ruthann |
elmlang | general | for that I use type wrappers to guarantee ui state | 2019-01-31T21:54:31.697300 | Euna |
elmlang | general | extensible record? `{ a | field : Type, ... }` | 2019-01-31T21:55:39.698000 | Ruthann |
elmlang | general | None | 2019-01-31T21:55:48.698100 | Euna |
elmlang | general | except you know more specific, not just Html msg | 2019-01-31T21:56:34.699100 | Euna |
elmlang | general | I've been considering makeing my top level model contain the subModel and do a Page.viewModel | 2019-01-31T21:58:05.700100 | Euna |
elmlang | general | that way I can pass callbacks up the padder | 2019-01-31T21:58:15.700400 | Euna |
elmlang | general | ¯\_(ツ)_/¯ | 2019-01-31T21:58:20.700500 | Euna |
elmlang | general | Hello! I have been trying to find a way to start a subscription from the update function (I need to open a web socket after having aquired a token). Is this possible? | 2019-02-01T06:20:32.701400 | Karma |
elmlang | general | <@Karma> yes, update some value in the model, and then check that value in your subscriptions function | 2019-02-01T06:22:06.702300 | Nana |
elmlang | general | however, there's currently a bug with starting/stopping subscriptions, so it's better to just always have it turned on | 2019-02-01T06:23:10.703500 | Nana |
elmlang | general | it's actually not necessary to toggle subscriptions on/off anyway | 2019-02-01T06:23:33.703900 | Nana |
elmlang | general | The reason for starting it later is that I need to have the token to open the web socket. If I start it before I have the token, it's just retrying it without the token and failing every time | 2019-02-01T06:24:54.705200 | Karma |
elmlang | general | Unless there's a way to refresh the value or restart the subscription or something | 2019-02-01T06:25:54.706500 | Karma |
elmlang | general | if you only turn it on once, but never turn it off, it might be fine though | 2019-02-01T06:25:58.706600 | Nana |
elmlang | general | So far I've only tried having the subscription in `subscriptions` and nowhere else | 2019-02-01T06:27:21.708400 | Karma |
elmlang | general | <@Karma> Try doing it as <@Nana> suggested: start from returning `Sub.none` and when you have your token in model return actual websocket subscription. If you see that messages from websocket are not coming, you can replace your `Sub.none` with something like `Time.every 1000000 (always NoOp)` which will hardly fire before you get your token :slightly_smiling_face: | 2019-02-01T06:28:47.709600 | Lynne |
elmlang | general | Also, since you are using websockets I assume you are on Elm 0.18, is that correct? | 2019-02-01T06:29:08.710300 | Lynne |
elmlang | general | Yep! | 2019-02-01T06:29:15.710600 | Karma |
elmlang | general | Then, there should not be any problem | 2019-02-01T06:29:24.710900 | Lynne |
elmlang | general | I am not aware of any problem with subscriptions in 0.18 | 2019-02-01T06:29:43.711500 | Lynne |
elmlang | general | Ok, I'll give it a go then! Thank you both for your help :slightly_smiling_face: | 2019-02-01T06:29:49.711700 | Karma |
elmlang | general | hello everyone!
I’m trying the example code for the `Broswer.Dom.setViewportOf` from <https://package.elm-lang.org/packages/elm/browser/1.0.1/Browser-Dom#setViewportOf> | 2019-02-01T06:38:09.712700 | Karrie |
elmlang | general | but I get an error:
```
This function cannot handle the argument sent through the (|>) pipe:
229| Dom.getViewportOf id
230| |> Task.andThen (\info -> Dom.setViewportOf id 0 info.scene.height)
231| |> Task.perform (\_ -> NoOp)
^^^^^^^^^^^^^^^^^^^^^^^^
The argument is:
Task.Task Dom.Error ()
But (|>) is piping it a function that expects:
Task.Task Never ()
``` | 2019-02-01T06:38:38.713200 | Karrie |
elmlang | general | is there a mistake in the docs? | 2019-02-01T06:39:21.713800 | Karrie |
elmlang | general | I believe you’re looking for `attempt` rather than `perform` | 2019-02-01T06:39:29.714000 | Agustin |
elmlang | general | Yeah, that example is wrong | 2019-02-01T06:40:18.714400 | Earlean |
elmlang | general | yep that works! | 2019-02-01T06:40:34.714800 | Karrie |
elmlang | general | Could file an issue about it to help out too :slightly_smiling_face: | 2019-02-01T06:41:07.715400 | Agustin |
elmlang | general | yes I’m actually doing that right now :slightly_smiling_face: | 2019-02-01T06:41:22.715700 | Karrie |
elmlang | general | is Elm Europe already sold out? :open_mouth: or did someone just set the number of tickets to zero for the moment or something?
<https://2018.elmeurope.org/#tickets> | 2019-02-01T07:09:19.719000 | Nana |
elmlang | general | Maybe because you are looking at Elm Europe 2018 :sweat_smile: Here is the '19 link: <https://2019.elmeurope.org/#tickets> | 2019-02-01T07:11:15.719200 | Leonore |
elmlang | general | :face_palm: | 2019-02-01T07:11:37.719400 | Nana |
elmlang | general | I’m running into an issue with inputs and textareas losing focus when an error is triggered, adding an error banner higher up in the DOM. I’m not sure if this is an elm specific issue but I just wanted to hear if anybody has come across this before - do I have any other option than manually resetting the focus? | 2019-02-01T07:37:33.722600 | Daria |
elmlang | general | <@Daria> `Html.Keyed`should fix that I think | 2019-02-01T07:38:50.723200 | Nana |
elmlang | general | or `Html.Lazy` | 2019-02-01T07:41:04.723600 | Nana |
elmlang | general | <@Nana> thanks I’ll give that a shot | 2019-02-01T07:46:27.724000 | Daria |
elmlang | general | <@Daria> this is an issue that exists in all virtual-dom implementations. If the view changes too much the virtual-dom is unable to match up existing DOM nodes with the new DOM nodes so they get deleted and recreated. The recreated DOM nodes no longer have focus. You'll see the same kind of issue with React.
If the view hasn't changed too much `Html.Keyed.node` can be helpful. But it doesn't always work. `Html.Lazy.lazy` what help with this. | 2019-02-01T07:52:11.729700 | Earlean |
elmlang | general | <@Earlean> thanks for the insight, thats what I was suspecting | 2019-02-01T08:46:17.731000 | Daria |
elmlang | general | I agree that you should try to only check a condition / case once though :slightly_smiling_face: | 2019-02-01T09:04:27.732200 | Nana |
elmlang | general | Hello, my `create` func has the following annotation `create : String -> String -> String -> Cmd Msg` | 2019-02-01T09:33:15.733200 | Quyen |
elmlang | general | now, I want to patter match `Cmd Msg` part | 2019-02-01T09:33:28.733500 | Quyen |
elmlang | general | I'm utterly confused whether it's a right way and how one matches `Cmd Msg` | 2019-02-01T09:33:50.734000 | Quyen |
elmlang | general | To be more specific, here's my func
```
create : String -> String -> String -> Cmd Msg
create email password u =
Http.request
{ method = "POST"
, headers = []
, url = u
, body =
encode (User email password)
|> Http.jsonBody
, expect = expectUser Created
, timeout = Nothing
, tracker = Nothing
}
``` | 2019-02-01T09:34:15.734400 | Quyen |
elmlang | general | now, I want to test it with elm-test, so I need to pattern match Cmd Msg, extract an Msg and test for the Http.request result... | 2019-02-01T09:34:33.734800 | Quyen |
elmlang | general | <https://elmlang.slack.com/archives/C0CLGCMMF/p1548425420119000?thread_ts=1548345785.118900&cid=C0CLGCMMF> | 2019-02-01T09:39:45.735100 | Velia |
elmlang | general | Also, creating a `Cmd Msg` does not mean you run the effect that it holds. | 2019-02-01T09:59:29.735500 | Bert |
elmlang | general | So there is no Msg to extract or HTTP request being made | 2019-02-01T10:00:19.735900 | Bert |
elmlang | general | You could think of a Cmd as a meal order for the chef: it tells the kitchen personnel what to work on, but in the end it is just a note. | 2019-02-01T10:01:48.736100 | Bert |
elmlang | general | The chef here being the Elm runtime | 2019-02-01T10:02:06.736300 | Bert |
elmlang | general | <@Bert> I've noticed that elm-test does not really do an Http.request. Is that what you want to say? | 2019-02-01T10:03:32.736500 | Quyen |
elmlang | general | Kind of yes. See this thread <https://github.com/elm-community/elm-test/issues/220> | 2019-02-01T10:06:27.736700 | Bert |
elmlang | general | I'd like to chime in. We (and others from what I've read) are having a heck of a time upgrading to 0.19 and the debugger would be incredibly helpful. | 2019-02-01T10:21:36.737000 | Demetrius |
elmlang | general | Thank you. I'm still looking for the best way to test http requests... :confused: | 2019-02-01T10:31:13.737200 | Quyen |
elmlang | general | I've found this: <https://package.elm-lang.org/packages/rogeriochaves/elm-testable/4.1.1/> | 2019-02-01T10:32:31.737400 | Quyen |
elmlang | general | What do you think? | 2019-02-01T10:32:57.737600 | Quyen |
elmlang | general | If that works for you, great! :) | 2019-02-01T10:43:14.737800 | Bert |
elmlang | general | That's Elm 0.18, I don't know if you are on 0.19 or not. | 2019-02-01T10:44:40.738000 | Bert |
elmlang | general | Honestly speaking, I have never written tests for actual HTTP requests. In Elm or otherwise. | 2019-02-01T10:45:40.738200 | Bert |
elmlang | general | I have thought that's sort of covered with integration tests | 2019-02-01T10:46:10.738400 | Bert |
elmlang | general | A ha! So you want to say that I should write tests exclusively for the front-end? | 2019-02-01T10:51:48.738600 | Quyen |
elmlang | general | hello!
can I scroll to the bottom of the page with `Dom.setViewport` and add a scroll down animation without a sudden jump? | 2019-02-01T11:03:51.739500 | Karrie |
elmlang | general | Hi. Anyone know about <http://elm-tutorial.org> being dead? | 2019-02-01T11:32:01.740000 | Corinne |
elmlang | general | I am saying write tests for things that make sense to you. Sadly it might not be easy for Cmds. | 2019-02-01T14:04:18.741100 | Bert |
elmlang | general | I'm trying to get Elm installed. I've tried "npm install -g elm" w/ and w/o sudo. I'm getting and error: ERR Error extracting <https://github.com/elm/compiler/releases/download/0.19.0/binaries-for-linux.tar.gz> - Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/elm/unpacked_bin' | 2019-02-01T15:07:06.742800 | Sau |
elmlang | general | Anyone know why/what I'm doing wrong? | 2019-02-01T15:07:29.743200 | Sau |
elmlang | general | looks like a permissions issue on that folder, these docs have some good suggestions on it <https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally> | 2019-02-01T15:18:23.743700 | Alicia |
elmlang | general | Thanks! I'll take a look | 2019-02-01T15:23:54.744100 | Sau |
elmlang | general | Is there one of these for Set's yet? | 2019-02-01T17:43:33.744400 | Buffy |
elmlang | general | Does it need to be written? | 2019-02-01T17:43:38.744600 | Buffy |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.