Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance @nestia/sdk performance by abandoning ts-node #893

Open
samchon opened this issue May 3, 2024 · 4 comments
Open

Enhance @nestia/sdk performance by abandoning ts-node #893

samchon opened this issue May 3, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@samchon
Copy link
Owner

samchon commented May 3, 2024

Current @nestia/sdk is using await import statement for every controller class ts files with ts-node. Therefore, @nestia/sdk is repeating TypeScript source parsing through TypeScript compiler API whenever new controller class comes, and such repeated process is making SDK library and Swagger Documents generation speed extremely slower.

To reduce the generation time, I'll abandon the await import statement with ts-node, and inject metadata information in the compilation level through transform API. Instead, this strategy requires @nestia/core must be required even when using only @nestia/sdk, but I think reducing generation time would be valuable for enduring the dependency.

@samchon samchon added the enhancement New feature or request label May 3, 2024
@samchon samchon self-assigned this May 3, 2024
@samchon samchon added this to To do in V4 Major Update via automation May 3, 2024
@Untaek
Copy link

Untaek commented May 10, 2024

안녕하세요. 라이브러리를 잘 만들어주신 덕분에 편하게 개발하고 있습니다.

언급해주신 기능으로 개발에 필요한 몇가지를 자동화해서 사용하고 있는데
프로젝트의 규모가 커지니 문서 생성에 느려짐이 체감되더라구요.
사용만 하고 도움은 못 드리고 있는데 이렇게 개선해주신다고 하니 감사합니다.

아 그리고 Nestjs로 개발할때 watch 옵션에 의해 소스 변경시 앱이 새로고침 되는데
이 때 Swagger 문서도 재생성 하는 옵션 추가가 가능할까요?

@samchon
Copy link
Owner Author

samchon commented May 14, 2024

안녕하세요. 라이브러리를 잘 만들어주신 덕분에 편하게 개발하고 있습니다.

언급해주신 기능으로 개발에 필요한 몇가지를 자동화해서 사용하고 있는데 프로젝트의 규모가 커지니 문서 생성에 느려짐이 체감되더라구요. 사용만 하고 도움은 못 드리고 있는데 이렇게 개선해주신다고 하니 감사합니다.

아 그리고 Nestjs로 개발할때 watch 옵션에 의해 소스 변경시 앱이 새로고침 되는데 이 때 Swagger 문서도 재생성 하는 옵션 추가가 가능할까요?

@Untaek Whille nestia is generating OpenAPI v3.1 documents, NestJS is generating v3.0 version.

Therefore, automatic swagger documents' refreshing is not possible until NestJS starts supporting the v3.1 version.

@samchon
Copy link
Owner Author

samchon commented May 14, 2024

Will try tsx instead of ts-node.

@Untaek
Copy link

Untaek commented May 25, 2024

Thank you for answer, is it possible to make the generate method parallel when performing code analysis?
For example, in my NestJS project, there are 10 controllers. Wouldn't it be possible to analyze all 10 controllers simultaneously using a function like Promise.all?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

2 participants