Subtle change. Previously, the webpack loader parsed controllers.json (which eventually becomes the symfonyControllers variable in index.ts) into something that exported an object where each key was a promise - something like:
This is totally unnecessary and a relic of how this library was originally built. It also causes the UX controllers to be registered late. It's barely noticeable, but in practice, instead of the UX controllers being registered BEFORE the DOM is ready, they are registered after. This actually causes a problem with a new feature from LiveComponents.
The new parsed version of controllers.json from the loader looks much simpler:
Hi!
Subtle change. Previously, the webpack loader parsed
controllers.json
(which eventually becomes thesymfonyControllers
variable inindex.ts
) into something that exported an object where each key was a promise - something like:Then, in
startStimulusApp()
, we called used.then()
to wait for that promise to resolve then registered its resolved value:This is totally unnecessary and a relic of how this library was originally built. It also causes the UX controllers to be registered late. It's barely noticeable, but in practice, instead of the UX controllers being registered BEFORE the DOM is ready, they are registered after. This actually causes a problem with a new feature from LiveComponents.
The new parsed version of
controllers.json
from the loader looks much simpler:(I don't show it here, but lazy controllers have a similar simplification).
In short: it's a bug fix & an easy win. Controllers will load slightly earlier as a result.
Thanks!