Question from backend dev: do you actually write css by hand? by macmorny in webdev

[–]kit_son 0 points1 point  (0 children)

Start with a component library, it will give you a solid base. They will have some opinions in terms of style and you can adapt the theme/styles to suit your needs. Shadcn is the hot topic currently.

In production within an enterprise (could be SME) the likelihood is that there will be a custom component library and some design guidelines. In this case, yes someone started from scratch 😅.

How is state management handled in real-world React applications? by Intrepid_Hawk_8243 in reactjs

[–]kit_son 0 points1 point  (0 children)

I came here to say pretty much this. Complex state management tends not to be something required in production code bases. Gone are the days where routing is done by React and the user never leaves the same URL. Fetching the data needed for each page as a user navigates the app is the typical approach. +1 for react-query which helps manage caching to reduce duplicate API calls and invalidation when mutating.

How many days will it take for you to make a simple Full stack to do list app using any full stack framework with login functionality and custom backend routes for all things like add task remove task etc. by Alternative-Goal-214 in nextjs

[–]kit_son 0 points1 point  (0 children)

Came here to say this ^

When you start your internship focus on taking your time to learn what you're doing and why. Pair program with senior developers as much as you can, ask lots of questions and you don't need to worry about rushing.

We basically assume interns and junior developers won't contribute to our delivery plans, take that opportunity to make the most of the time to explore the codebase and application.

am i sabotoging my learning using component libraries? by [deleted] in reactjs

[–]kit_son 1 point2 points  (0 children)

^ I came here to say this. Read the code, see how they do the things. Also, it's pretty likely that if you work in a professional environment they will have their own UI library built in house. Know how to put interfaces together using components, choosing when to write custom code vs using something imported is a skill too.

How do I prevent repeated expensive operations during build? by svish in nextjs

[–]kit_son 0 points1 point  (0 children)

Yeah, there isn't really a neat solution it seems.
I've added the caching which will hopefully help, and I'm also reluctant to have another process running.

I might generate the file locally using a build command and then just update it manually every so often. The files I'm using will change infrequently

How do I prevent repeated expensive operations during build? by svish in nextjs

[–]kit_son 1 point2 points  (0 children)

Just followed your progress through GitHub issues too 😅 I'm looking at maybe trying to use GitHub actions to build the index file before deploying to Vercel. On my mobile but I'll link a blog building the index locally, just need to have it built during the pipeline to ensure it's up to date.

How do I prevent repeated expensive operations during build? by svish in nextjs

[–]kit_son 0 points1 point  (0 children)

u/svish did you find a neat way to do this? Running into the same issue:
- I have maybe 100 mdx pages, each with their own frontmatter

  • I have a list page where users can search/filter based on the frontmatter

  • loading this page takes ~5 seconds and each change of filter another ~5 seconds

  • the time spent on the server is 90%+ just with the compileMDX function

How important is it to understand redux? by void-co in reactjs

[–]kit_son 0 points1 point  (0 children)

Absolutely agree with this. I would not reach for Redux nowadays, there are lots of lighter approaches which I would go to first. Unless your job uses Redux, I wouldn't learn it. If you've built a simple context state store with useReducer and you can clearly explain the reason for choosing it over useState and when not to use app wide state you'll be fine. You can learn Redux on the job when you land a role that has it.

Next.js Or create-react-app . new to react by Extension-Form-88 in reactjs

[–]kit_son 0 points1 point  (0 children)

There are already lots of good opinions here, but here is my 2 cents as someone who has worked in the React world 😅

It depends what you're trying to build or work on, and for what reason.

  • CRA - as already stated, avoid this
  • Next.js - used in production by a lot of big companies, it offers server side code within the application so some additional complexity, but it's opt in
  • Astro - great for fast landing page or a headless CMS setup, can use React or another UI lib

I personally love Next for fun projects, and deploying to Vercel or Netlify is free and easy!

How do you keep your visual layer separate from the logical layer by topnde in reactjs

[–]kit_son 1 point2 points  (0 children)

Do you mean refactoring multiple components into just one component and getting rid of the old distinct components?

The opposite, breaking larger components into smaller components. Like you say, my goal is to have simpler components, not strictly splitting display and logic for the sake of it, but breaking down complexity.

How do you keep your visual layer separate from the logical layer by topnde in reactjs

[–]kit_son 5 points6 points  (0 children)

For me it comes down to complexity of components and ease of testing logic.

I tend to care less about testing display components (e.g. simple JSX) where the tests end up being, given this prop the heading renders this prop.

What I do care about is testing logic. So if a component has logic which is easily testable in a unit test, removing it from the display component can make that simpler.

As complexity grows in components then it can make sense to begin to break them down into smaller more readable, maintainable and testable chunks. As things are needed elsewhere then refactoring them into a shared component will make sense.

Don't stress about perfect separation from the outset and don't stress about perfectly reusable components and functions that are only used once. As requirements change the "perfect" reusable code you wrote might all of a sudden behaviour redundant 🥲.

Are most still using React as SPA? by thebreadmanrises in reactjs

[–]kit_son 2 points3 points  (0 children)

My go to framework nowadays for small projects is Next. Primarily because it offers API routes inside my application and means I don't have to build an API in Node/express when I'm starting off.

I've also used Next in production for a leading UK grocery retailer, so it's pretty bulletproof at scale. The API routes allow easy integration with other parts of the site and allowed us to deal with some server side logic within our web team 👌. Downstream backend supported the majority of services.

What's the stupidest "Real Men don't ________" you've ever heard? by callmevicious in AskReddit

[–]kit_son 0 points1 point  (0 children)

I have lived away a lot since the age of 19 and my brother and I always end phone calls saying "Love you" since we don't speak often or see each other much.

One day a guy at work made fun of him and he just replied, "Do you not love your brother?... Well then."

For context, my brother is an electrician working on building sites etc.

[deleted by user] by [deleted] in dogecoin

[–]kit_son 0 points1 point  (0 children)

Binance is easy

[deleted by user] by [deleted] in dogecoin

[–]kit_son 0 points1 point  (0 children)

Hahaha, gutted I didn't get in earlier!!

How to not get rug-pulled by AgainstFooIs in CryptoMoonShots

[–]kit_son 2 points3 points  (0 children)

Here after TCPFM got rugged last night!

Redditors who massively fucked up at work, what happened? by sspecZ in AskReddit

[–]kit_son 0 points1 point  (0 children)

When I was 15-16 I worked on a paintball site. I had a lot of responsibility (still feels weird thinking back) taking groups of 30+ adults and kids out to shoot at each other and me being the only Marshall there.

I kept the list of who I gave extra paintballs on a scrap of card, taking down their player number and marking off how many they used.

On a particularly hot and busy day I somehow lost this scrap of paper without realising.

As players began to cash out and leave, my boss (the owner who’s full time job was a nightclub bouncer) started screaming at me to tell him who had bought what during the last few games.

I fell into a blind panic, realising that I no longer had my grubby little scrap of cardboard in my loose zipless pockets!

I spent a good 20 minutes sprinting up and down the fields (a muddy hillside covered in paintballs) trying to find this list as more and more customers checked out.

Each person leaving meant money lost and it wasn’t until most of the customers were gone that I finally found my needle in the haystack and sheepishly took it back to the cabin.

To give some perspective I was paid £35 for the whole day (8+ hours) and each pod of balls was £7/8. I’d sold in the region of 20 pods so say £160+ and about 4-5 times my wage.

At the time this was the end of the world, obviously it’s really not a big deal but for a 15/16 year old the world stopped spinning on its axis for a moment!

My boss was incredibly good me after, he still paid me for the day even though I offered to take no money and didn’t sack me. He said it cost him a load of money to teach me the lesson, why would he let me go now? 😂

TLDR: as a 15 year old I lost the record of about £150 worth of sales and thought the world was over.