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

Add typings to most of the Redux logic #1269

Merged
merged 25 commits into from
Jul 18, 2023
Merged

Add typings to most of the Redux logic #1269

merged 25 commits into from
Jul 18, 2023

Conversation

j-f1
Copy link
Contributor

@j-f1 j-f1 commented Jul 3, 2023

This will automatically flow types into useSelector and dispatch calls. Action (heh) item: port components to useActions() to get access to typed actions.

@netlify
Copy link

netlify bot commented Jul 3, 2023

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit 8dc5b7a
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/64b6dede75e4b300087d6955
😎 Deploy Preview https://deploy-preview-1269.demo.actualbudget.org/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@j-f1 j-f1 marked this pull request as draft July 3, 2023 20:40
@github-actions
Copy link
Contributor

github-actions bot commented Jul 3, 2023

Bundle Stats - desktop-client

Hey 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

Files count Total bundle size % Changed
13 2.34 MB -> 2.33 MB (-4.1 KB) -0.17%
Changeset
File Δ Size
src/components/Notifications.tsx 🆕 +3.91 KB 0 B -> 3.91 KB
../loot-core/src/client/reducers/budgets.ts 📈 +175 B (+6.16%) 2.78 KB -> 2.95 KB
package.json 📈 +31 B (+1.72%) 1.76 KB -> 1.79 KB
src/components/manager/ImportActual.js 📉 -17 B (-0.69%) 2.4 KB -> 2.38 KB
src/components/manager/ImportYNAB5.js 📉 -17 B (-0.76%) 2.18 KB -> 2.17 KB
src/components/manager/ImportYNAB4.js 📉 -17 B (-0.78%) 2.13 KB -> 2.12 KB
../loot-core/src/client/actions/budgets.ts 📉 -86 B (-1.56%) 5.4 KB -> 5.32 KB
src/components/manager/Modals.js 📉 -99 B (-4.44%) 2.18 KB -> 2.08 KB
src/components/Modals.js 📉 -313 B (-5.58%) 5.48 KB -> 5.17 KB
../loot-core/src/client/reducers/account.ts 📉 -71 B (-7.74%) 917 B -> 846 B
../loot-core/src/client/actions/index.ts 📉 -21 B (-8.61%) 244 B -> 223 B
../loot-core/src/client/reducers/modals.ts 📉 -117 B (-12.29%) 952 B -> 835 B
../loot-core/src/client/reducers/index.ts 📉 -72 B (-17.43%) 413 B -> 341 B
../loot-core/src/client/reducers/queries.ts 📉 -473 B (-18.12%) 2.55 KB -> 2.09 KB
../loot-core/src/client/constants.ts 📉 -389 B (-22.08%) 1.72 KB -> 1.34 KB
../loot-core/src/client/actions/modals.ts 📉 -130 B (-27.25%) 477 B -> 347 B
src/components/Notifications.js 🔥 -3.89 KB (-100%) 3.89 KB -> 0 B
src/components/modals/ConfigureLinkedAccounts.js 🔥 -3.31 KB (-100%) 3.31 KB -> 0 B
../loot-core/src/client/reducers/debug.ts 🔥 -407 B (-100%) 407 B -> 0 B
../loot-core/src/client/reducers/profile.ts 🔥 -333 B (-100%) 333 B -> 0 B
../loot-core/src/shared/accounts.ts 🔥 -199 B (-100%) 199 B -> 0 B
../loot-core/src/client/actions/debug.ts 🔥 -123 B (-100%) 123 B -> 0 B
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

Asset File Size % Changed
static/js/main.js 1.03 MB -> 1.03 MB (-4.1 KB) -0.39%

Unchanged

Asset File Size % Changed
static/js/457.chunk.js 387.21 KB 0%
static/media/Inter.var.woff2 317.25 KB 0%
static/media/Inter-italic.var.woff2 239.29 KB 0%
static/media/Inter-roman.var.woff2 221.86 KB 0%
static/media/bg.svg 116.73 KB 0%
static/js/reports.chunk.js 20.8 KB 0%
static/js/969.chunk.js 12.94 KB 0%
static/js/resize-observer-polyfill.chunk.js 8.12 KB 0%
static/css/main.css 6.08 KB 0%
index.html 1.68 KB 0%
asset-manifest.json 1.47 KB 0%
static/media/browser-server.js 963 B 0%

@github-actions
Copy link
Contributor

github-actions bot commented Jul 3, 2023

Bundle Stats - loot-core

Hey 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

Files count Total bundle size % Changed
2 1.96 MB 0%

Changeset

No files were changed

View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
kcab.worker.js 1007.79 KB 0%
xfo.xfo.kcab.worker.js 1004.04 KB 0%

@j-f1 j-f1 force-pushed the jed/type-state branch 2 times, most recently from 84bc933 to 5fc7323 Compare July 4, 2023 13:16
@j-f1 j-f1 force-pushed the jed/type-state branch 2 times, most recently from 4f8f306 to fe59e3a Compare July 17, 2023 22:13
@j-f1 j-f1 marked this pull request as ready for review July 17, 2023 22:17
@j-f1 j-f1 marked this pull request as draft July 18, 2023 15:48
@j-f1
Copy link
Contributor Author

j-f1 commented Jul 18, 2023

Gonna reorg the commits here & open a second PR with just the modal types since they’re the most complex bit.

packages/loot-core/src/client/actions/budgets.ts Outdated Show resolved Hide resolved
@@ -563,7 +562,7 @@ export async function createTestBudget(handlers) {
await db.runQuery('DELETE FROM categories;');
await db.runQuery('DELETE FROM category_groups');

let accounts: AccountEntity[] = [
let accounts: { name: string; offBudget?: 1; id?: string }[] = [
Copy link
Member

Choose a reason for hiding this comment

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

❓ question: ‏do we even need a type here? Isn't it already implied from the data struct we provide it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, because otherwise the id property won’t be inferred

packages/loot-core/src/types/budget.d.ts Outdated Show resolved Hide resolved
packages/desktop-client/src/components/Modals.tsx Outdated Show resolved Hide resolved
@j-f1 j-f1 marked this pull request as ready for review July 18, 2023 18:37
Copy link
Member

@MatissJanis MatissJanis left a comment

Choose a reason for hiding this comment

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

thanks!

@j-f1 j-f1 merged commit 2860837 into master Jul 18, 2023
15 checks passed
@j-f1 j-f1 deleted the jed/type-state branch July 18, 2023 19:02
@trafico-bot trafico-bot bot added ✨ Merged Pull Request has been merged successfully and removed ✅ Approved labels Jul 18, 2023
FlorianLang06 pushed a commit to FlorianLang06/actual that referenced this pull request Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Merged Pull Request has been merged successfully
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants