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

Yap review #8

Open
sduduzog opened this issue Jul 4, 2024 · 1 comment
Open

Yap review #8

sduduzog opened this issue Jul 4, 2024 · 1 comment
Assignees

Comments

@sduduzog
Copy link

sduduzog commented Jul 4, 2024

  1. This component is a good canditate to try out the ts-pattern package for states

    if (status == "loading") {

  2. Add prettier or biome to help you with format consistency, I see some of these are single quotes and some are double quotes

  3. For writing test descriptions, I personally look at it as the "should" between it and what goes in (...) is silent i.e. the statement "getSessionToken should return a valid token" in test form could be written as describe("getSessionToken") next line will be it("return a valid token") so between the describe and it, there's a silent 'should' which somewhat makes the test read better

    it("valid session", () => {

  4. ofetch from unjs.io is much much better than the polyfilled fetch out there. Just sayin

    const getTokenResponse = await fetch(URLS.Token, {

  5. just

  6. Why do react people do this? This component has a single node already, what's the point of the empty tags?

  7. I got to use it a bit, it's pretty neat. It took a while to figure out how to get started but that's a story for another day

@knightspore
Copy link
Owner

Hey, thank you for taking the time - banger of a review!

Let me get back to you on some of these

  1. I've been meaning to try out ts-pattern for ages and I couldn't think of a good place to do so - this is a great idea!

  2. Biome is another I've been meaning to try - just finished setting up eslint for what I hope is the last time for a project at work and it reminded me I really need to move to Biome by the sound of things. I'm also hoping to move off of Vercel's hosting for the next iteration of Selecta (which might mean no RSC) but we'll see.

  3. This has never clicked for me before, and makes perfect sense. Consider my habits changed!

  4. I'll definitely look into that - I haven't had issues with a polyfilled fetch in years but there's also minimal error reporting / user monitoring happen so I can't say the same for the users 😆

  5. Nothing quite like looking back at something I could do a better job at in Typescript. It's really been a learning year.

  6. I assume this component was, at some point, requiring a fragment - which later clearly changed. In fact, looks like biome would catch this https://biomejs.dev/linter/rules/no-useless-fragments/

  7. Thank you, and I'm glad you think it's neat! I would love to set up a bit of an introductory / onboarding tour for new users. I imagine this has been quite a put-off for users outside of music-oriented circles, cause with a fresh pair of eyes it's really not clear how to make the app do what you want, without an introduction.

Thanks again, this sets me off in a really nice direction for some improvements for a big new iteration.

@knightspore knightspore self-assigned this Jul 4, 2024
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

No branches or pull requests

2 participants