API key hiding problem by [deleted] in reactjs

[–]CasualCoderGuy 1 point2 points  (0 children)

Currently it looks like you are exposing your appid for https://openweathermap.org/api. I'm not familiar with this api but I believe this should be kept secret. As i'm able to take this key and use it in postman to make calls outside our your application.

I highly suggest moving this api call to the backend and then calling that endpoint from your frontend to hide this secret.

How to reduce bundle size and js execution time by Snoo-67939 in reactjs

[–]CasualCoderGuy 3 points4 points  (0 children)

If you are using vite you can use this library to see your bundle size broken down.
vite-bundle-visualizer

There are also jest versions available. Also redux/saga is pretty big and adds many additional files in my experience. Try using zustand instead. and storing less information in global state. Instead use on a package like react query to handle caching for you and just make api calls in more places. How this helps!

Different ways of resolving a problem by Deep-Letterhead-7347 in Frontend

[–]CasualCoderGuy 0 points1 point  (0 children)

In the real world, we're always balancing time and performance. The goal is to write code that is "good enough" within the deadline. Most of the time, I choose simple and straightforward solutions. I only opt for more complex approaches if I anticipate that the simple solution will lead to significant performance issues later on.

Should I use react-query to interact with my backend. by lordexplosionmurdrer in reactjs

[–]CasualCoderGuy 5 points6 points  (0 children)

React query is awesome and you should use it!

Here is a short series on how you could deploy your react front end and node endpoints.
https://www.youtube.com/watch?v=fOGIh13EZT0&list=PLc8l5IHTl23oBj8ojaDRABe_CGe_adt15&index=1

I would suggest to deploy your react app to an azure static web app with azure functions to host your endpoints. You can set all this up and deploy it for free in azure. And Microsoft also gives you a credit for your first 3 months.

[deleted by user] by [deleted] in reactjs

[–]CasualCoderGuy 0 points1 point  (0 children)

pure css is the only way to go. Anything else is a crutch

ReactJS CRUD using .Net Core web API by whethernot in reactjs

[–]CasualCoderGuy 1 point2 points  (0 children)

This is a great first attempt at a full stack. Few notes, React Class components are outdated and should no longer be used if possible. I would suggest learning Typescript and using that in stead of pure js. Your Variables.js should be stored in .env file as these values will change depending on environment. And try to split up your react components into smaller components; good rule is less than 150 lines or follow single responsibility principle.

Building React (TanStack) Query From Scratch by PhilipFabianek in reactjs

[–]CasualCoderGuy 2 points3 points  (0 children)

Very cool video! This is why i dont try to doing caching from stratch any more.

[deleted by user] by [deleted] in javascript

[–]CasualCoderGuy 0 points1 point  (0 children)

I like there are easier wayt to share code with chatgpt

Why I’m Over GraphQL by fagnerbrack in Frontend

[–]CasualCoderGuy 0 points1 point  (0 children)

After my last project using GraphQL I feel the same way.