<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Pavel Kepka on Medium]]></title>
        <description><![CDATA[Stories by Pavel Kepka on Medium]]></description>
        <link>https://medium.com/@kepka?source=rss-34ec0cf11296------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*D_EyhlMXgQ9cTYMC.</url>
            <title>Stories by Pavel Kepka on Medium</title>
            <link>https://medium.com/@kepka?source=rss-34ec0cf11296------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 05:50:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kepka/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Jak jsem se seznamoval s React Fiber]]></title>
            <link>https://medium.com/blueberry-cz/jak-jsem-se-seznamoval-s-react-fiber-7f55e06487b1?source=rss-34ec0cf11296------2</link>
            <guid isPermaLink="false">https://medium.com/p/7f55e06487b1</guid>
            <category><![CDATA[fiber]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[fail]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Pavel Kepka]]></dc:creator>
            <pubDate>Tue, 19 Dec 2017 09:17:14 GMT</pubDate>
            <atom:updated>2017-12-19T11:20:24.505Z</atom:updated>
            <content:encoded><![CDATA[<p><em>aneb historie jednoho neúspěchu</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dvZ_D83MjEiR283LQjFhSg.png" /></figure><p>Je to pár týdnu zpátky, co jsem měl přednášku na téma React Fiber v rámci Blueberry MeetUpu. Fiber jsem si vybral úmyslně, protože na zmíňky o něm narážím poslední měsíce téměř neustále. A co je ještě důležitější, <a href="https://reactjs.org/blog/2017/09/26/react-v16.0.html">nedávno vydaná verze Reactu, 16.0.0</a>, už Fiber obsahuje. Naivně jsem si říkal, že příprava přednášky mě dotlačí k tomu, abych se naučil, jak Fiber funguje, a byl tak připraven na jeho plné nasazení do produkce. Hned na úvod se však musím přiznat, že tento plán mi až tak úplně nevyšel. Pokud bych použil terminologii z článku <a href="http://www.vikingcodeschool.com/posts/why-learning-to-code-is-so-damn-hard">“Why Learning to Code is So Damn Hard” od Erik Trautman</a>, tak jsem se během svého pokusu velmi rychle vyškrábal na “Clif of Confusion” a z něj jsem se, ještě mnohem rychleji, skutálel do “Desert of Despair”.</p><p>Ale zpět k Fiber a proč si myslím, že je důležité se s ním seznámit detailněji. React Fiber je nový <a href="https://reactjs.org/docs/reconciliation.html">reconciler</a>, který oproti předchozímu umožňuje členit práci do dílčích úkolů a může tak svoji práci přerušit a znovu se k ní vrátit. Pokud jste se se základním konceptem Fiber ještě nesetkali, doporučuji shlédnout přednášku od <a href="https://www.youtube.com/watch?v=ZCuYPiUIONs">Lin Clark: A Cartoon Intro to Fiber</a>. Je to revoluční změna, protože Stack Reconciler přerušení práce neumožňuje, a dokud svůj úkol nedokončí, blokuje vykonávání jakékoliv jiné činnosti prohlížeče. Už u Stack Reconcileru bylo dobré, znát základní princip jak funguje, aby jsme mu při vývoji aplikace neházeli klacky pod nohy. A myslím si, že pochopení funkčnosti Fiber má pro nás ještě mnohem větší význam, jelikož zavádí radikální změny ovlivňující výkon aplikace.</p><h3>Selhání první: vše pochopím z kódu</h3><p>Po opakovaném shlédnutí Lin přednášky jsem stále měl dojem, že úplně nechápu, proč a jak se věci dějí. Tak jsem si řekl, že když projdu zdrojové kódy pro Fiber, bude mi vše hned jasné. No více jsem se mýlit nemohl! Zdrojové kódy pro React jsou nádherné pro čtení, ale pochopit je bez dalších znalostí použitých datových struktur je obtížné. Po tomto zjištění mé další kroky vedly k článkům: <a href="http://makersden.io/blog/look-inside-fiber/">A look inside React Fiber — how work will get done od Korneliusz Caputa</a> a <a href="https://engineering.hexacta.com/didact-fiber-incremental-reconciliation-b2fe028dcaec">Didact Fiber: Incremental reconciliation Rodrigo Pombo</a>. Oba články vřele doporučuji všem zájemcům o pochopení reconcilace. Já si na ně však nevyhradil dostatek času, takže mi k pochopení přispěly jen málo. Ale toto selhání hodlám co nejdříve napravit a alternativní kód od Didact Fiber si opravdu vyzkouším a nehnu se od něj dál, dokud si opravdu nebudu jistý tím, co dělám.</p><h3>Selhání druhé: testovací aplikace</h3><p>V zoufalství z toho, že termín přednášky se limitně blíží, jsem udělal největší chybu z celé přípravy. Řekl jsem si, že si napíšu dvě varianty jednoduché aplikace, která úmyslně bude systém co nejvíce zatěžovat. Ale když člověk neví, jak něco funguje, těžko asi napíše testovací aplikaci. Mojí chybou bylo to, že místo jednoho náročného update UI jsem test napsal stylem tisíce jednoduchých změn v krátkých časových intervalech. Paradoxně se aplikace s Fiber chovala tak, jak jsem očekával. Co jsem však netušil, že jde pouze o artefakt toho, jak Fiber se změnami pracuje. To, co jsem tedy připravil, byl pouze test takzvaného “vyhladovění”, na což upozorňuje Lin Clark v závěru své přednášky.</p><h3>Závěr</h3><p>Jakkoliv se může zdát, že veškerá má aktivita ohledně učení se principů Fiber byla zbytečná, jsem ve finále rád, že jsem se do toho pustil. Zjistil jsem, že pro opravdové pochopení budu muset investovat poměrně dost času a nebude stačit si jen pročíst články. I malé střípky nových informací, které jsem během tohoto pokusu získal, mi naznačují, že to, co přichází s React 16, bude obrovská změna v přístupu vývoje aplikací. Nejde jen o samotný Fiber, ale hlavně o to, že nová verze Reactu zpřístupňuje api nejenom pro vytváření vlastních rendererů, ale i reconcilerů. To může být ideální cesta pro ladění výkonu aplikací, ve kterých záleží na každé milisekundě. Já osobně se těším na další chvíle, které strávíme s Fiber pohromadě.</p><p>PS: Pokud se do Fiber chcete pustit sami, rozhodně začněte na stránce <a href="https://github.com/koba04/react-fiber-resources">React Fiber Resources</a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f55e06487b1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/blueberry-cz/jak-jsem-se-seznamoval-s-react-fiber-7f55e06487b1">Jak jsem se seznamoval s React Fiber</a> was originally published in <a href="https://medium.com/blueberry-cz">Blueberry_cz</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How did I get acquainted with React Fiber?]]></title>
            <link>https://medium.com/blueberry/how-did-i-get-acquainted-with-react-fiber-23c1c67db0e9?source=rss-34ec0cf11296------2</link>
            <guid isPermaLink="false">https://medium.com/p/23c1c67db0e9</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[fail]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[fiber]]></category>
            <dc:creator><![CDATA[Pavel Kepka]]></dc:creator>
            <pubDate>Tue, 19 Dec 2017 09:16:18 GMT</pubDate>
            <atom:updated>2017-12-19T11:20:59.673Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A.k.a the history of one failure</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dvZ_D83MjEiR283LQjFhSg.png" /></figure><p>It’s been a couple of weeks since I gave a talk on React Fiber at the Blueberry meet up. I chose Fiber deliberately, because I have been experimenting with it for the last few months almost constantly. More importantly, <a href="https://reactjs.org/blog/2017/09/26/react-v16.0.html">the recently released version of React, 16.0.0</a>, already contains Fiber. I was naive to expect that the preparation of the lecture would push me to learn how Fiber works and would help me to get ready for its full use in production. From the outset I have to admit that this plan didn’t work out as I expected. To use the terminology of Erik Trautman’s “<a href="http://www.vikingcodeschool.com/posts/why-learning-to-code-is-so-damn-hard">Why Learning to Code is So Damn Hard</a>”, I quickly scrambled for “Cliff of Confusion” and ran even more quickly into the “Desert of Despair “.</p><p>But back to Fiber and why I think it’s important to get to know it in more detail. React Fiber is a new <a href="https://reactjs.org/docs/reconciliation.html">reconciler</a> that compared to the previous one, allows you to split work into partial tasks, enabling you to stop your work and return to it again. If you have not heard about the basic concept of Fiber, I recommend watching a lecture by <a href="https://www.youtube.com/watch?v=ZCuYPiUIONs">Lin Clark: “A Cartoon Intro to Fiber”</a>. This is a revolutionary change, because stack reconciler does not allow the interruption of work and, until it completes its task, blocks any other browser activity. Even with stack reconcile, it was good to know the basic principle of how it works, so we did not intentionally make things harder for ourselves in the development of the application. And I think the understanding of Fiber’s functionality is even more important to us because it introduces radical changes affecting the performance of the application.</p><h3>First failure: I will understand everything from the code</h3><p>After repeatedly reviewing Lin’s lectures, I still had the impression that I did not quite understand why and how things were happening. So, I thought that if I went through the Fiber source codes, it would become clearer to me.</p><p>I couldn’t have been more wrong! The source codes for React are wonderful for reading, but understanding them without any knowledge of used data structures is difficult. After this finding, my next steps led to the articles <a href="http://makersden.io/blog/look-inside-fiber/">“A look inside React Fiber — how work will get done” by Korneliusz Caputa</a>, and <a href="https://engineering.hexacta.com/didact-fiber-incremental-reconciliation-b2fe028dcaec">“Didact Fiber: Incremental reconciliation” by Rodrigo Pombo</a>. I strongly recommend both articles to those who want to understand reconciliation. However, I did not spend enough time reading them, so there were not really beneficial for me. Nevertheless, I want to fix this failure as soon as possible. So, I will try to learn the alternative code from Didact Fiber and will not move on from it until I’m really sure of what I’m doing.</p><h3>Second failure: testing application</h3><p>Because of my increasing desperation about the upcoming talk, I made the biggest mistake of the whole preparation. I decided to write two variants of a simple application that would deliberately load the system as much as possible. But if you do not know how something works, it’s hard to write a test application. My mistake was that instead of one demanding UI update, I wrote the test in the style of a thousand simple changes in short time intervals. Paradoxically, the Fiber app behaved as I expected. But what I did not know was that it was just an artifact of how Fiber works with changes. What I was doing was just a so-called “starvation test”, as Lin Clark calls it at the end of his lecture.</p><h3>Conclusion</h3><p>Although it may seem that all of my attempts to learn the principles of Fiber were useless, in the end, I’m glad that I went through it. I have found that for real understanding I will have to invest quite a bit of time, and that reading the articles won’t be enough. Even the smallest pieces of new information I have gained during this experiment suggest to me that what comes with React 16 will be a huge change in the application development approach. It’s not just about Fiber itself, but mainly about making the new version of React accessible and not just for creating your own renderers, but also reconcilers. This can be an ideal way to debug the performance of applications where every millisecond counts. I personally look forward to the next moment I spend with Fiber.</p><p>PS: If you want to start with Fiber yourself, definitely start with <a href="https://github.com/koba04/react-fiber-resources">React Fiber resources</a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=23c1c67db0e9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/blueberry/how-did-i-get-acquainted-with-react-fiber-23c1c67db0e9">How did I get acquainted with React Fiber?</a> was originally published in <a href="https://medium.com/blueberry">Blueberry</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>