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

[TS migration] Migrate Onyx private methods to TS #523

Merged
merged 53 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
1a5dd28
Start migrating OnyxUtils.js
blazejkustra Mar 27, 2024
6cb9c89
Migrate sendActionToDevTools
blazejkustra Mar 27, 2024
99b48fd
Migrate maybeFlushBatchUpdates and batchUpdates
blazejkustra Mar 27, 2024
1d467c6
Migrate reduceCollectionWithSelector
blazejkustra Mar 27, 2024
39af6aa
Migrate get function
blazejkustra Mar 27, 2024
86a0316
Migrate getAllKeys
blazejkustra Mar 27, 2024
7f21b11
Migrate isCollectionMemberKey
blazejkustra Mar 27, 2024
a9fe905
Migrate splitCollectionMemberKey
blazejkustra Mar 27, 2024
0836fae
Migrate isKeyMatch and isSafeEvictionKey
blazejkustra Mar 27, 2024
6c59d35
Migrate tryGetCachedValue
blazejkustra Mar 27, 2024
cfb36c0
Migrate removeLastAccessedKey
blazejkustra Apr 2, 2024
e588799
Migrate addLastAccessedKey
blazejkustra Apr 2, 2024
0dc2147
Migrate removeFromEvictionBlockList
blazejkustra Apr 2, 2024
cd769d7
Migrate addToEvictionBlockList
blazejkustra Apr 2, 2024
b29bf82
Migrate addAllSafeEvictionKeysToRecentlyAccessedList
blazejkustra Apr 2, 2024
e648b76
Migrate getCachedCollection
blazejkustra Apr 2, 2024
fb4c649
Migrate keysChanged
blazejkustra Apr 2, 2024
3dbbff4
Migrate keyChanged
blazejkustra Apr 2, 2024
9429923
Migrate sendDataToConnection
blazejkustra Apr 2, 2024
609749d
Migrate addKeyToRecentlyAccessedIfNeeded
blazejkustra Apr 2, 2024
b3cf3ae
Migrate getCollectionDataAndSendAsObject
blazejkustra Apr 2, 2024
33fbfee
Migrate scheduleSubscriberUpdate
blazejkustra Apr 2, 2024
7c2e76e
Migrate scheduleNotifyCollectionSubscribers
blazejkustra Apr 2, 2024
e174b1c
Migrate remove
blazejkustra Apr 2, 2024
2fdbafc
Migrate reportStorageQuota
blazejkustra Apr 2, 2024
dc13690
Migrate evictStorageAndRetry
blazejkustra Apr 2, 2024
9ae37ec
Migrate broadcastUpdate
blazejkustra Apr 2, 2024
b20adfe
Migrate hasPendingMergeForKey
blazejkustra Apr 2, 2024
735330f
Migrate removeNullValues
blazejkustra Apr 2, 2024
8f52bcc
Migrate prepareKeyValuePairsForStorage
blazejkustra Apr 2, 2024
8e25a16
Migrate applyMerge
blazejkustra Apr 2, 2024
c33ad71
Migrate remaining OnyxUtils
blazejkustra Apr 2, 2024
89fa0c8
Remove old OnyxUtils and fix cycle import issue
blazejkustra Apr 2, 2024
6425cd1
Remove OnyxUtils.d.ts
blazejkustra Apr 2, 2024
989331a
Add temp assertions
blazejkustra Apr 3, 2024
a44c3e1
Fix tests and failing TS
blazejkustra Apr 3, 2024
a11b05a
Fix all remainign type errors
blazejkustra Apr 8, 2024
6984234
Clean promise types
blazejkustra Apr 8, 2024
40501b6
Fix sendActionToDevTools types
blazejkustra Apr 8, 2024
d842423
Fix tryGetCachedValue types
blazejkustra Apr 8, 2024
52f06e8
Gix keyChanged types
blazejkustra Apr 8, 2024
2d896db
Gix sendDataToConnection types
blazejkustra Apr 8, 2024
6c276c3
Fix getCollectionDataAndSendAsObject types
blazejkustra Apr 8, 2024
ba6fc81
Fix last TS issues
blazejkustra Apr 8, 2024
61d0958
Merge branch 'main' into ts/Onyx-private-methods
blazejkustra Apr 9, 2024
e07320b
Fix types in OnyxUtils
blazejkustra Apr 10, 2024
1c05712
Fix sendActionToDevTools types
blazejkustra Apr 10, 2024
26e43c8
Add missing return types
blazejkustra Apr 10, 2024
eaf2622
Merge branch 'main' into ts/Onyx-private-methods
blazejkustra Apr 10, 2024
6807e08
Temp fix for type errors
blazejkustra Apr 10, 2024
0344ab5
Fix remaining types
blazejkustra Apr 11, 2024
6de78ed
Apply git diff for storage providers
blazejkustra Apr 12, 2024
a38e102
Fix build:docs script
blazejkustra Apr 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
399 changes: 399 additions & 0 deletions API-INTERNAL.md

Large diffs are not rendered by default.

412 changes: 85 additions & 327 deletions API.md

Large diffs are not rendered by default.

8 changes: 0 additions & 8 deletions buildDocs.js

This file was deleted.

14 changes: 14 additions & 0 deletions buildDocs.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import fs from 'fs';
import jsdoc2md from 'jsdoc-to-markdown';

jsdoc2md.render({files: 'dist/Onyx.js'}).then((docs) => {
let heading = '<!---These docs were automatically generated. Do not edit them directly run `npm run build:docs` script-->\n\n# API Reference\n\n';
heading += docs;
fs.writeFileSync('API.md', heading);
});

jsdoc2md.render({files: 'dist/OnyxUtils.js'}).then((docs) => {
let heading = '<!---These docs were automatically generated. Do not edit them directly run `npm run build:docs` script-->\n\n# Internal API Reference\n\n';
heading += docs;
fs.writeFileSync('API-INTERNAL.md', heading);
});
2 changes: 1 addition & 1 deletion lib/DevTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class DevTools {
* @param payload - data written to the storage
* @param stateChanges - partial state that got updated after the changes
*/
registerAction(type: string, payload: unknown, stateChanges: Record<string, unknown> = {}) {
registerAction(type: string, payload: unknown, stateChanges: Record<string, unknown> | null = {}) {
try {
if (!this.remoteDev) {
return;
Expand Down
289 changes: 148 additions & 141 deletions lib/Onyx.ts

Large diffs are not rendered by default.

320 changes: 0 additions & 320 deletions lib/OnyxUtils.d.ts

This file was deleted.

Loading
Loading