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

Code submission for FLIP fest 'Playground: Fix client-side errors in the playground frontend #58' - Milestone 1 #176

Merged
merged 4 commits into from
Dec 15, 2021

Conversation

hichana
Copy link
Contributor

@hichana hichana commented Oct 28, 2021

Closes: #163 #164 #165 #166

Description

This PR includes work done in PR #167. #167 resolves the main issues that were causing the cascade of console errors. As I wrote in that PR, and as encouraged in the FLIP issue, I refactored the code in order to help avoid similar issues in the future. This refactor was done as a part of FLIP fest issue #58. My basic thinking for this refactor was:

  • There are 5 entries are added into the browser's history stack upon loading of the playground (as explained in my 0.5 submission.
  • I saw a way to remove all of the redirects that were causing the multiple entries by moving the logic for fully loading the playground outside of the project provider (React Context API), which removes unnecessary redirects and helps reduce similar issues in the future. Appropriate data is then passed to the project provider.
  • By reducing the number of redirects, the app is much more performant and results in a better experience for users.

For contributor use:

  • [n/a ] Targeted PR against correct branch (see CONTRIBUTING.md)
  • [x ] Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • [x ] Code follows the standards mentioned here.
  • [n/a ] Updated relevant documentation
  • [x ] Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

@hichana hichana requested a review from 10thfloor as a code owner October 28, 2021 07:20
@vercel
Copy link

vercel bot commented Oct 28, 2021

@hichana is attempting to deploy a commit to the Flow Team on Vercel.

A member of the Team first needs to authorize it.

src/components/AccountList.tsx Outdated Show resolved Hide resolved
src/components/Sidebar.tsx Outdated Show resolved Hide resolved
src/containers/Editor/index.tsx Outdated Show resolved Hide resolved
src/providers/Project/index.tsx Outdated Show resolved Hide resolved
@hichana
Copy link
Contributor Author

hichana commented Nov 2, 2021

Thanks for the feedback @MaxStalker. I made the revisions:

  • removed the console.log
  • added an exported constant for the local project id in 'url.ts', which is the same place where another helper is exported ('scriptTypes').
  • made all places where the local project id is consumed import the local project id
  • changed the other local ids in projectDefault.ts to also be lowercase, but did not add them to 'url.ts' as they are only used in the projectDefault.ts file

For now I've marked the comments you left in this thread as 'resolved', but please let me know if these changes don't satisfy your comments in some way and I'll be happy to revise again.

src/util/url.ts Outdated Show resolved Hide resolved
@kerrywei kerrywei requested a review from MaxStalker November 4, 2021 17:13
Copy link
Contributor

@MaxStalker MaxStalker left a comment

Choose a reason for hiding this comment

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

Looking good! ⭐

@vercel
Copy link

vercel bot commented Nov 8, 2021

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

🔍 Inspect: https://vercel.com/onflow/flow-playground/6y5ZUUxxkRHRvHteAeKu5kxQSNxB
✅ Preview: https://flow-playground-git-fork-hichana-flip-58-submissi-27328b-onflow.vercel.app

@vercel vercel bot temporarily deployed to Preview November 8, 2021 17:39 Inactive
@MaxStalker MaxStalker merged commit f6ac756 into onflow:master Dec 15, 2021
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.

A 'uncaught' warning the the browser console
3 participants