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

Migrate user dashboard and Explore pages to SPA #2731

Merged
merged 68 commits into from Mar 1, 2024

Conversation

anshg1214
Copy link
Member

@anshg1214 anshg1214 commented Jan 24, 2024

This PR migrates the User Dashboard and Explore pages to SPA

@pep8speaks
Copy link

pep8speaks commented Jan 24, 2024

Hello @anshg1214! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2024-02-28 13:25:14 UTC

@anshg1214 anshg1214 marked this pull request as ready for review February 1, 2024 14:28
Copy link
Contributor

@MonkeyDo MonkeyDo left a comment

Choose a reason for hiding this comment

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

Looking better and better! I think we're just about ready to merge after this last pass.

Test suite is currently failing because of the commented out UserEntityChart tests. (see comment).
It wouldn't be wise to comment out the test suite for a feature being refactored and I know this test suite can be tricky, so don't hesitate if you need a hand with it.

As we both discussed in private messages, I think after merging this we'll want to look at our bundling and code-splitting strategy because this index.js file is going to be pretty huge now :)

frontend/js/src/explore/Explore.tsx Outdated Show resolved Hide resolved
frontend/js/src/user/stats/UserReports.tsx Outdated Show resolved Hide resolved
frontend/js/src/explore/cover-art-collage/SEO.tsx Outdated Show resolved Hide resolved
frontend/js/src/explore/cover-art-collage/SEO.tsx Outdated Show resolved Hide resolved
frontend/js/src/user/charts/utils.tsx Outdated Show resolved Hide resolved
anshg1214 and others added 3 commits February 23, 2024 15:21
I don't think we can adapt the existing tests to work with react-router, and we most likely need to rewrite the tests entirely to use react-testing-library instead of Enzyme.
In the meantime we need a placeholder to prevent the suite from failing automatically (when empty)
Copy link
Contributor

@MonkeyDo MonkeyDo left a comment

Choose a reason for hiding this comment

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

Took a while to test everything, but i only found a couple of issues, the rest is working great !

};

export function ErrorBoundary() {
const error = useRouteError() as RouteError;
Copy link
Contributor

Choose a reason for hiding this comment

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

It's worth reading the sentry docs about integration with react-router: https://docs.sentry.io/platforms/javascript/guides/react/features/react-router/

I'm not sure what the differences would be but it looks like there are some pre-packaged wrappers that could be helpful.

Between that and the ErrorBoundary component that Sentry exports (https://docs.sentry.io/platforms/javascript/guides/react/features/error-boundary/), i wonder if we need to create our own anymore (I don't know if there was a good reason for not using it in the first place and rolling out our own instead)

Can be kept for a follow-up PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree, Lets refactor this Error Boundary in the follow-up PR. We also have to rewrite the this error boundary.

<Helmet>
<title>Error</title>
</Helmet>
<h2 className="page-title">Error Occured!</h2>
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we display the errorMessage and a reload/home button in this section?

frontend/js/src/error/ErrorBoundary.tsx Outdated Show resolved Hide resolved
frontend/js/src/explore/routes/index.tsx Show resolved Hide resolved
frontend/js/src/routes/routes.tsx Outdated Show resolved Hide resolved
frontend/js/src/user/stats/UserReports.tsx Show resolved Hide resolved
Copy link
Contributor

@MonkeyDo MonkeyDo 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 @anshg1214 !

I deployed to tests again for testing, everything I tried is working fine.
Great job!

@MonkeyDo MonkeyDo merged commit fdd045d into master Mar 1, 2024
4 checks passed
@MonkeyDo MonkeyDo deleted the migrate-user-feed-to-spa branch March 1, 2024 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants