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

🔨 Switch CodeSadbox to useOvermind, Remove title, add label to Report #2498

Merged
merged 3 commits into from
Sep 27, 2019

Conversation

Saeris
Copy link
Contributor

@Saeris Saeris commented Sep 24, 2019

Small refactor to make the switch to Overmind.

Removed the title from the generated crash report, which will now require users to enter their own in order to be able to submit the report. Hopefully this makes crash reports more descriptive. Crash Reports now include the proper label automatically when they are generated.

@christianalfoni there appears to be an issue with Overmind in this component, as isLoggedIn returns false even when the user is in fact logged in (test this by running locally and navigating to http://localhost:3000/codesadbox from another page). Not quite sure how to solve this one, so I'd appreciate it if you can investigate! Probably has something to do with the error boundary.

Small refactor to make the switch to Overmind.

Removed the title from the generated crash report, which will now require users to enter their own in order to be able to submit the report. Hopefully this makes crash reports more descriptive. Crash Reports now include the proper label automatically when they are generated.

@christianalfoni there appears to be an issue with Overmind in this component, as isLoggedIn returns false even when the user is in fact logged in (test this by running locally and navigating to http://localhost:3000/codesadbox from another page). Not quite sure how to solve this one, so I'd appreciate it if you can investigate! Probably has something to do with the error boundary.
@vercel
Copy link

vercel bot commented Sep 24, 2019

This pull request is automatically deployed with Now.
To access deployments, click Details below or on the icon next to each push.

Latest deployment for this branch: https://codesandbox-client-git-convert-codesadbox-to-overmind.codesandbox1.now.sh

@Saeris Saeris added the 🧠 Overmind Indicates that this is related to the app's State Management label Sep 24, 2019
Copy link
Member

@CompuIves CompuIves left a comment

Choose a reason for hiding this comment

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

Nice!!

@vercel vercel bot temporarily deployed to staging September 24, 2019 09:05 Inactive
Copy link
Contributor Author

@Saeris Saeris left a comment

Choose a reason for hiding this comment

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

Looks good! One question though: wouldn't it be better to put this onMount action on the error boundary component itself? Since this is just the default fallback component and we may use error boundaries elsewhere. Maybe not necessary, but worth considering.

@christianalfoni
Copy link
Contributor

christianalfoni commented Sep 25, 2019

Sorry, I misunderstood the question on my deleted response :)

Yeah, initially that made sense to me as well :) But it is a class and needs the connect HOC. Would love to avoid using that, also I got some really weird typing errors I did not want to ignore or dive into. React HOC typing history is extremely bad :)

But after putting it into "codesadbox" I think it makes more sense from the perspective of it being an actual route. The loading of the initial data and user is related to hitting routes, so if we later refactor to a "state first routing" approach this will still work. The ErrorBoundary is kept dumb and also the codesadBox component will just remove its effect and kept dumb as well :)

Copy link
Contributor

@christianalfoni christianalfoni left a comment

Choose a reason for hiding this comment

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

Looking great! :)

rel="noopener"
href={buildCrashReport({ error, trace })}
>
export const CodeSadbox: React.FC<IFallbackComponentProps> = ({
Copy link
Contributor

Choose a reason for hiding this comment

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

I think using FunctionComponent would make the type a bit more clear.

Suggested change
export const CodeSadbox: React.FC<IFallbackComponentProps> = ({
export const CodeSadbox: React.FunctionComponent<IFallbackComponentProps> = ({

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I am a bit split on this. I started using FunctionComponent, but went for FC due to lazyness. Totally agree it is more explicit, though this type is not really what tells us this is a component. It is the folder name, file name and not at least the JSX in the file. We would never like... "what is this thing? Oh, let me check the type... hm React.FC... hmmmm... oh, it is a component", you know long before you look at the type that it is a component 😄

@vercel vercel bot temporarily deployed to staging September 27, 2019 13:15 Inactive
@SaraVieira SaraVieira merged commit 0f2bf6d into master Sep 27, 2019
@SaraVieira SaraVieira deleted the convert-codesadbox-to-overmind branch September 27, 2019 16:46
yeion7 pushed a commit to yeion7/codesandbox-client that referenced this pull request Sep 30, 2019
…sandbox#2498)

* 🔨 Switch CodeSadbox to useOvermind, Remove title, add label to Report

Small refactor to make the switch to Overmind.

Removed the title from the generated crash report, which will now require users to enter their own in order to be able to submit the report. Hopefully this makes crash reports more descriptive. Crash Reports now include the proper label automatically when they are generated.

@christianalfoni there appears to be an issue with Overmind in this component, as isLoggedIn returns false even when the user is in fact logged in (test this by running locally and navigating to http://localhost:3000/codesadbox from another page). Not quite sure how to solve this one, so I'd appreciate it if you can investigate! Probably has something to do with the error boundary.

* fix mounting logic for codesadbox

* fix types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧠 Overmind Indicates that this is related to the app's State Management 🔨 Refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants