Problem/Motivation

Found while performance auditing Drupal CMS' Byte site template.

If you have a very simple webform, you still get webform.form added on every request, this happens in

WebformSubmissionForm::attachLibraries, this includes webform.states

Additionally this particular form includes the webform.messages library but I haven't yet tracked down whether this is always added or due to the specific form configuration.

Steps to reproduce

Proposed resolution

Not sure. Ideally webform could dynamically determine whether the js is needed or not. If not, maybe a per-webform setting to suppress JavaScript?

Remaining tasks

User interface changes

API changes

Data model changes

Comments

catch created an issue.