Swap `swagger-ui-dist` with `swagger-ui` npm package
Description
Importing swagger-ui-dist
underutilizes our tooling. This sentiment is in the swagger install docs too:
Note: we suggest using swagger-ui when your tooling makes it possible, as swagger-ui-dist will result in more code going across the wire.
We see this in the bundle size analysis in this MR: we went to a substantial 2.27 MB
package size loaded on OpenAPI pages, from an already high 1.81 MB
for the swagger endpoint.
If we imported by doing import SwaggerUI from 'swagger-ui'
instead of import { SwaggerUIBundle } from 'swagger-ui-dist';
like in this example our tree-shaking would kick in and we would probably end up with a smaller overall package.
I assume the view that loaded this entry point (app/views/sandbox/swagger.html.erb
) is not too frequently used, but this is possibly an easy optimization that would also simplify our webpack configuration after !123694 (closed).