TextInputWidget is massive. By line count, it's the second largest widget we have (behind SelectWidget), and it's supposed to be just a text field. This is ridiculous.
Split proposal:
- TextInputWidget
- MultilineTextInputWidget (guess what this is)
- AnnotatedTextInputWidget (here we split off everything that has to do with the 'label' config option) – we could also move this out of the 'core' module, reducing its size, since it's not supported in PHP
- SearchInputWidget (here we split off everything that has to do with type: 'search' config option)
I think the three features listed above are already (mostly) mutually exclusive.
We could do this without breaking backwards compatibility by still checking for the removed config options in TextInputWidget constructor, and returning the right subclass (yes, you can return stuff from object constructors in JS, I agree this is weird, but you can).