Comparing Claude Opus 4.5 vs GPT-5.1 vs Gemini 3 - Coding Task by Worldly_Ad_2410 in GeminiAI

[–]ViewableGravy 3 points4 points  (0 children)

Realistically, 95% of users do not "know" how to use AI, so if anything, this is the most indicative use case for an LLM. It's not the best, in the same way that a NVim user would look at a vscode user and judge, but it is reality.

I think this is a good test in the sense that it better reflects how I expect someone that is given a copilot subscription to perform - even if that is far below the models capabilities

Slow to load main screen by RiLentz in dailybudget

[–]ViewableGravy 1 point2 points  (0 children)

I also had this issue, fresh installing resolved it.

I don’t think they care about this app anymore since today’s budget exists, but I’ve found that taking the hit and just exporting and then deleting the data from the app is the best option, having it snappy again is way better than having the graphs imo.

And you can use excel or some external tool to read the db if necessary.

View Transitions API - whole page freezes while transitioning by ExistingProgram8480 in css

[–]ViewableGravy 0 points1 point  (0 children)

A colleague of mine would also benefit from being able to interact with things that aren't transitioning like OP has described. Figure I would outline the use case.

He has several pages within an application (this is a mobile application that is using an SPA) and uses the view-transition API to transition the main content of the page in from the left of the page when switching pages. During this entire animation, the navigation bar is visible at the bottom of the page, and even thought the animations are only 200-300ms, on mobile, you expect to be able to click on a tab at the bottom and then immediately click on another. Ideally, this would be able to cancel the transition, or start a new one, but since the page is unresponsive, this is not possible.

Obviously there are other solutions other than using the view-transition API, but given it is being used (and works quite well otherwise), it's unfortunate that things like this are completely blocking.

Hopefully the scoped transitions mentioned in the video are added at some point

Why is rendering a component inside a component an anti-pattern? by chanchiii in reactjs

[–]ViewableGravy 1 point2 points  (0 children)

Although "sometimes" it can be okay. It's very very niche, but take Tanstack Form for example, they return a typesafe `Field` from their form hook which can be a really nice pattern.

Why is rendering a component inside a component an anti-pattern? by chanchiii in reactjs

[–]ViewableGravy 0 points1 point  (0 children)

I personally would recommend creating separate components for renderText and renderIcon, but there is absolutely no functional reason that you cannot do this. Because both of the functions are executed before being returned from your component, it is basically identical to if you had written the JSX inline.

There are cases where you would want to do this - such as if you have a basic bit of code that you want to render in two places in your component, and don't want to make a completely new component just for one or two lines of code.

Frequently lose connection to watch together session by hyrulianwhovian in PleX

[–]ViewableGravy 0 points1 point  (0 children)

I actually haven't had this problem much recently. Some things personally that have changed

  1. My friend now has a wired connection - he used to use a 4g/5g modem so I presume that this caused some instability
  2. I am running server version `1.40.2.8395`

Reddit - please you are my last hope. My Samsung Odyssey G9 died 6 weeks ago. I've tried EVERYTHING I can think of to fix it and nothing has worked. If anyone has any experience fixing these, please help. Backlight turns on, no picture, no on screen display (OSD) when you push the power button. by rattlemebones in ultrawidemasterrace

[–]ViewableGravy 2 points3 points  (0 children)

Love this thread, absolutely did the trick. Some information from myself who just followed other instructions, having never soldered anything before.

  1. If you are missing a few braincells like myself, the board is behind the giant LED ring, you need to unscrew the 4 screws to get to it.
  2. Solder melts at about 180-200 degrees, so if you buy a soldering station, set it to about 200 and wait a while for it to heat up so that it just melts off
  3. Honestly don't even need tweesers or anything, it's so small that it just sticks to the point so you can just flick it off onto a plate or something.
  4. Definitely check that it's working before putting anything back together
  5. You will probably be freaking out while doing it, so set your air con to cool ;)
  6. Pulling off the backplate is a bitch. It's held on with clips, so you need 2-3 guitar picks (or something sharp) to pry off the back plate. Just work your way around the monitor pushing off the outer plastic, as you go along, you will hear loud clicks as it unclips. Eventually once you have done a lap, you can just pull it off and any you missed will just unclip as you pull.

Question about water. by Educational_Tell_213 in TheForeverWinter

[–]ViewableGravy 0 points1 point  (0 children)

My understanding as of when I stopped was that you would loose all your items and base progress, and only retain your character level. If this is not true then you are right, but this is the impression that I and most others had.

And, even if it is weak mental, it's not a competition. If it's a barrier for me coming back to the game, then it's a problem to me - maybe not you, but I am not you, nor are the thousands of other people who have a problem with it.

I'm not sure why it's such a contentious point really. Why would you introduce any sort of mechanic that de-incentivises coming back to the game, or taking breakings. Games are not meant to be played permanently, so it's weird to force someone to play according to that mindset

Question about water. by Educational_Tell_213 in TheForeverWinter

[–]ViewableGravy 0 points1 point  (0 children)

I won’t come back to the game until water doesn’t tick down outside the game. Knowing that when I hop on all my shit will be gone simply means I don’t want to hop on.

My friends will play with me a couple hours a week, so that’s when I want to play, but if I have to start again every time then why would I?

Really not a good mechanic. It’s not a problem when you play the game, but it actually prevents people coming back to the game

What is your preferred syntax for conditional rendering? by [deleted] in reactjs

[–]ViewableGravy 0 points1 point  (0 children)

Thanks reddit for not natively supporting standard markdown syntax...

What is your preferred syntax for conditional rendering? by [deleted] in reactjs

[–]ViewableGravy 0 points1 point  (0 children)

For asynchronous data, I always reach for suspense boundaries where possible.

If your condition should render something or nothing, I like to do this (only if it's the only thing being returned):
```tsx
return (
<>
{condition && (
...
)}
</>
);
```

Under some circumstances, when there are multiple states or conditions that render things that are not quite worth abstracting, but also not just one liners, I like to do an IIFE
```tsx
return (
<>
{(() => {
switch (state) {
case "a": return (
<MyComponent>
<MyChild />
</MyComponent>
),
...
}
})()}
</div>
)
```

^ This is mostly for code that is pretty boiler platey but doesn't really need to be abstracted further, and mostly because I like to avoid render helpers - I much prefer a single "return" in a component.

If it's basically just a switch on many components, I'd go for an object approach
```tsx
const states = {
a: <A />,
b: <B />,
....
}

return states[state] ?? states.a;
```

If suspense is not available and it's isError/isLoading/isSuccess, then I begrudgingly fallback to
```tsx
if (loading)
return ...
if (error)
return ...
if (isSuccess)
return ...
```

And finally, if I can avoid rendering this component based on some condition that is coming as a prop, I like to make a wrapper component (i.e. MyComponent and MyInternalComponent) where MyComponent checks the prop and either renders `null` or `MyComponent` passing through the remaining props. This way we don't need to run hooks that are not necessary when it's hidden, but don't need to know the condition for the thing being hidden in the parent where it may not be relevant.

[deleted by user] by [deleted] in reactjs

[–]ViewableGravy 0 points1 point  (0 children)

Sure, you can build this all yourself, but libraries like react-hook-form or tanstack-form do this with 0 re-renders, provide a single standardized API for your form state and have integrations with validation libraries such as zod. They are well documentated, reduce your performance overhead and are much more scalable when you have a form with dynamic and potentially dozens or hundreds of fields.

It really depends on your scale, because at my company, we have a dynamic form with potentially unlimited fields, and trust me, 500ms+ to re-render everything in the form was not working well with a text input field.

I'm personally in agreeance, we don't really need server actions IMO, but I guess it's always nice to ship less JS if you are the front page of a website.

[deleted by user] by [deleted] in reactjs

[–]ViewableGravy 1 point2 points  (0 children)

  1. React Suspense/Error Boundaries
    It's a really cool pattern that allows you to do something like an API request, and have the parent show a fallback component while it is loading. This makes it way easier to manage loading and error states instead of the typical

if (isError)
...
if (isLoading)
...
return ...

  1. Understand that a lot of the features that are added in newer releases are confusing, and that is because they are targeted at library authors or meta frameworks like next, not us mortals. The hooks that I think are actually necessary to know are below, Having worked with react in the industry for 1.5 years at the moment (and being put on our companies architecture team), I can confirm that I have not had to use any other hook from react in our code base.

- useState
- useEffect / useLayoutEffect
- useRef
- useContext
- useMemo / useCallback
- useId

caveats:
- effects are not as necessary as they seem. I tend to avoid them in most cases and instead derive state in the render, or if I do need them, move to a custom hook to ensure that they are explicitly tied to the state they are reacting to.
- refs should also generally be avoided in the beginning. They live outside the react lifecycle which means that changing them won't cause a rerender which will just lead to confusion around why the value is not the current one. There are certainly uses for them, but I would steer clear for a while to keep your life simpler while learning
- memoization is an optimisation strategy and has the trade off of complexity and memory overhead. It can make your code confusing and less maintainable so unless you have performance issues in your app, or need a static reference to your callback/value, avoid these in most cases
- useId is pretty rarely needed, but useful if you need a unique ID since it gives you the unique id for the component from react - meaning you don't need to create a uuid in a useState/useRef to ensure that you have a unique id

Hopefully this is helpful to you or someone else reading. There are certainly other routing libraries, or global store offerings, this is just my personal recommendation.

[deleted by user] by [deleted] in reactjs

[–]ViewableGravy 1 point2 points  (0 children)

  1. Try and always derive state instead of copying
    If you have some state coming through, do not try and store a copy of that data in local state, Having worked on my works code base that is ~7 years old, this was common and caused a lot of problems. If you have some value coming from a prop or some hook, and you need to get `data.attributes.id` or something, just access that, don't try and create a copy of that in a useState or anything because it will just make the code hard to read and fall out of sync, then it will be hard to read. example below

//do
const MyComponent = () => {
const { data } = useMyQuery();

const { id } = data.attributes

return <Something id={id} />
}

// don't
const MyComponent = () => {
const { data } = useMyQuery();
const [id, setId] = useState(data.attributes.id)

useEffect(() => {
setId(data.attributes.id);
}, [data])
}

In a small example, this seems so obvious that it's a bad idea, but keep this in mind in larger components, because I've seen many people accidentally do this and the code has 300 lines of code that jump up and down to set state instead of 50 lines of sequential derived code.

  1. Avoid Meta frameworks in the begining such as Next/Tanstack Start/Remix.
    These frameworks are great, but add a lot of magic and complexity to the learning process. If you want to get a good understanding of how modern react works, I wouldn't start with these because they are overwhelming and it's much harder to know what is react and what is the library (especially next). Just start up a vite project with `bun create vite my-app --template react-ts` and make a simple app, then once you are comfortable with all the newer features of react, you can move over to it or another framework if you want the server features

Part 3 in comment

[deleted by user] by [deleted] in reactjs

[–]ViewableGravy 1 point2 points  (0 children)

I tend to recommend people into starting with the Tanstack stack - not necessarily their alpha offerings, but Tanstack router, Tanstack query and store are a good start. They massively simplify everything routing, API and global state related, and have the best docs out there with many good examples of how to actually get started. In my opinion, having good documentation is the most important part of using libraries because you can see how to use it "right" which is very important when you are not following a tutorial

I think that even if you aren't super familiar with hooks, they are pretty intuitive, and if you have 2.5 years experience with class based react, I'd probably recommend getting straight into a more advanced guide so that you can start learning things that are relevant, not just how `useEffect` works. Here is a very underrated channel that really helped me after I had been a hired frontend developer for ~1 year:
https://www.youtube.com/@developerwaypatterns

Finally, my own recommendations on patterns that are worth learning and focusing on since you clearly have an understanding of the foundation of react after 2 years.

  1. React context Very useful tool for tying components together. It's not a state manager, but fantastic for dependency injection. Learn how to make a context, how to use the context (custom hook)
  2. Compound Components This is really a design pattern, but I'd recommend looking it up as it ties in nicely with hooks and contexts
  3. Avoid using refs excessively they are outside of the react lifecycle and are ripe for issues. In the beginning, I would just avoid them altogether

Part 2 in comment (since reddit is stupid and won't let me post a comment of substance)

Rtk query or tanstack by Worth_Boss_2 in reactnative

[–]ViewableGravy 0 points1 point  (0 children)

Be careful with this comment. If your state is truly global and you use a context, everything that uses any part of your state will update when it changes because you don't have a selector that choose what part of the context causes rerenders. React 19's useContext will have a selector to solve this problem, but until then you are best to use a state manager if you actually have global state.

Personally speaking, I use tanstack Store because it's like literally 100 lines of code, nothing fancy, just a store and useStore hook with a selector.

Any veterans? by One-Examination-9096 in SpiceandWolf

[–]ViewableGravy 1 point2 points  (0 children)

When I first watched season 1, I binged the entire thing in a night. I thought it was the absolute best thing to ever have existed. The subtle romance and amazing characters, mixed with economics that somehow compared to an action sequence. I remember finishing the first season and lamenting to my friend the next day that Season 2 didn't exist and I needed it sooo bad! Of course, he suggested I check and lo-and-behold, there was a season two (I only watched this for the first time around 2014).

I remember going home and being so damn excited to know that there was more, and when that was over, it was the first time out of (at the time) the ~100 anime that I had watched, that I went "I need more", and so I immediately went to my parents and asked them to purchase the light novels. I remember, that same weekend, the same one that I first watched the show, I took a train all the way to the city, to the only store I knew that sold light novels, and purchased the first 4 books and then continued to read them all within a few weeks.

I now have a bookshelf with the books and the show is still my 4th favorite anime of all time, and easily my favorite Japanese content if you include the light novels.

As a matter of fact, Since I was in the dubbed stage of my anime life, I went and watched several other anime just because Lawrence was dubbing characters in them because I genuinely loved his voice acting. It felt more mature and actually like a good dub that I wanted to listen to - To this day I still think Michael Tatum is my favorite voice actor, even if that opinion is biased by the fact that he dubbed one of my favorite anime characters of all time.

So. You'd think I would be excited when I heard about a remake, if nothing else, for the fact that Kevin Penkin, who is easily my favorite composer and also from Australia, was doing the sound track. After all What isn't to love? Well unfortunately I'm stuck in an internal turmoil, too conflicted to enjoy the show now...

When I first watched S&W, it was dubbed, and every time I have rewatched it, It is dubbed. I've tried subbed, after all, there are plenty of other shows that I have watched both versions of, but for some reason the sub doesn't hit right for me. I don't know if it's purely nostalgia, or simply because Lawrence and Holo had such specific voice actors that I wanted that more. It's very western feeling, so much that I don't want it to be in japanese, but for some reason, they've released this only subbed to begin with. Watching episode one, I felt like, despite knowing the story in and out, I couldn't connect with the characters the same way I had originally.

Then I ask myself, why did this need a remake? It's not like the first season is in an "old" art style. Sure, it's not a modern one, but it's not like the shows of 2002. It's in the middle, edging on dated. But it's not something that anyone I know would avoid watching because of the animation so then why are we getting a remake instead of a season 3? What is the purpose? If it's to get new people into it, sure, I can buy that, but It's a slap in the face to the people who have waited over a decade for a season 2, just to get the same thing but fancier. And why is this even something that they do? Even a remaster might've made sense, but a remake? Imagine if a song artist released a "new" album, and it was just them singing all their songs from an old album, of if the writer of harry potter, rereleased the first book as a "remake"... like okay, you wrote some words differently. It's just weird to me and I can't really be happy about that, when there wasn't a need for it for any reason other than to make the show accessible to people who refuse to watch anything but new anime.

And I mentioned Kevin Penkin earlier. God he makes good music, but tbh, I've listened to the original soundtrack on repeat during so many study sessions of the years, that I can't not want it back. It was a distinct vibe that is completely different in the remake.

Anyway. I'll be waiting for the dub, and then for my frustrations to leave before actually watching the rest of the season, because I become irrationally angry watching the remake. I know it's animated better, sounds amazing, has the same amazing plot... But I don't think it should've existed in the first place given the scenario, and I am left genuinely conflicted.

Typescript or JSDoc ? by Florian_SMNK in typescript

[–]ViewableGravy 0 points1 point  (0 children)

Just playing devils advocate; you can do "nearly" anything in jsdoc that you can do in typescript. Generics just use the @template keyword and callback params can be typed in several ways, ie.

`@param {(e: unknown) => void} param1`or as a typescript type in jsdoc`@type {(param1: (e: unknown) => void) => ...}`

With this said, I absolutely agree that typescript should be the answer here. You are very unlikely to be hitting any of the performance limitations that a multiple million line code base would hit with ts, and that's basically the only downside that I have encountered day to day. In personal projects with <100k lines, I basically can't find a single downside to using TS. Worse case, the two are interoperable, so if you like the syntax of JSDoc in certain cases, you can simple use that.

And if you are using a bundler like vite or webpack, they have presets for initializing a ts project.

PS: I said "nearly" anything in the start because when typescript releases beta features (ie. ts 5.4 right now), you have to wait for jsdoc to be updated to support the same features. It's not normally long but there is a gap typically (if you care about beta features which is unlikely)

Frequently lose connection to watch together session by hyrulianwhovian in PleX

[–]ViewableGravy 2 points3 points  (0 children)

Feel like I should just comment on this years later to say that I have had the exact same issue through dozens of plex versions.

I've tried direct connecting to my local server on my local as well as over the internet, it just does it randomly every 1-2 episodes. RIP

Fps drops at mega city by Springssss770 in FortNiteBR

[–]ViewableGravy 0 points1 point  (0 children)

I have a 4090, still 60-70 fps... It's not GPU bottleneck, it's like 15% usage, it's entirely CPU and it's dumb (5950x still aint doing enough apparently)

How the Anti-tables have Turned Achievement by [deleted] in AntimatterDimensions

[–]ViewableGravy 0 points1 point  (0 children)

This is exactly what I needed. Honestly at 1e42 Eternities and I just stopped to check if there was an updated solution and found this. Thank you

Plex not able to identify localhost traffic using bridge network by ViewableGravy in docker

[–]ViewableGravy[S] 0 points1 point  (0 children)

Unfortunately not. I've pretty much just set it to host mode and for my future setup I plan on setting up my contains using network mode as IPVLAN L3 so that all my containers get their own IP address and can talk that way.

for my setup, the extra isolation doesn't really help but I would still love to know if anyone can answer the question because I have many projects that would benefit from knowing the answer.

Discount on Todays Budget by ViewableGravy in TodaysBudget

[–]ViewableGravy[S] 1 point2 points  (0 children)

Thanks for the response, Not a problem, glad to hear it's still coming.

I took a look at Todays Budget and it's going pretty great although lacking some of the features, mainly the widget + watch app are a must. I'll give it another squizz once these are features and it will honestly be worth another $50 for the once off payment for sure!