-
-
Notifications
You must be signed in to change notification settings - Fork 294
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
Convert templates (*.tt) to Elm #314
Comments
Getting rid of Template::Toolkit (and Catalyst/Perl for that matter) sounds great to me. I don't have experience with Elm though so I can't comment on whether using that is a good idea, but it looks pretty nice. Maybe you could do a proof-of-concept of a couple of Hydra pages (maybe adding more server-side JSON APIs if needed)? |
I implemented the very first index page today. Satisfied with the result. Code: https://github.com/domenkozar/hydra-frontend Here is what happens:
|
cc @civodul as this is also relevant for Guix EDIT: missed close button |
I've deployed a demo app to http://hydra-frontend.domenkozar.com/. Note that nothing is coming from Hydra backend yet. |
Looks great; Let's get this deployed! |
Good work @domenkozar. However, I think having the jobsets listed in the frontpage is not a good idea. Our company hydra instance has about 250 jobsets in 30 different projects, showing them all (or any even), really takes away the overview of the different projects. |
@rbvermaa I didn't know exact numbers you have, but I was aware of this edge case. Thanks for letting me know, I'd like to fix this in the begining. I'd like to understand better how you use Hydra and what would be the best workflow/UX for you. My ideas that should remedy the issue:
Depending on your way of using Hydra these might help or not, but I'd like to discuss and think about the best solution once I understand more about the habits :) |
Had a short hangout with @edolstra today and went through current infrastructure. Baby steps, next up is implementing routing for Single Page Application so I can move forward and implement other views. |
@domenkozar is it easy to test the UI with an existing hydra (or did you need a lot of extra API endpoints?) If it is easy, I can try and see how it turns out on our instance. |
@rbvermaa currently all the state is hardcoded (the UI doesn't yet talk to the backend). I plan to evolve the frontend first, so we can discuss usability and then with minimal change on the Elm side and a bit more on the Hydra side, I can convert current views to json views. In other words: not yet, I will focus on the frontend first and then worry connecting data. |
@domenkozar OK, thanks! |
@rbvermaa I've now implemented live search over jobsets/projects, you can test it at http://hydra-frontend.domenkozar.com/ Next up: url parsing, navigation (and start work on jobset view) |
URL navigation is almost done: domenkozar/hydra-frontend#3 |
I don't know how relevant this is, but a disadvantage of using elm for templates is that all the pages get empty if javascript is disabled, like for example when using a text based browser. (current hydra works quite nicely in text based browser) |
@ericsagnes some text based browsers now support javascript, did you have a specific one in mind? |
http://hydra-frontend.domenkozar.com/ is empty when viewed in elinks, lynx or w3m. |
@ericsagnes you're right, elinks doesn't open it despite the JavaScript support. While this is inconvenient to some, I don't see a way we can really fix this ourselves. |
I've changed the UI again, see domenkozar/hydra-frontend#10 for more details. |
@domenkozar Can we close this? |
I've been working on smaller improvements at Hydra frontend side. I think we have to change our infrastructure there with a better tooling so we can advance easier.
I propose to use functional programming DSL for frontend called Elm. This is not a discussion what tool to use, but merely a proposal how to improve Hydra by volunteering to do the job.
Elm compiles to JavaScript, so it can call native functions and shouldn't be a limit to what we can do. Google can index JavaScript sites these days.
What is Elm language?
Elm is a functional programming language for declaratively creating web browser-based graphical user interfaces. Elm uses the functional reactive programming style and purely functional graphical layout to build user interface without any destructive updates. - wikipedia
In essence, you craft HTML using functions and model (state of the app) and output HTML + some types to note signals. Then
update
function as small finite state machines takes current model (state of the app) and signals (which can contain data) and they trigger some other events (like http requests, etc) and output the new state (model).More at http://guide.elm-lang.org/architecture/index.html
Example fetching HTML and rendering it based on button click http://elm-lang.org/examples/http
Motivations
Benefits
cli
clients and libraries for communicating with Hydra will be much easierScope
I'm volunteering to lead this work. Scope is something like:
and converting server side rendering to output JSON instead of html.
Feedback
I'd like inputs from others and mainly @edolstra if he thinks this is reasonable. I've recently converted a very small app to Elm and proved it's really easy and pleasant to work with.
The text was updated successfully, but these errors were encountered: