I’ve converted a Rails 6 project to Rails 7 and moved the JavaScript from UJS to Stimulus controllers. All went fine during testing and it’s been deployed to production.
However, some users are reporting parts of the site aren’t functioning on older devices.
I’ve been reading about using a transpiler to package the JS in such a way that it’s backward compatible with older standards and think this is the issue (I’ve not knowlingly used a transpiler as far as I’m aware).
I can’t understand what I need to do though.
I’m using Stimulus and Importmaps and it appears that I need to use something like esbuild. However, from what I’ve read, this isn’t compatible with importmaps.
Do I need to rewrite the Stimulus controllers somehow or can I add a polyfill via esbuild and retain importmaps and the JS controllers I’ve written?
Once I know what I’m aiming towards in terms of the tools required and how to structure I’ll be able to figure it out, but at the moment I’m confused as to what it is I’m aiming to assemble.