question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if youā€™re still stuck at the end, weā€™re happy to hop on a call to see how we can help out.

Question about re-evaluation strategy

See original GitHub issue

This looks like a very nice library, congratulations!

I was wondering, suppose a component reads a.b.c from tracked state a. Suppose a new state a is reduced, and a.b also ā€œchangesā€, but a.b.c remains the same. I guess in this case the component will not re-render? In other words, to determine if a component should re-render, you always compare the leaf nodes of the dependency tracking graph?

Is this reasoning correct?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ziriaxcommented, Jan 17, 2020

Thanks for your feedback! Iā€™ve been thinking about it, and I my gut feeling says your approach is valid.

1reaction
dai-shicommented, Sep 17, 2019

New ideas/insights are generally welcome. šŸ˜‰

But I guess you canā€™t know this.

Yeah.

One possible misunderstanding you and maybe others might have is that it doesnā€™t stop tracking for child components. This is very unique to this library (more precisely the family of my libraries: This, [1] and [2]). Technically, we canā€™t know when render function ends. React doesnā€™t provide such a feature. So, I rather keep tracking foreverā€¦ This means it will keep tracking even with the inside of <Foo x={abc}/> or <Bar x={abc} y={ab}/>. In other words, most likely the leaf nodes are primitives like strings and numbers. The exception is probably memoization and maybe some others. It does best to work with memoization but there must be pitfalls. Iā€™d love to get feedback from everyone.

The current approach and implementation should be pretty good. I spent quite a long time to reach this point. I can say itā€™s almost optimal, meaning a good trade-off balance between the usability and the performance.

If thereā€™s a practical use case this approach doesnā€™t work, I will reconsider and maybe tweak it (or gave up such a use case). So again, any example to break this tracking approach is welcome, preferably practical ones instead of hypothetical ones.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Specify the key evaluation questions - Rainbow Framework
Process evaluation. How is the program being implemented? Ā· Outcome evaluation (or impact evaluation). How well did the program work? Ā· Economic evaluation...
Read more >
Asking Program Evaluation Questions
Developing program evaluation, process evaluation, baseline questions, American University Adjunct Professor Allyson Krupar discusses how to ask.
Read more >
Suggested Strategic Assessment Questions - OPM
Below are a few useful strategic assessment questions to help you develop an effective plan of action both short and long term. ā€¢...
Read more >
8 Key Questions for Evaluating Your Strategic Innovation ...
1. Does this opportunity create differential value for the business, our customers, and our stakeholders? Ā· 2. Is this opportunity uniquely ā€œĀ ...
Read more >
Strategy Evaluation Process: Comprehensive Guide + Examples
Typically, the strategy evaluation process involves answering questions such as: How much progress have we made towards our Vision?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found