feat(typia): performance optimization.#1851
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Typia’s native adapter and metadata/JSDoc handling, while also bumping workspace package versions and the ttsc catalog dependency.
Changes:
- Adds cached CommonJS import identifier substitutions and known call-expression transformation paths.
- Wires metadata comment tag analysis and extracts JSDoc type-expression text.
- Bumps package versions to
13.0.0-dev.20260514andttscto^0.10.2.
Reviewed changes
Copilot reviewed 29 out of 30 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
packages/typia/native/adapter/imports.go |
Adds CommonJS substitution cache. |
packages/typia/native/adapter/adapter.go |
Uses known module/method transform path. |
packages/typia/native/transform/CallExpressionTransformer.go |
Adds TransformKnown and cached functor map. |
packages/typia/native/core/factories/MetadataFactory.go |
Wires comment tag analyzer. |
packages/typia/native/core/factories/internal/metadata/MetadataHelper.go |
Extracts JSDoc type expressions. |
packages/typia/native/core/factories/internal/metadata/iterate_metadata_comment_tags.go |
Applies metadata comment tags to properties. |
packages/typia/native/core/factories/internal/metadata/IMetadataIteratorProps.go |
Adds comment tag analyzer hook type. |
pnpm-workspace.yaml |
Updates ttsc catalog version. |
pnpm-lock.yaml |
Locks ttsc and optional binaries to 0.10.2. |
package.json |
Bumps root version. |
benchmark/package.json |
Bumps package version. |
config/package.json |
Bumps package version. |
examples/package.json |
Bumps package version. |
packages/interface/package.json |
Bumps package version. |
packages/langchain/package.json |
Bumps package version. |
packages/mcp/package.json |
Bumps package version. |
packages/typia/package.json |
Bumps package version. |
packages/utils/package.json |
Bumps package version. |
packages/vercel/package.json |
Bumps package version. |
tests/debug/package.json |
Bumps package version. |
tests/template/package.json |
Bumps package version. |
tests/test-error/package.json |
Bumps package version. |
tests/test-langchain/package.json |
Bumps package version. |
tests/test-mcp/package.json |
Bumps package version. |
tests/test-typia-automated/package.json |
Bumps package version. |
tests/test-typia-generate/package.json |
Bumps package version. |
tests/test-typia-schema/package.json |
Bumps package version. |
tests/test-utils-automated/package.json |
Bumps package version. |
tests/test-utils/package.json |
Bumps package version. |
tests/test-vercel/package.json |
Bumps package version. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements and refactorings to the Typia native adapter and metadata handling, focusing on performance optimizations, extensibility, and improved JSDoc tag extraction. The most significant changes include the addition of caching for import identifier substitutions, enhanced JSDoc tag extraction (including type expressions), and a more extensible analyzer system for metadata comment tags. There are also notable refactorings in the call expression transformation logic to support more precise handling of known module/method pairs.
Performance and Caching Improvements
sync.Map) forcommonJSImportIdentifierSubstitutionsto avoid redundant computation of import identifier substitutions per source file, improving performance when processing large codebases. [1] [2]Metadata and JSDoc Tag Extraction Enhancements
MetadataCommentTagAnalyzerfunction, enabling custom analyzers and better separation of concerns. [1] [2] [3]Call Expression Transformation Refactoring
Miscellaneous
nativescannerinMetadataHelper.go, required for extracting type expression texts.These changes collectively improve the maintainability, extensibility, and efficiency of the Typia codebase, particularly in areas related to TypeScript AST processing and metadata extraction.