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

[dagit] Fix runtime errors in useViewport #6246

Merged
merged 1 commit into from Jan 20, 2022
Merged

Conversation

hellendag
Copy link
Member

@hellendag hellendag commented Jan 18, 2022

Summary

There is an occasional Cloud runtime error within useViewport, where the ref is not actually an element. The ref is currently being set to any, so there are no TS safeguards in place to prevent this.

Fix this up by tracking a typed object.

image

Test Plan

View Gantt chart and parition matrix. Verify that they behave correctly, with no errors.

@vercel
Copy link

vercel bot commented Jan 18, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

dagit-storybook – ./js_modules/dagit/packages/ui

🔍 Inspect: https://vercel.com/elementl/dagit-storybook/7ttu6jJSYRNdFnUQUDmnhv254Wms
✅ Preview: Canceled

[Deployment for ed91d55 canceled]

dagster – ./docs/next

🔍 Inspect: https://vercel.com/elementl/dagster/EErZF2FwzwowqEysZhKpExo94geR
✅ Preview: Canceled

[Deployment for ed91d55 canceled]

@vercel vercel bot temporarily deployed to Preview – dagit-storybook January 18, 2022 22:50 Inactive
@hellendag
Copy link
Member Author

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

@vercel vercel bot temporarily deployed to Preview – dagster January 18, 2022 22:50 Inactive
@hellendag
Copy link
Member Author

Also tidying up some deps based on yarn spew.

@vercel vercel bot temporarily deployed to Preview – dagit-storybook January 19, 2022 16:56 Inactive
@vercel vercel bot temporarily deployed to Preview – dagster January 19, 2022 16:56 Inactive
@vercel vercel bot temporarily deployed to Preview – dagster January 19, 2022 17:47 Inactive
@vercel vercel bot temporarily deployed to Preview – dagit-storybook January 19, 2022 17:47 Inactive
Copy link
Collaborator

@bengotow bengotow left a comment

Choose a reason for hiding this comment

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

This looks good to me, I think I was just being lazy and stashing the __sized prop on the element itself. The new null check seems safe 👍

@vercel vercel bot temporarily deployed to Preview – dagster January 20, 2022 15:59 Inactive
@vercel vercel bot temporarily deployed to Preview – dagit-storybook January 20, 2022 15:59 Inactive
@vercel vercel bot temporarily deployed to Preview – dagit-storybook January 20, 2022 16:01 Inactive
@vercel vercel bot temporarily deployed to Preview – dagster January 20, 2022 16:01 Inactive
@vercel vercel bot temporarily deployed to Preview – dagster January 20, 2022 16:06 Inactive
@vercel vercel bot temporarily deployed to Preview – dagit-storybook January 20, 2022 16:06 Inactive
const suggestions = React.useMemo(() => buildSuggestions(queryString), [
buildSuggestions,
queryString,
]);
Copy link
Member Author

Choose a reason for hiding this comment

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

This keeps getting caught by lint runs. I believe this should iron it out.

@hellendag hellendag merged commit 69d1831 into master Jan 20, 2022
@hellendag hellendag deleted the dish-use-viewport branch January 20, 2022 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants