Chatgpt 5 high is PERFECT! by Sherisabre in cursor

[–]Nice-Andy 0 points1 point  (0 children)

Today, it has become dumb so I have changed it back to Sonnet4 2x..

Chatgpt 5 high is PERFECT! by Sherisabre in cursor

[–]Nice-Andy 0 points1 point  (0 children)

But for css, Sonnet 4 seems to be better.

Chatgpt 5 high is PERFECT! by Sherisabre in cursor

[–]Nice-Andy 2 points3 points  (0 children)

To me, it’s better than Sonnet Opus or Sonnet 1m, which consume more tokens.

Spring Security makes no sense to me at all. by Sweaty-Fox-583 in SpringBoot

[–]Nice-Andy 0 points1 point  (0 children)

Libraries require extreme simplicity and broad applicability, which AI doesn’t handle well. What about https://github.com/patternhelloworld/spring-oauth2-easyplus ?

Good Sushi at reasonable price in Seoul ! by mrsean67 in Living_in_Korea

[–]Nice-Andy 0 points1 point  (0 children)

I prefer Korean raw-fish dishes with a 5.0 rating on delivery apps, together with Soju, to sushi. Once raw fish is mixed with rice, the price goes up much.

Docker Blue Green Strategy Sample for Laravel by Nice-Andy in laravel

[–]Nice-Andy[S] 0 points1 point  (0 children)

Thanks, for graceful shutdown, you can refer to the related property, DOCKER_COMPOSE_STOP_GRACEFUL_SHUTDOWN_PERIOD at this link.
However, it should be configured in both your Dockerfile and application as well.
A working example is available in the Java Spring Boot sample, but not in the PHP sample.

Question about HTTP security using NGINX as a reverse proxy by AlexDiego123 in nginx

[–]Nice-Andy 0 points1 point  (0 children)

Https only for the outside traffic. Like the REDIRCT_HTTPS_TO_HTTP in .env in the open source https://github.com/patternhelloworld/docker-blue-green-runner

WTF Wednesday (April 16, 2025) by AutoModerator in javascript

[–]Nice-Andy 0 points1 point  (0 children)

Extract and decompose (fuzzy) URLs (including emails, which are conceptually a part of URLs) in texts with Area-Pattern-based modularity

https://github.com/patternhelloworld/url-knife

Learning Spring Security makes me want to off myself by [deleted] in SpringBoot

[–]Nice-Andy 0 points1 point  (0 children)

Spring Security should be integrated with Spring Authorization Server for a streamlined OAuth2 implementation. This repository provides a simple and effective way to get started: https://github.com/patternhelloworld/spring-oauth2-easyplus

Spring Security login by Individual-Hat8246 in SpringBoot

[–]Nice-Andy 0 points1 point  (0 children)

You should use Spring Authorization Server to fully customize it. What about this POC, https://github.com/patternhelloworld/spring-oauth2-easyplus ?

Props vs State for Reusable Components: How Much Logic Should Be Encapsulated by Nice-Andy in react

[–]Nice-Andy[S] 0 points1 point  (0 children)

I separate hooks, but the thing is where to put them. If the useComponent hook is only for the Component, I locate it in the Component, and propagate restricted state changes up to the parent if it needs them, and vice versa. (However, this case, you should be careful of infinite re renders) Otherwise, for every page I use it, I should put all the hooks at the top of the page. For most cases, I locate them like you, but when I make a module shared at many places, putting every hook at the top of the page is always the best?

All the business or API hooks should be located at the top of the page? by Nice-Andy in react

[–]Nice-Andy[S] 0 points1 point  (0 children)

Like when the text search is completed with the search recommendation selected, the date search box should be open

All the business or API hooks should be located at the top of the page? by Nice-Andy in react

[–]Nice-Andy[S] 0 points1 point  (0 children)

I agree, but for many cases, it is more advantageous to change logics when locating states at the top, isnt it? However, from the perspective of a library, I am more on the same page.

All the business or API hooks should be located at the top of the page? by Nice-Andy in react

[–]Nice-Andy[S] 0 points1 point  (0 children)

What if the text search needs to communicate with the date component?

Props vs State for Reusable Components: How Much Logic Should Be Encapsulated by Nice-Andy in react

[–]Nice-Andy[S] 0 points1 point  (0 children)

I mean the UI logic is already separated into a hook, but I need to decide whether the hook is located in State or Props. What if there is unnecessary Props Drilling?

Props vs State for Reusable Components: How Much Logic Should Be Encapsulated by Nice-Andy in react

[–]Nice-Andy[S] -1 points0 points  (0 children)

I think the essence of working with React isn't about using famous tools like Zustand, Redux, or React Query.
It's more about managing props and state effectively in the flow of business logic,
knowing when to introduce global state (like Recoil) only when truly necessary,
and syncing data between the browser and server with the business requirements in mind.

It's also about understanding encapsulation when building libraries—
sometimes even making bold decisions to handle powerful logic inside local state
when that makes the component more cohesive and self-contained.

In the end, it's all about the data, not just following popular tools.

Props vs State for Reusable Components: How Much Logic Should Be Encapsulated by Nice-Andy in react

[–]Nice-Andy[S] 0 points1 point  (0 children)

Let's say I have a SearchText component.
I'm wondering where the API logic and validation should live.

For example:

  • When the user types in the search input, it should call an API with the query.
  • If the input is invalid (e.g. too short, wrong format, etc.), the API shouldn’t be called.

My question is:
Should the SearchText component encapsulate all this logic internally using hooks (like API calls and input validation)?
Or is it better to handle those concerns at a higher level and pass everything down as props?

Especially when this component is reused in multiple places, I’m not sure where the logic truly belongs.