intermine / generator-bluegenes-tool

Scaffold generator for BlueGenes tools
MIT License
5 stars 8 forks source link

Need of "HTML in JS" solution #9

Closed akshatbhargava123 closed 5 years ago

akshatbhargava123 commented 5 years ago

Issue

When we've to build complex layouts from the tool, it becomes real pain since writing concatenated HTML strings just spoils code quality or using DOM API to create elements for us and then styling them in JS would also just bloat our code badly.

Fix

To add some "HTML in JS" solution like JSX which comes with React or Preact. After have a discussion with Herald, I got to know that Intermine is using re-compose in Bluegenes which is in a way dependent on React, so we must have ReactDOM on the window object, we should setup babel in the generator-tool so that it would allow us to write JSX and some modern browser finally leading to maintainable and clean code.

yochannah commented 5 years ago

I think in this case we should aim to be permissive rather than restrictive. The goal of the generator is to make it easy for people who are either

Since there are many right ways to do javascript, and/or for the second use-case even if it uses out-of-date practices, the person wrapping the tool may not wish to spend time updating it to fit in with a rigid framework.

Do we think there might be a way to extend this generator in a separate package, so that we can still have a re-usable preact solution for you (and others who wish it) to use, without enforcing it?

yochannah commented 5 years ago

alright, looking at the conditional way you've included it, I'm fine with that. Ignore my last comment! :)