As I explained in T155473#2944504
For example when someone wants to make a dialog box in OOjs UI:
```
function MyDialog( config ) {
MyDialog.super.call( this, config );
}
OO.inheritClass( MyDialog, OO.ui.Dialog );
MyDialog.static.title = 'Simple dialog';
MyDialog.prototype.initialize = function () {
MyDialog.super.prototype.initialize.call( this );
this.content = new OO.ui.PanelLayout( { padded: true, expanded: false } );
this.content.$element.append( '<p>A simple dialog window. Press \'Esc\' to close. </p>' );
this.$body.append( this.content.$element );
};
MyDialog.prototype.getBodyHeight = function () {
return this.content.$element.outerHeight( true );
};
var myDialog = new MyDialog( {
size: 'medium'
} );
var windowManager = new OO.ui.WindowManager();
$( 'body' ).append( windowManager.$element );
windowManager.addWindows( [ myDialog ] );
windowManager.openWindow( myDialog );
```
(Copied from [[https://www.mediawiki.org/wiki/OOjs_UI/Windows/Dialogs | here]]). But a jquery ui dialog is like this:
```
$( function() {
$( "#dialog" ).dialog();
} );
```
(From [[https://jqueryui.com/dialog/|jquery ui doc]].)
What I would love to see is some sort of form factory in javascript. Like HTMLFormFactory in php. So we only build an array of form descriptors and call it, then bam! the form is there.