I’ve been looking at the state of front-end development lately, more so than in the past. Over the last years I have become frustrated by the rapidly-changing ways of javascript. It seems every few months there’s another front-end framework to end them all (React, Angular, Vue, Whatever-comes-next). And I’ve wrestled with how to take our JS into the modern world.
As it stands, we now have a relatively stable release-cycle for ECMAScript and that helps clear some of the fog. We can now safely begin writing our JS using ES2018 and allow a tool like Babel to either polyfill or compile down to ES5 for older browsers. We are even seeing ways of compiling an ES5 version of your script and only loading if it if needed, if the browsers can support ES2018 it’ll just get ES2018.
I think native web components are likely stable enough we can now begin using them instead of relying on a React-style setup. Libraries like polymer have basically said, “We just want people to use native web components and understand our product will essentially just map to that and eventually we’ll be obsolete” which is good to hear.
What does this mean for the next steps of our development? Well, I integrated the PHP templater Twig and you can use it today, it’s been there for a while now. But I think as we move forward we should rely on native-HTML and ES.Next for the bulk of our UI. I think the days of the Header class (which I wrote) are likely coming to an end. We shouldn’t be writing complex classes that render HTML in PHP, they should be written as web components and javascript.
I think in the next 3 years we start to see the codebase truly begin to split the server-side code from the client-side code. This will make maintenance easier, allow cleaner code, faster iterations, and better prepare us to handle FHIR and in-patient use-cases.
Talk is cheap though, and so I’ll likely write up a module using the ideas here. Something simple that devs can look at and better understand. I also imagine we’ll end up with our typical Apache/Nginx based PHP server as well as a node server in the coming years.
< /novel >