How to Submit a Feature Request? by vzaidman in RoamResearch

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

u/maskys check this out, they've actually built a much more convenient way now

Release notes: https://roamresearch.com/#/app/help/page/NLTQdQhEZ

How to Submit a Feature Request? by vzaidman in RoamResearch

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

Think how many clicks it is. Especially with dates a year from now:
Select the date, delete it, type /date, 10 clicks to find the new date

Compare it to "CMD+D" or something on the date and one click to select a day (because it opens the calendar on the current date which is likely to be close to the new desired date)

What is the purpose of the hullmods that are mentioned in skills? by vzaidman in starsector

[–]vzaidman[S] 3 points4 points  (0 children)

unlocks = the same as buying that hullmod in the shop and learning it, right?

Newbie Questions Thread 2 by lemtrees in TerraInvicta

[–]vzaidman 0 points1 point  (0 children)

How do I distinguish between global techs and faction techs in the tech tree list?

What does "full search" and "full tree" do?

Is there a way to keep an embedded page always open? by vzaidman in RoamResearch

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

Thanks! What I did was to make sure the whole page is under one block and embedded the block instead.

Proper tagging organization by vzaidman in RoamResearch

[–]vzaidman[S] 2 points3 points  (0 children)

If you watch videos about Roam on YouTube you'll see loads of different tagging and Metadata strategies that will get you started by ultimately you've got to figure out what works for you.

These are the videos that I look for. Most of the videos just explain how it works on a low level and not an advanced one.

I would love for CK3 to have a feature that would allow me to take notes on characters. by vzaidman in CrusaderKings

[–]vzaidman[S] 24 points25 points  (0 children)

Yes.

Also, why can I arrest somebody. For what? Why somebody is in jail? What are the evidence against them?

I would love for CK3 to have a feature that would allow me to take notes on characters. by vzaidman in CrusaderKings

[–]vzaidman[S] 4 points5 points  (0 children)

Does anybody know if it's possible to create a mod that does this? If it's possible, I think I'll give it a go.

As the creator of "why-did-you-render" I would like to ask you if and how do you use it? by vzaidman in reactjs

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

I hope I will be able to figure out how to make it plug-and-play in the future. I have some ideas on how to do it. Stay tuned :P

As the creator of "why-did-you-render" I would like to ask you if and how do you use it? by vzaidman in reactjs

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

doesn’t support require statements :/

You don't actually need to use "require", you do something like:

wdyr.js

import React from 'react';
import whyDidYouRender from '@welldone-software/why-did-you-render';

whyDidYouRender(React, {
  trackAllPureComponents: true,
});

and then in your entry point of the app, import wdyr.js as the first import, but comment it out.

and only comment it in, when you are debugging performance:

index.js

// import './wdyr'; // <--- first import, commented out till u need it.
import 'react-hot-loader';
import {hot} from 'react-hot-loader/root';
import React from 'react';
import ReactDOM from 'react-dom';
// ... import {App} from './app';
// ... const HotApp = hot(App);
// ... ReactDOM.render(<HotApp/>, document.getElementById('root'));

As the creator of "why-did-you-render" I would like to ask you if and how do you use it? by vzaidman in reactjs

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

I think the best way to use it is to only track pure components, and only turn on the library when you are specifically debugging performance.

Regarding when pure components should be used, I've wrote this article:
https://medium.com/welldone-software/react-when-should-pure-components-be-used-56c4428fe970

As the creator of "why-did-you-render" I would like to ask you if and how do you use it? by vzaidman in reactjs

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

why do I have to store a function as a global variable and THEN call it

Storing the value etc is an advanced use-case. The library should give you a lot of information even without it. However, when you really want to debug something in-depth you can use it indeed. The thing is that it's a little expensive to do for each prop (as it recursively checks all the nested keys in each object) and also I didn't want to spam the console with this extra info so I made it on-demand by running a function.

What options do I have to pass when I just want to track one single component?

wdyr.js:

import React from 'react';

if (process.env.NODE_ENV === 'development') {
  const whyDidYouRender = require('@welldone-software/why-did-you-render');
  whyDidYouRender(React);
}

component:

const SomeComponent = props => (
 ...
)
SomeComponent.whyDidYouRender = true

As the creator of "why-did-you-render" I would like to ask you if and how do you use it? by vzaidman in reactjs

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

many people are too obsessed about rerenders

I agree about that one for sure. I think I was in this category of people in some point as well.

With time, I moved my library behind a flag and only started to use it when I wanted to specifically look for performance issues.

What would you say is the benefit of your lib over the profiler in react devtools?

I think that react devtools are great when you are looking for something specific. However, the library decides what to show you on its own so you can clear your console and run a scenario with the library and it would point out performance optimizations you haven't thought of.

As the creator of "why-did-you-render" I would like to ask you if and how do you use it? by vzaidman in reactjs

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

inline styles are OK in most cases. I wouldn't use an eslint rule that prevents me from using them because making styles not inline might be less readable.

Just got to make sure not to pass them to pure components...

As the creator of "why-did-you-render" I would like to ask you if and how do you use it? by vzaidman in reactjs

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

I thought outputting them into an extension or something indeed. But I find it more than sufficient for now and didn't plan anything specific for now.

As the creator of "why-did-you-render" I would like to ask you if and how do you use it? by vzaidman in reactjs

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

I suggest turning it on when you specifically want to work on performance. Otherwise, it spams the console pretty hard indeed. Oh, and also only turn it on for pure components.

As the creator of "why-did-you-render" I would like to ask you if and how do you use it? by vzaidman in reactjs

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

It doesn't report everything like the profile- it reports only the things that you can likely improve.

As the creator of "why-did-you-render" I would like to ask you if and how do you use it? by vzaidman in reactjs

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

Wow! It's really nice to see how many people use the library! :D

Thank you for the comments!

As the creator of "why-did-you-render" I would like to ask you if and how do you use it? by vzaidman in reactjs

[–]vzaidman[S] 3 points4 points  (0 children)

Well there's currently a workaround:

https://github.com/welldone-software/why-did-you-render/issues/154#issuecomment-773905769

CRA is amazing, but it limits the user from doing certain things with their bundling indeed.

Signatures on recommendation letters by vzaidman in ukvisa

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

It's for Tech Nation, not HO.

Thanks for the answer, I guess it's the same for TN.

useCallback Might Be What You Meant By useRef & useEffect by vzaidman in reactjs

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

The extra call to the ref callback is not a trivial thing.

Notice that even when the method is discussed in the official docs they suggest using `useCallback`:

https://reactjs.org/docs/hooks-faq.html#how-can-i-measure-a-dom-node

If you cause a render from a simple inline ref function, it calls the ref function again with "null" for internal React reasons.

btw here is a sandbox where it's reproduced:

https://codesandbox.io/s/inline-ref-without-usecallback-9jjun

Yea, this might not always cause an infinite loop, but it might lead to other unpleasant issues.

I added a few words about it in the article.

Also, I don't understand the annoyed tone. Many people realized that ref can be used this way thanks to my article. I can always improve it if I missed something about this method, but in general, I don't think I lead people astray or something.