1:20 PM
First of all, thanks for the opportunity of continuing the discussion; it's been very beneficial for me
Regarding your first point, I intend to put all the functions creating HTML elements into a library. With that in mind, the
html
"object" would be achieved already in a sense, i.e. by having a file which exports all the functions, and importing the ones you need, e.g. import {form, input, button} from 'some-library/html'
7 hours later…
7:56 PM
First, that the biggest problem I see is to have to inject all around lots of arguments (namely the functions creating HTML elements). If some component depends on
button()
, in order to start using it, the component will have to receive it as an argument, to import it, and someone will have to inject it. Those three steps seem quite painful if you think of the normal way of instantiating/creating a button, which is simply to hard-code somewhere the string "<button></button>"
With the assumption that the component will run on a browser, of course. Testing the component will be very difficult outside of the browser context in this case, right?
The second thought I wanted to share, related to the first one, is that alternatively we might assume that
document
(on which button()
and the rest depend) is available both for the application and the tests (the same way the HTML button is assumed to be available). This way, you would only need to import button()
to start using it. Then, for the tests, you would need to either run them in a browser, or make sure document
is globally available using something like jsdom in Node.js
« first day (1 day earlier) last day (15 days later) »
Transcript for
Sep26
Sep '1728
Oct13
Discussion between Samuel and DanielM
Imported from a comment discussion on softwareengineering.stac...