-
Notifications
You must be signed in to change notification settings - Fork 285
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(storage-browser): redefine createStorageBrowser interface #5907
base: feat-storage-browser/main
Are you sure you want to change the base?
feat(storage-browser): redefine createStorageBrowser interface #5907
Conversation
|
"jest-tsd": "^0.2.2", | ||
"@tsd/typescript": "^5.1.6", |
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.
Required to run jest-tsd
.
"devDependencies": { | ||
"jest-tsd": "^0.2.2", | ||
"@tsd/typescript": "^5.1.6", | ||
"@types/node": "^18.19.50" |
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.
jest-tsd
relying on node types, the workspace has had lower version of @types/node
transitively, but versions lower. than 18.19.5
causes a typescript error while running the test. So using "@types/node": "^18.19.50"
here.
- Generate interfaces based on custom actions
3a43aff
to
67cf7b4
Compare
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.
Thanks for doing this @HuiSF! Just did a quick review until i pull it down locally, mostly naming feedback and a couple questions
packages/react-storage/src/components/StorageBrowser/actions/configs/defaults.ts
Outdated
Show resolved
Hide resolved
packages/react-storage/src/components/StorageBrowser/actions/configs/defaults.ts
Outdated
Show resolved
Hide resolved
packages/react-storage/src/components/StorageBrowser/actions/configs/types.ts
Outdated
Show resolved
Hide resolved
packages/react-storage/src/components/StorageBrowser/actions/configs/types.ts
Outdated
Show resolved
Hide resolved
packages/react-storage/src/components/StorageBrowser/actions/configs/types.ts
Outdated
Show resolved
Hide resolved
packages/react-storage/src/components/StorageBrowser/actions/configs/types.ts
Outdated
Show resolved
Hide resolved
packages/react-storage/src/components/StorageBrowser/storageBrowser/createStorageBrowser.ts
Outdated
Show resolved
Hide resolved
packages/react-storage/src/components/StorageBrowser/storageBrowser/types.ts
Outdated
Show resolved
Hide resolved
packages/react-storage/src/components/StorageBrowser/storageBrowser/types.ts
Outdated
Show resolved
Hide resolved
packages/react-storage/src/components/StorageBrowser/storageBrowser/types.ts
Outdated
Show resolved
Hide resolved
packages/react-storage/src/components/StorageBrowser/actions/configs/types.ts
Outdated
Show resolved
Hide resolved
isCancelable: IsCancelableTaskHandler<T>; | ||
isCancelable: boolean; |
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.
This change breaks restricting isCancelable
based on the allowed result
of the provided handler
.
For example, if i provide a handler
with a CancelableTaskHandlerOutput
, the value of result
is :
"CANCELED" | "COMPLETE" | "FAILED"
IsCancelableTaskHandler
will restrict isCancelable
to true
. For context, isCancelable
is ultimately a runtime flag used to determine whether or not to display the "Canceled" count in the StatusDisplay
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.
This restriction makes isCancelableTaskHandler
field un-configurable while defining a custom action, where the result
is not a part of the custom action interface to infer the correct value from. (with the restriction, isCancelableTaskHandler
value will always be false
within custom actions) Do we need an interface change for this?
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.
In my local testing on feat-storage-browser/main
that is not the case, although i did need to make the change you applied here
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.
But also open to interface changes if need be 😄
Description of changes
createStorageBrowser
APIactions/configs/types.ts
to ensure contextual typing worksjest-tsd
to unit testing the type generationIssue #, if available
Description of how you validated changes
Checklist
yarn test
passes and tests are updated/addeddocs
,e2e
,examples
, or other private packages.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.