Lisplog

Blogging in Lisp

Search

Feed Aggregator Page 686

Rendered on Fri, 18 Feb 2022 10:01:41 GMT  newer latest older 

IntelliJ Elm Plugin future

via Elm - Latest posts by @francescortiz Francesc Ortiz on Fri, 18 Feb 2022 09:51:40 GMT

Awesome! I will tell you if I find any issues. Thank you!

How Do You Read Types?

via Elm - Latest posts by @system system on Fri, 18 Feb 2022 04:10:05 GMT

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.

IntelliJ Elm Plugin future

via Elm - Latest posts by @clojj on Thu, 17 Feb 2022 20:26:07 GMT

Just published a ZIP installable release:

Download the ZIP and install by IntelliJ’s action “Install Plugin from Disk…”
This is not a production-ready release I’d say, but I do think it should be stable and shouldn’t have broken any previous functionality. Feedback welcome.

Since it is not clear, if this will (ever) land in the forked-from repo, I have not setup any Plugin-publication for the IJ marketplace yet.

IntelliJ Elm Plugin future

via Elm - Latest posts by @clojj on Thu, 17 Feb 2022 20:21:04 GMT

I see. Do your applications show up here as 2 project entries ?
If so, we would basically have to compile + show messages of all projects somehow… ?

Best thing would be to send me your stripped down project example (with 2 main)

IntelliJ Elm Plugin future

via Elm - Latest posts by @francescortiz Francesc Ortiz on Thu, 17 Feb 2022 15:18:54 GMT

I will try to be more specific:
We have 2 entry points in our project, one to run the application and the other one is a stripped down version that is used to render PDFs with puppeteer. When we open files that are imported both from ConsumerApp.elm and CertificatePdf.elm, the compiler only compiles CertificatePdf.elm, so we are not able find all compilation errors related to the usages related to ConsumerApp.elm unless we temporarily rename main into main1 inside the CertificatePdf.elm file.

IntelliJ Elm Plugin future

via Elm - Latest posts by @clojj on Thu, 17 Feb 2022 15:09:30 GMT

if the current Main detection has flaws, this would have to wait until renovations and integrations are done.
But if you can describe your case in more detail, it would help in any case

IntelliJ Elm Plugin future

via Elm - Latest posts by @clojj on Thu, 17 Feb 2022 12:01:22 GMT

Here I have uploaded a short video of the work in progress.
It shows a new “Frinedly Messages” toolwindow, that finally obeys dark/light IJ appearance and correct scrolling (it is Html and wrapping makes no sense anyway because of the error markers from the tools).
After running a tool (be it the Elm compiler or in this case elm-review), you can navigate immediately through the messages by the conventional IJ shortcuts (next/prev occurence).

I think, this gives a better area for the report-messages. There could be a setting, to not show the new messages window at all of course.
Let me know what you think.

Btw, this runs in the most current version of IntelliJ and is a Lamdera project

State of JS 2021 Results

via Elm - Latest posts by @Laurent Laurent Payot on Thu, 17 Feb 2022 08:33:17 GMT

Complete results here: https://2021.stateofjs.com/en-US/

Regarding Elm:

IntelliJ Elm Plugin future

via Elm - Latest posts by @francescortiz Francesc Ortiz on Thu, 17 Feb 2022 08:29:32 GMT

This is great news! I would love to try your version of the plugin in a zip.

When you have different files with a main, which one is selected is arbitrary. It would be great to be able to choose which main file you want to use.

Also, when you refer to directories of of the scope of the IntelliJ project, the Elm plugin treats them as missing, even though everything compiles fine. IntelliJ is able to deal with files outside the project, so it might not be such a big deal to implement this.

Thanks!

IntelliJ Elm Plugin future

via Elm - Latest posts by @clojj on Thu, 17 Feb 2022 08:08:11 GMT

Hi, the Elm Compiler Toolwindow actually enables navigating (forward&previous) to the exact locations.
The error reports that are linked to each location are something I currently work on, so that the nice messages from the Elm compiler and elm-review are displayed better and ideally respecting the IJ appearance theme (dark or light).

When I am done, I can try to publish the plugin as an installable ZIP… maybe on Github, we’ll see.
Thanks for the feedback!

IntelliJ Elm Plugin future

via Elm - Latest posts by @mika on Wed, 16 Feb 2022 21:01:36 GMT

