In reply to Justin Tadlock.

Hi Justin.
There were some older GitHub tickets discussing the need for script in templates. I'm not really sure why we found ourselves without script in template files when the need seems obvious, and limitations seem arbitrarily puritanical.

Way back in Nov 2020 before FSE was finalised there was some discussion around the partials format and the necessity to include logic which implied PHP ought to be the format of choice. Yet today we have only flat html template files, and even inline scripting conditionals don't seem to work (last I checked).

I had to stop developing FSE themes about 6 weeks ago because required conditionals. It was overkill to build the conditional into an extended core block pattern where it could have been achieved with 20 characters in header.html

I have a strong feeling that there's a fashionable distaste for PHP, and there are some "babies being thrown out with the bathwater".

Here's the old discussion about flat html Vs PHP templates.
https://github.com/WordPress/gutenberg/issues/27144

I'm not sure who took the ultimate decision to kill scripting in templates, and why that is the preferred limitation. I'm not sure if scripting is coming, or if this is closed.