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

feat(type-compiler): inline external library imports #517

Closed
wants to merge 27 commits into from

Conversation

marcus-sa
Copy link
Contributor

@marcus-sa marcus-sa commented Nov 30, 2023

Summary of changes

This introduces a new configuration for the type compiler in tsconfig.json.

{
  "compilerOptions": {
    // ...
  },
  "deepkitTypeCompilerOptions": {
    "reflection": true,
    "inlineExternalLibraryImports": {
      "rxjs": true, // mark all imports to be inlined
      // or
      "rxjs": ["Observable", "Subject"] // mark selected imports to be inlined
    }
  }
}

Relinquishment of Rights

Please mark following checkbox to confirm that you relinquish all rights of your changes:

  • I waive and relinquish all rights regarding this changes (including code, text, and images) to Deepkit UG (limited), Germany. This changes (including code, text, and images) are under MIT license without name attribution, copyright notice, and permission notice requirement.

@marcus-sa marcus-sa changed the title feat(type-compiler): inline external types feat(type-compiler): inline external imports Nov 30, 2023
@marcus-sa marcus-sa force-pushed the feat/inline-external-types branch 2 times, most recently from 6c026f3 to 5cf7b32 Compare December 5, 2023 16:19
@marcus-sa marcus-sa changed the title feat(type-compiler): inline external imports feat(type-compiler): inline external library imports Dec 5, 2023
matches with typescript's definition of it
Signed-off-by: Marcus S. Abildskov <8391194+marcus-sa@users.noreply.github.com>
@marcus-sa marcus-sa force-pushed the feat/inline-external-types branch 8 times, most recently from 58b1a8b to b4d32ab Compare December 6, 2023 09:55
so that external type names don't clash with user defined type names when inlined
so that external type names don't clash with user defined type names when inlined
@codecov-commenter
Copy link

codecov-commenter commented Dec 8, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (f67cf73) 83.91% compared to head (debd1d8) 77.38%.

❗ Current head debd1d8 differs from pull request most recent head c926db5. Consider uploading reports for the commit c926db5 to get more accurate results

Files Patch % Lines
packages/injector/src/injector.ts 0.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #517      +/-   ##
==========================================
- Coverage   83.91%   77.38%   -6.54%     
==========================================
  Files          51      147      +96     
  Lines        3084    18155   +15071     
  Branches      667     4821    +4154     
==========================================
+ Hits         2588    14049   +11461     
- Misses        496     4106    +3610     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@marcus-sa marcus-sa marked this pull request as ready for review December 8, 2023 16:03
marcus-sa and others added 2 commits January 9, 2024 11:34
Signed-off-by: Marcus S. Abildskov <8391194+marcus-sa@users.noreply.github.com>
marcus-sa referenced this pull request Jan 12, 2024
…ster on average use case.

 previously the cost of passing the type via type arguments (e.g. cast<User>, is<User>, ...) was too high and involved the usage of the full type virtual machine in order to interpret `Op.inline`. Adding this fast path to directly forwards to referenced type making it a lot faster and bypassing the type virtual machine entirely if the referenced type was already computed.
Signed-off-by: Marcus S. Abildskov <8391194+marcus-sa@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants