Open lukasjuhrich opened 3 years ago
Regardless of this issue, I don't think that we should include functionality like form completion in a bundle which we include synchronously with every request (in this case, main.js
). Doing so is kind of a performance disaster (and unnecessarily bundle size is rightfully criticized by chrome's lighthouse and even a warning webpack reports when building).
Since the
account-typeahead
is included in themain.js
entrypoint, every statement in this module's top level is execited at all times. In particular, the prefetch for the system accounts completions is executed at all times.The
Bloodhound
should be instantiated only when at least one field of the respectivedata-role
exists (cf. lower in the file).Context: account-typeahead.js