carlansley / swagger2-koa

Koa 2 middleware for swagger2
MIT License
98 stars 28 forks source link

swagger-ui-dist has a really slow require #28

Closed adcreare closed 6 years ago

adcreare commented 6 years ago

Due to some issues inside swagger-ui-dist the following require code adds around 300-500ms of latency: const SWAGGER_UI_PATH = require('swagger-ui-dist').getAbsoluteFSPath();

Solution is to import absolute-path.js directly A ticket exists on the swagger-ui-dist project https://github.com/swagger-api/swagger-ui/issues/4502 This change makes it resolve in 0.122ms on my system so about 3 orders of magnitude better.

Additionally: updated all dependencies

Part of internal ticket: SRV-154

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 0fed908d8580c03e526017c9de0ba21002cd9f85 on adcreare:master into 71dee0895ce1757fef93c779a1c95b63d18d60f6 on carlansley:master.