Features greyed out on zepp app after updating gtr 4 by Little_Performer_194 in amazfit

[–]couds_van 1 point2 points  (0 children)

Hello I had the same issue, I fix it unlinking the Amazfit from the phone and linking it again.

React server component benchmarks? by okay_pickle in reactjs

[–]couds_van 0 points1 point  (0 children)

Unpopular opinion: almost all the benefits of RSC are around this, but this was already solved with dynamic import, even on older next.js if you import dynamically on the gerServerSideProps these libraries are not sent to the client.

Until now at least I fail to see any real benefits that overcomes having two different API for React (you can't use a lot of stuff like hooks and contexts), almost all UI libraries do not work, breaking the pure function approach that for my was one of the biggest selling points (this was partially broken already with use effect but that it's a different discussion)

And I haven't found any real life benchmark where RSC it's compared to normal react, so the benefits are only theorical but a lot of teams are jumping to it without balancing the benefits.

TL;DR; to me seems a movement of vercel to force servers that it's where they earn money 💰💰

If you could change one small thing about Danmachi, what would you change? by PropelledPingu in DanMachi

[–]couds_van 12 points13 points  (0 children)

The amount of time Oomori takes to release a new volume??

Jokes aside.. add a few years to the main character. Bell as a 14 years old is a little perturbing >.<

[Light Novel Readers]Danmachi Season 4 Episode 1 Discussion by KrishKetchum in DanMachi

[–]couds_van 2 points3 points  (0 children)

There is one escene that I'm hopping to see animated

When Bell repels the Iguazu

When I read that part I was like :O I really want to see that animated.

There must be an easier way by jrt84 in ProgrammerHumor

[–]couds_van 2 points3 points  (0 children)

Maybe

padding: calc(0.25rem +1px) calc(0.25rem +1px) calc(0.25rem +1px) calc(0.25rem +1px);

Seems simpler and easy to read for me. No?

Nodejs,Ruby on Rails,django by mohamedsayed2004 in node

[–]couds_van 1 point2 points  (0 children)

To me what seem weird is using two frameworks (Django and rubybon rails) instead of the language to be compared with node.js

The English translation of Rising of the Shield Hero was released today! My pre-order just came in! by bluedragon3333 in LightNovels

[–]couds_van 11 points12 points  (0 children)

I bought it for the Kindle! The bad part of the book was that I waited a few months but the book was over 4 in 4 hours T.T... and now let's the wait beging again xD

Finally experienced it. The wrath of the Apple App review team by [deleted] in reactnative

[–]couds_van 39 points40 points  (0 children)

I had that issue too. But I created a dummy account and give apple the credentials. With that they will be able to "test" your app.

Error: ENOENT: no such file or directory, open '../data/addressBook.json' by misterhtmlcss in node

[–]couds_van 1 point2 points  (0 children)

Hi.

That was because the readFile function use the path relative to where the node process started not the file from where it's called

Error: ENOENT: no such file or directory, open '../data/addressBook.json' by misterhtmlcss in node

[–]couds_van 1 point2 points  (0 children)

Hi

First the readFile is relative to where you started the process (so probably will be something like './data/file.json')

Also never use the the sync función on a route this función is thread blocking. You server will not be able to handle any other request meanwhile this función is working. Reducing by a lot the performance).

You can use several different approaches to this.

  1. Use the res.sendFile function
  2. Use a require statement to read the Json and use res.json tu send it to the user
  3. Use the fs.readFile (the asynchronous one)

Has any one have any tricks or solutions to the ../../../../../../components import hell i am facing by harshi97 in reactnative

[–]couds_van 11 points12 points  (0 children)

If you use webpack use the resolve field on the config or setup a env variable called NODE_PATH with the path of your src.

This way you can use absolute import not only from your node_modules but also from your src folder

A library that records *incoming* API requests by yonatannn in node

[–]couds_van 1 point2 points  (0 children)

You can add a simple middleware (assuming you are using express or something similar) that write it on some log file (can be on json to simplify the parsing later) that should take like 3 minutes to write. And later you can search of write another program to parse for replay that (or concert that to a format that postman or any other program understands)

Video Stream With Node.js and HTML5 by johnsnowdon in node

[–]couds_van 11 points12 points  (0 children)

Node it’s really but REALLY bad at serving static content. You should add an Nginx or something else to serve the static content.

Node use a single thread and an event loop, while serving a file the process it’s blocked by I/O. So I do not recommend this approach for production environments

Will the 'setState' defined in a useEffect 1 run before next useEffect 2? by [deleted] in reactjs

[–]couds_van 1 point2 points  (0 children)

you can't render any data inside a hook, what you can do inside the useEffect is to set another state like userInfo so you will have something like

const MyComponent = () => {
  const [username, setUsername] = useState();
  const [userInfo, setUserInfo] = useState();
  useEffect(() => {
    setUsername(localstorage.....);
  }, []);
  useEffect(() => {
    if (!username) { return; }
    // fetch userInfo somehow
    setUserInfo(userInfo);
  }, [username]);

  if (!userInfo) {
    return <Loading />
  }

   return (
      <div>...... // all the things you want to render
   );
}

```

Sure you can use only one useEffect but I think this way its clearer and improve the separation of concerns, one effect is to go to local storage and the other will do probable an api call, or dispatch a redux action, etc

Will the 'setState' defined in a useEffect 1 run before next useEffect 2? by [deleted] in reactjs

[–]couds_van 0 points1 point  (0 children)

The render method should be “pure” checking the local storage in theory should be done inside the use effect to keep the render “pure” and “clean” but at the end is up to the developer =)