Skip to content

Commit 1bc427b

Browse files
committed
fine tune tests
1 parent 9512a4a commit 1bc427b

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

web_src/js/standalone-swagger.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1-
// Swagger JS must be standalone because it is also used by external render like "OpenAPI render".
2-
// Avoid importing other JS modules to prevent unnecessary code and dependencies and chunks.
1+
// AVOID importing other unneeded main site JS modules to prevent unnecessary code and dependencies and chunks.
2+
//
3+
// Swagger JS is standalone because it is also used by external render like "File View -> OpenAPI render",
4+
// and it doesn't need any code from main site's modules (at the moment).
5+
//
6+
// In the future, if there are common utilities needed by both main site and standalone Swagger,
7+
// we can merge this standalone module into "index.ts", do pay attention to the following problems:
8+
// * HINT: SWAGGER-OPENAPI-VIEWER: there are different places rendering the swagger UI.
9+
// * Handle CSS styles carefully for different cases (standalone page, embedded in iframe)
10+
// * Take care of the JS code introduced by "index.ts" and "iife.ts", there might be global variable dependency and event listeners.
311

412
import '../css/standalone-swagger.css';
513
import SwaggerUI from 'swagger-ui-dist/swagger-ui-es-bundle.js';

0 commit comments

Comments
 (0)