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: upgrade TypeScript to 4.4 #134

Merged
merged 4 commits into from
Sep 7, 2021
Merged

Conversation

wschurman
Copy link
Member

Why

We're a few versions behind. This comes with quite a few new features, but the ones that affect this repo or are likely to affect it are:

In addition to those, it is faster in general.

How

Upgrade the package. Ensure all tests and docs generation pass.

Test Plan

Wait for CI.

@wschurman wschurman requested a review from ide September 7, 2021 21:01
@codecov
Copy link

codecov bot commented Sep 7, 2021

Codecov Report

Merging #134 (7e7af00) into master (1201cc0) will increase coverage by 0.02%.
The diff coverage is 97.14%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #134      +/-   ##
==========================================
+ Coverage   95.77%   95.79%   +0.02%     
==========================================
  Files          70       70              
  Lines        1799     1809      +10     
  Branches      196      223      +27     
==========================================
+ Hits         1723     1733      +10     
  Misses         75       75              
  Partials        1        1              
Flag Coverage Δ
integration 95.79% <97.14%> (+0.02%) ⬆️
unittest 95.79% <97.14%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/entity/src/EntityDatabaseAdapter.ts 100.00% <ø> (ø)
packages/entity/src/EntityFields.ts 100.00% <ø> (ø)
...ty-example/src/adapters/InMemoryDatabaseAdapter.ts 45.83% <50.00%> (ø)
...tity-cache-adapter-redis/src/GenericRedisCacher.ts 100.00% <100.00%> (ø)
...apter-redis/src/errors/wrapNativeRedisCallAsync.ts 100.00% <100.00%> (ø)
...-adapter-knex/src/PostgresEntityDatabaseAdapter.ts 100.00% <100.00%> (ø)
...ter-knex/src/errors/wrapNativePostgresCallAsync.ts 100.00% <100.00%> (ø)
packages/entity/src/EntityLoader.ts 89.13% <100.00%> (+0.24%) ⬆️
packages/entity/src/EntityPrivacyPolicy.ts 96.61% <100.00%> (ø)
packages/entity/src/internal/EntityDataManager.ts 100.00% <100.00%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1201cc0...7e7af00. Read the comment docs.

Comment on lines +72 to +79
orderBy:
| {
columnName: string;
order: OrderByOrdering;
}[]
| undefined;
offset: number | undefined;
limit: number | undefined;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For APIs it's usually nicer to be able to omit a field than to need to write { unusedOption: undefined }. Depending on how this code is called into, it might be better to write: { orderBy?: {...} | undefined } to allow both.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an internal-only type that is the internal representation of QuerySelectionModifiers, the main difference being that it contains the translated column name. Because it's used internally only we can ensure that all constructions of it contain explicit undefined (only place that creates one is convertToTableQueryModifiers in this file).

@wschurman wschurman merged commit 7612392 into master Sep 7, 2021
@wschurman wschurman deleted the @wschurman/upgrade-ts-again branch September 7, 2021 22:17
@jkhales
Copy link

jkhales commented Sep 8, 2021

🥳

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.

3 participants