10000 Convert `LoadingAndErrorWrapper` to TS by oisincoveney · Pull Request #52475 · metabase/metabase · GitHub
[go: up one dir, main page]

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

Convert LoadingAndErrorWrapper to TS #52475

Merged
merged 10 commits into from
Jan 24, 2025

Conversation

oisincoveney
Copy link
Contributor
@oisincoveney oisincoveney commented Jan 21, 2025

backporting because this is part of an SDK bug fix

This will help me with the type checking of Start looking for all instances of ExplicitSize findDOMNode.

I also converted the default imports/exports to named ones using grep so that's why this looks so big. The main file of concern is here

Nothing has changed, CI should pass as normal.

@oisincoveney oisincoveney requested a review from a team as a code owner January 21, 2025 23:17
@oisincoveney oisincoveney force-pushed the ts-conversion/loading-error-wrapper branch from 6a89727 to c8a0242 Compare January 21, 2025 23:18
Copy link
Contributor
github-actions bot commented Jan 21, 2025

Codenotify: Notifying subscribers in CODENOTIFY files for diff ee22e28...bd077f5.

No notifications.

@oisincoveney oisincoveney force-pushed the ts-conversion/loading-error-wrapper branch from c8a0242 to b10c098 Compare January 21, 2025 23:19
@@ -26,19 +26,6 @@ describe("LoadingAndErrorWrapper", () => {
).not.toThrow();
});

it("should display a given scene during loading", () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed loadingScenes and sceneIndex from the main component - we don't seem be using them anywhere in the app other than here.

@oisincoveney oisincoveney requested a review from a team January 21, 2025 23:20
Copy link
trunk-io bot commented Jan 22, 2025

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

Copy link
Contributor
rafpaf commented Jan 22, 2025

fwiw there's a DelayedLoadingAndErrorWrapper that I think is meant to eventually supersede this one

I have a backburnered project to overhaul this component and the Delayed version. But porting it to TS now, if it's easy, seems like a good thing to do.

@oisincoveney
Copy link
Contributor Author

fwiw there's a DelayedLoadingAndErrorWrapper that I think is meant to eventually supersede this one

I have a backburnered project to overhaul this component and the Delayed version. But porting it to TS now, if it's easy, seems like a good thing to do.

Ah, gotcha. I think for the bug I'm trying to solve, the types would be really nice (if not sorely needed) on this and I don't think it's too much work

@oisincoveney
Copy link
Contributor Author
oisincoveney commented Jan 22, 2025

This change is part of the following stack:

Change managed by git-spice.

Copy link
Contributor
@heypoom heypoom left a comment

Choose a reason for hiding this comment

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

The TypeScript types looks good. Looks like the remaining diffs is just changing from default to named imports, so should be safe to merge.


interface LoadingAndErrorWrapperProps {
loading?: boolean;
error?: any;
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure if using unknown might make more sense for errors, since you could then cast it to any error types

8000
@oisincoveney oisincoveney force-pushed the ts-conversion/loading-error-wrapper branch from c16cdc2 to 74f81b7 Compare January 22, 2025 23:29
@oisincoveney oisincoveney added the backport Automatically create PR on current release branch on merge label Jan 22, 2025
@oisincoveney oisincoveney requested a review from rafpaf January 23, 2025 03:27
@oisincoveney oisincoveney merged commit 3a8cf25 into master Jan 24, 2025
150 checks passed
@oisincoveney oisincoveney deleted the ts-conversion/loading-error-wrapper branch January 24, 2025 15:37
oisincoveney added a commit that referenced this pull request Jan 27, 2025
@github-actions github-actions bot modified the milestones: 0.53, 0.52.9 Jan 27, 2025
8BF6
Copy link
Contributor

🚀 This should also be released by v0.53

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Automatically create PR on current release branch on merge .Team/Embedding
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0