Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Alertmanager UI to Elm 0.19 #1539

Merged
merged 6 commits into from
Sep 6, 2018
Merged

Upgrade Alertmanager UI to Elm 0.19 #1539

merged 6 commits into from
Sep 6, 2018

Conversation

w0rm
Copy link
Member

@w0rm w0rm commented Sep 2, 2018

Is anybody willing to do a full QA, @stuartnelson3 maybe? 🎉

Closes #1524

Andrey Kuzmin added 5 commits September 2, 2018 13:58
Signed-off-by: Andrey Kuzmin <andrey.kuzmin@soundcloud.com>
Signed-off-by: Andrey Kuzmin <andrey.kuzmin@soundcloud.com>
Signed-off-by: Andrey Kuzmin <andrey.kuzmin@soundcloud.com>
Signed-off-by: Andrey Kuzmin <andrey.kuzmin@soundcloud.com>
Signed-off-by: Andrey Kuzmin <andrey.kuzmin@soundcloud.com>
Copy link
Member

@mxinden mxinden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Thanks for the huge work. I will take a look, just need a bit of time.

@w0rm
Copy link
Member Author

w0rm commented Sep 2, 2018

@mxinden sure, take your time!

It was relatively straightforward, mostly mechanical work, except maybe for the changes in the Time module that now exposes a much better Posix type, and we don't have to worry about things not being in UTC.

@stuartnelson3
Copy link
Contributor

Thanks! Will start using this and see if I notice anything

ui/app/Makefile Outdated
@$(DOCKER_CMD) elm make src/Main.elm --yes --output $(TEMPFILE_JS)
@$(DOCKER_CMD) uglifyjs $(TEMPFILE_JS) --compress unused --mangle --output $(@)
@$(DOCKER_CMD) rm -rf elm-stuff
@$(DOCKER_CMD) elm make src/Main.elm --output $(TEMPFILE_JS)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can add the --optimize flag, right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

108594 bytes on script.js down to 93329 bytes it seems

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally missed this, thanks for noticing!

Signed-off-by: Andrey Kuzmin <andrey.kuzmin@soundcloud.com>
Copy link
Member

@mxinden mxinden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this huge work. I hope elm-upgrade did most of it.

With #1352 merged, I would suggest I cut an alpha release soon. I would like this to be included. @stuartnelson3 what do you think?


script.js: elm-env format $(ELM_FILES)
@echo ">> building script.js"
@$(DOCKER_CMD) elm make src/Main.elm --yes --output $(TEMPFILE_JS)
@$(DOCKER_CMD) uglifyjs $(TEMPFILE_JS) --compress unused --mangle --output $(@)
@$(DOCKER_CMD) rm -rf elm-stuff
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This forces us to re-download all the dependencies on each build, right? Is this necessary?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know, I had some weird errors with the messed up elm-stuff, perhaps because elm-test does some weird things with test-dependencies, it's still pretty fast though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, sounds good to me. We can still change it, in case it is worth optimizing.

else
Nothing


dateFormat : Time.Time -> String
dateFormat =
Date.fromTime >> (Date.Extra.Format.formatUtc config Date.Extra.Format.isoDateFormat)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reasoning for partially implementing our own date time library?

Copy link
Member Author

@w0rm w0rm Sep 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is pretty small, the only bits that I added are for formatting. I don't want to pull an extra library for this because of our small requirements. We used two third party packages plus the core Date package, now it is only Iso8601 for parsing/stringifying and the core Time packages.

import Utils.String


tab : tab -> tab -> (tab -> msg) -> List (Html msg) -> Html msg
tab tab currentTab msg content =
tab tab_ currentTab msg content =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for my understanding, what is the convention in <variable-name>_?

Copy link
Member Author

@w0rm w0rm Sep 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable shadowing is disallowed in 0.19. I've seen folks doing this instead of primes tab' that are not possible anymore.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had that question too. If that's how elm is handling it (I think shadow' was carried over from haskell?), that's fine by me.

Copy link
Member Author

@w0rm w0rm Sep 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In some cases it is just hard to come with names. Probably the function has to become a verb, like viewTab. We can change this as we work on it in the future.

@stuartnelson3
Copy link
Contributor

An alpha sounds like a good idea, this will get (hopefully) more eyes on it than just me clicking around

Copy link
Member

@mxinden mxinden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stuartnelson3 @w0rm sounds good to me. Feel free to merge. I will follow up with the alpha release preparation then.

@mxinden
Copy link
Member

mxinden commented Sep 6, 2018

@w0rm would you mind combining the commits into one commit with some details in the commit message? This guide helped me before. Something like ui/app: Update elm to v0.19.0.

@w0rm w0rm merged commit e768371 into master Sep 6, 2018
@w0rm
Copy link
Member Author

w0rm commented Sep 6, 2018

@mxinden oh just pressed merge and missed your comment

@mxinden
Copy link
Member

mxinden commented Sep 6, 2018

Upgrade Alertmanager UI to Elm 0.19 (#1539)

That's perfect, thanks!

@w0rm w0rm deleted the 0.19 branch September 6, 2018 16:10
@w0rm
Copy link
Member Author

w0rm commented Sep 6, 2018

@mxinden GitHub combined all the commits, seems like it's just as you requested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants