-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
TypeScript migration (partial). #1671
Conversation
✅ Deploy Preview for actualbudget ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Bundle Stats — desktop-clientHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset
View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger
Smaller
Unchanged
|
Bundle Stats — loot-coreHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset
View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger No assets were bigger Smaller
Unchanged
|
@@ -164,7 +164,7 @@ export function addSplitTransaction(transactions, id) { | |||
if (!trans.is_parent) { | |||
return trans; | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making last
into a typed generic in util.ts
bubbled up type issues to transactions.ts
. This is the only location in the codebase using last
, so it seemed most practical to just remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exciting to see all these TS improvements. I hope someday we will be fully TS compatible + strict :)
onError={setError} | ||
onError={err => setError(err)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥜 nitpick: I don't think this change is necessary
onError={setError} | ||
onError={err => setError(err)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
await setServerUrl(null); | ||
await setServerUrl(''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔨 warning: we need to keep null
here.
actual/packages/loot-core/src/server/main.ts
Line 1775 in a8a0f77
if (url == null) { |
await setServerUrl(null); | ||
await setServerUrl(''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
@@ -21,7 +21,7 @@ function ItemContent({ | |||
forceActive, | |||
children, | |||
}: ItemContentProps) { | |||
return onClick ? ( | |||
return onClick || !to ? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💭 thought: I don't think we need this change.
to?: string; | ||
onClick?: MouseEventHandler<HTMLDivElement>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ question: is it that there can be either to
or onClick
? But not both at the same time? If so - we could solve it by changing the types slightly.
(very poor naming chosen here intentionally as this is just an example)
type BaseProps = { style: CSSProperties };
type ItemContentProps = AProps | BProps;
type AProps = BaseProps & { to: string };
type BProps = BaseProps & { onClick: () => void };
Thanks for the feedback. Going to close this PR for now since it is stale and some of the changes have already been addressed in other merged PRs. |
Working through some of the TypeScript migrations/hardening when running
yarn tsc --strict
.Found 3531 errors in 249 files. -> Found 3500 errors in 240 files.
Related: #1483