Very happy to hear this! I am very happy with the plugin in its current state. The most pressing for me is to actually make it work in the new version(s) of IntelliJ. Nice to hear there are new features being developed but personally I only use the editor/refactoring features. So I will leave it to others to feedback on those. :slight_smile:
Now that I think about it. Since I use the “External Tools” thing to run builds etc in the console I would like it if errors shown there would link to the file/row. (I tried to set that up myself some time ago using “Output filters” but had no luck.)

Anywhere one can find a build to test?

OTP 25 Release candidate 1

via Erlang/OTP | News by Kenneth Lundin on Wed, 16 Feb 2022 00:00:00 GMT

OTP 25-rc1

Custom slider for elm-ui using SVG

via Elm - Latest posts by @system system on Wed, 16 Feb 2022 13:12:03 GMT

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.

How do i defualt a date model variable to todays date

via Elm - Latest posts by @hrnxm Harun Muderizović on Wed, 16 Feb 2022 08:02:05 GMT

@Sebastian
Just a small correction, I think you meant:

type alias Flags =
  {
    initialTime : Int
  }

How do i defualt a date model variable to todays date

via Elm - Latest posts by @Sebastian Sebastian on Wed, 16 Feb 2022 01:21:00 GMT

Another solution is using flags for this.
What we do is pass the time as a flag and later on get a Date from that

In JS :

let flags = { initialTime: (new Date()).getTime() }
let app = Elm.App.init({ node, flags })

In Elm

type alias Flags =
  {
    initialTime : Posix
  }

Decoding the flags looks like:

timeDecoder =
  Decode.float
  |> Decode.map round
  |> Decode.map Time.millisToPosix

Decode.map Flags
  Decode.field "initialTime" timeDecoder

And later when needed we convert the time to a Date.

Date.fromPosix Time.utc model.flags.initialTime

IntelliJ Elm Plugin future

via Elm - Latest posts by @clojj on Tue, 15 Feb 2022 18:32:49 GMT

Replying also to @adamnfish

Hi, I recently started renovating the plugin in a fork and already have some success with elm-review integration, Lamdera project support (https://dashboard.lamdera.app/docs), some minor fixes and deprecation removals and last but not least, using IntelliJ latest plugin platform as a base for building etc. Given the amount of issues that have accumulated in the original repository, I can not yet claim that I am fully able to maintain it, but as a previous contributor, I can give it a shot.
Currently my fork will require IntelliJ 2021.1 or later.

So aside from my ongoing work on the toolwindows (compiler and elm-review), it would be very interesting to know, what issues currently are the most pressing ones.

Any feedback welcome.

Elm Online Meetup - December 2021 - Videos

via Elm - Latest posts by @system system on Tue, 15 Feb 2022 18:02:46 GMT

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.

How do i defualt a date model variable to todays date

via Elm - Latest posts by @supermario Mario Rogic on Tue, 15 Feb 2022 15:10:34 GMT

Another option if you’re starting out learning Elm and want to carry on quickly:

import Date
import Time exposing (Month(..)) -- comes from `elm install elm/time`

init : Model
init =
    { currentdate = Date.fromCalendarDate 2022 Jan 15 }

This will get you a hardcoded date value, but it might be helpful if you want to limit what you’re learning and just keep going right now.

If you are learning it’s totally okay to work up to to things like tasks/ports later!

Elm Alternative Package (Mirror) Live

via Elm - Latest posts by @system system on Tue, 15 Feb 2022 12:35:21 GMT

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.

How do i defualt a date model variable to todays date

via Elm - Latest posts by @hasko Hasko on Tue, 15 Feb 2022 07:31:39 GMT

When I started with Elm, I‘ve run into a similar problem: The init function runs only once, so why bother with tasks and subscriptions to do a simple thing like getting today’s date—especially because you can be fairly certain that the date doesn’t change during one session?

That put me off a little since in other languages it’s such a simple operation. The key for me was to realize that:

a) There is actually no guarantee that the init function is called only once. It’s perfectly fine to call it later from my own code, e.g. to reset the model to an initial state. And then the guarantee that functions always return the same values when called with the same parameters (none in this case) would be broken.

b) The date might actually change during one session. It happens every day. So why would my code assume that it doesn’t?

Keeping all functions side-effects free gives me all the power of Elm and the downsides of making init (or Date) special simply aren’t worth it.

Maybe it’s obvious or long winded. I’m just recounting my thought process back when I began using Elm. Hope it helps.

 newer latest older