<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Kamil Kołodziejczyk</title>
    <description>The latest articles on DEV Community by Kamil Kołodziejczyk (@kolodziejczykamil).</description>
    <link>https://dev.to/kolodziejczykamil</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4192829%2F66fd20a2-3013-4b95-9a27-e6e9d1db481c.png</url>
      <title>DEV Community: Kamil Kołodziejczyk</title>
      <link>https://dev.to/kolodziejczykamil</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kolodziejczykamil"/>
    <language>en</language>
    <item>
      <title>What static analysis can't tell you about React re-renders</title>
      <dc:creator>Kamil Kołodziejczyk</dc:creator>
      <pubDate>Fri, 23 Oct 2026 07:00:00 +0000</pubDate>
      <link>https://dev.to/kolodziejczykamil/what-static-analysis-cant-tell-you-about-react-re-renders-3e9i</link>
      <guid>https://dev.to/kolodziejczykamil/what-static-analysis-cant-tell-you-about-react-re-renders-3e9i</guid>
      <description>&lt;p&gt;&lt;a href="https://re-render-lab.vercel.app" rel="noopener noreferrer"&gt;Re-render lab&lt;/a&gt; is a small tool I built: you paste a React component, describe a scenario (a prop changes, state updates, the parent re-renders, an effect runs) and get a timeline of renders with suggestions. It never runs React. It reads the code and applies rules.&lt;/p&gt;

&lt;p&gt;Building it is a good way to see exactly where reading code stops being enough.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the code can tell you
&lt;/h2&gt;

&lt;p&gt;The analyzer parses the component with Babel and walks the syntax tree. From the source alone it can reliably find:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;whether the component is wrapped in &lt;code&gt;React.memo&lt;/code&gt;,&lt;/li&gt;
&lt;li&gt;how many &lt;code&gt;useState&lt;/code&gt; hooks it has and what they are called,&lt;/li&gt;
&lt;li&gt;whether each &lt;code&gt;useEffect&lt;/code&gt; has a dependency array and what is in it,&lt;/li&gt;
&lt;li&gt;inline arrow functions, objects and arrays passed in JSX.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are facts. They are in the text of the file, so a parser finds them every time.&lt;/p&gt;

&lt;h2&gt;
  
  
  What only the running app knows
&lt;/h2&gt;

&lt;p&gt;The problems start with the questions that matter for performance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Did the props actually change?&lt;/strong&gt; &lt;code&gt;React.memo&lt;/code&gt; skips a render when every prop is shallowly equal to the previous one. Whether &lt;code&gt;user&lt;/code&gt; is the same object as last time depends on the parent, not on this component. The simulator cannot know it, so it has to assume: a prop change always re-renders, and a memoized component skips a parent re-render because its props are treated as unchanged. Both are reasonable defaults, and both can be wrong in a real app.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How long does a render take?&lt;/strong&gt; The timeline shows durations, but they are deterministic placeholders that keep events in order, not measurements. Real timings come from the React DevTools Profiler, on a real device, with real data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What else triggers a render?&lt;/strong&gt; The scenarios cover props, state, parent renders and effects. Context updates are not modelled at all, and in many apps they are the main source of surprise renders.&lt;/p&gt;

&lt;h2&gt;
  
  
  The rule that needs the most nuance
&lt;/h2&gt;

&lt;p&gt;The tool suggests &lt;code&gt;useCallback&lt;/code&gt; whenever it sees an inline arrow function in JSX. Taken literally, that is one of the most common React performance myths.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt; &lt;span class="na"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;setOpen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Open&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A new function on every render changes nothing here: &lt;code&gt;button&lt;/code&gt; is a DOM element and does not compare props. The new reference only matters when it reaches something that compares it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Row&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;memo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;Row&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;onSelect&lt;/span&gt; &lt;span class="p"&gt;}:&lt;/span&gt; &lt;span class="nx"&gt;RowProps&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Row&lt;/span&gt; &lt;span class="na"&gt;onSelect&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now &lt;code&gt;memo&lt;/code&gt; sees a different &lt;code&gt;onSelect&lt;/code&gt; on every render and re-renders &lt;code&gt;Row&lt;/code&gt; anyway, so &lt;code&gt;useCallback&lt;/code&gt; actually helps. The same applies to functions used in a dependency array. A better rule would flag inline functions only when they are passed to a memoized child or used as a dependency.&lt;/p&gt;

&lt;p&gt;The same nuance applies to &lt;code&gt;React.memo&lt;/code&gt; itself. It adds a comparison on every render, so it pays off for components that render often with the same props, not for every component by default.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I take from it
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Static analysis finds patterns, not problems.&lt;/strong&gt; It can tell you that an inline object exists. It cannot tell you whether it costs anything.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Make assumptions visible.&lt;/strong&gt; A simulated number that looks like a measurement is worse than no number. Label it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Measure before you memoize.&lt;/strong&gt; Open the Profiler, find the component that actually renders too often, and fix that one. The patterns a tool flags are a list of places to look, not a list of things to change.&lt;/p&gt;

&lt;p&gt;The code is on &lt;a href="https://github.com/kolodziejczykamil/re-render-lab" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://kamilkolodziejczyk.dev/notes/what-static-analysis-cannot-tell-you-about-react-re-renders" rel="noopener noreferrer"&gt;kamilkolodziejczyk.dev&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>performance</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Parallel AI agents need a contract first</title>
      <dc:creator>Kamil Kołodziejczyk</dc:creator>
      <pubDate>Wed, 21 Oct 2026 07:00:00 +0000</pubDate>
      <link>https://dev.to/kolodziejczykamil/parallel-ai-agents-need-a-contract-first-971</link>
      <guid>https://dev.to/kolodziejczykamil/parallel-ai-agents-need-a-contract-first-971</guid>
      <description>&lt;p&gt;In the &lt;a href="https://kamilkolodziejczyk.dev/notes/why-i-did-not-integrate-with-messenger" rel="noopener noreferrer"&gt;previous note&lt;/a&gt; I wrote about why the attendance app for a fitness coach skips Messenger. This one is about how it was built: with Claude, as one orchestrator and four agents working on separate parts of the app at the same time.&lt;/p&gt;

&lt;p&gt;The interesting part is not that agents wrote code. It is what had to exist before they started.&lt;/p&gt;

&lt;h2&gt;
  
  
  The foundation came first
&lt;/h2&gt;

&lt;p&gt;The first commit contains no features. It contains:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A plan.&lt;/strong&gt; The problem, the options that were rejected, business rules down to how passwords are compared and how phone numbers are normalized, and the split of work between agents.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;An API contract.&lt;/strong&gt; 28 TypeScript types in one shared file, the only source of truth for requests and responses. The backend and the frontend both import it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A design system.&lt;/strong&gt; Colour tokens matched to the coach's website, buttons, cards, form fields, a bottom sheet and a toast, ready to use.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Empty screens with an owner.&lt;/strong&gt; Every page already existed as a stub with one line pointing to the plan: implement this screen, see the plan.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  One rule: every file has one owner
&lt;/h2&gt;

&lt;p&gt;There were four agents: the backend, the public check-in screen, the coach's training panel, and participants with statistics. Each one owned a set of files and was not allowed to edit anything outside it. If an agent needed a change in a shared file, it described the change in its final report instead of making it.&lt;/p&gt;

&lt;p&gt;This removes the problem that breaks parallel work: two agents editing the same file with different assumptions. There was nothing to merge. Conflicts came back as notes in the reports, where they could be decided on purpose.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the first pass produced
&lt;/h2&gt;

&lt;p&gt;The commit with the first full version, with the backend, check-in, training panel, participants and statistics, landed 16 minutes after the foundation commit: 53 files and about 8,900 lines. The backend came with tests that call the API against an in-memory database.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a first pass does not give you
&lt;/h2&gt;

&lt;p&gt;The very next commit removed comments from 59 files and moved the list of endpoints into a single API document. After that came the parts that turn a working version into something a real person can rely on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;deployment on Vercel with a cloud SQLite database,&lt;/li&gt;
&lt;li&gt;a security and GDPR pass: CSRF protection, rate limits, security headers and automatic deletion of old data,&lt;/li&gt;
&lt;li&gt;accounts with a password change,&lt;/li&gt;
&lt;li&gt;making up missed workouts from the recording,&lt;/li&gt;
&lt;li&gt;a personal panel where each participant sees her own attendance.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Agents are fast at filling in a well-defined shape. Deciding the shape, the rules and what "done" means is still the job.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I would keep
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Contract first.&lt;/strong&gt; Shared types are the cheapest way to make four agents agree without talking to each other.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ownership instead of merging.&lt;/strong&gt; Split the work by files, not by tasks that touch the same files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Business rules in writing.&lt;/strong&gt; Every rule in the plan is a question an agent does not have to guess.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stubs as a map.&lt;/strong&gt; An empty screen with an owner tells an agent exactly where to work and where to stop.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://kamilkolodziejczyk.dev/notes/parallel-ai-agents-need-a-contract-first" rel="noopener noreferrer"&gt;kamilkolodziejczyk.dev&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>typescript</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Why I didn't integrate with Messenger</title>
      <dc:creator>Kamil Kołodziejczyk</dc:creator>
      <pubDate>Sun, 18 Oct 2026 20:21:28 +0000</pubDate>
      <link>https://dev.to/kolodziejczykamil/why-i-didnt-integrate-with-messenger-2l74</link>
      <guid>https://dev.to/kolodziejczykamil/why-i-didnt-integrate-with-messenger-2l74</guid>
      <description>&lt;p&gt;A fitness coach I know runs live workouts in a private Facebook group. During each workout she says a password. Participants send it to her on Messenger, and after the session she goes through the messages and ticks off who was there.&lt;/p&gt;

&lt;p&gt;With dozens of messages after every workout, this takes time and mistakes are easy. And there are no statistics: who came on which day, who stopped coming. The request sounded simple: can an app read those messages for me?&lt;/p&gt;

&lt;h2&gt;
  
  
  What Meta's APIs allow
&lt;/h2&gt;

&lt;p&gt;Before writing any code, I checked the options.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Reading her private Messenger.&lt;/strong&gt; Meta has no API for personal accounts. Bots and scraping break the terms of service and can get the account blocked. Not an option for someone whose business runs on that account.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reading comments under the live video in the group.&lt;/strong&gt; The Groups API that could do this was shut down by Meta in 2024.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Messenger Platform for a Facebook Page.&lt;/strong&gt; Technically possible: a webhook receives every message sent to a Page. But participants would have to write to a Page instead of to her, and the app would need Meta's App Review for messaging permissions and a verified business. A lot of paperwork for a small coach, with a real chance of rejection.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Her own check-in link.&lt;/strong&gt; No dependency on Meta at all.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Keep the ritual, change the channel
&lt;/h2&gt;

&lt;p&gt;The password was never the problem. People were used to it, and it proves they watched the workout. The problem was the channel.&lt;/p&gt;

&lt;p&gt;So the coach still says "today's password is MALINA" during the live, but participants type it on a page linked in the group instead of sending it on Messenger. The first time, a participant enters her name and a phone number or email. After that the browser remembers her, and checking in is one field and one button. People who watch the recording later can still check in, and the app marks those as made-up workouts.&lt;/p&gt;

&lt;p&gt;For the transition there is a plan B: if someone still sends the password on Messenger, the coach finds her in the app and ticks her off with one tap.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the coach gets
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A live screen during the workout, with the password in large letters and a counter of people who have checked in.&lt;/li&gt;
&lt;li&gt;Monthly statistics: who came on which day, attendance per person and a CSV export for Excel.&lt;/li&gt;
&lt;li&gt;A list of people who missed several workouts in a row, so she can write to them before they drop out.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The app went live in September 2026.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I took from it
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Sometimes the best integration is no integration.&lt;/strong&gt; Reading the documentation first ruled out the path that looked obvious and would have cost the most, before a single line of code depended on it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Keep the habit users already have.&lt;/strong&gt; Nobody had to learn anything new. They type the same password, just in a different place.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Design for the real context.&lt;/strong&gt; A phone, one hand, during or right after a workout. Large fields, one action per screen, and the coach's panel works from the home screen of her phone.&lt;/p&gt;

&lt;p&gt;The Messenger Platform option is not gone for good. If the coach ever sets up a Facebook Page, a webhook that recognizes the password in a message could be a second stage. It just did not have to be the first one.&lt;/p&gt;

&lt;p&gt;I built the app with AI coding agents working in parallel on separate parts, starting from a shared API contract. More on that in &lt;a href="https://kamilkolodziejczyk.dev/notes/parallel-ai-agents-need-a-contract-first" rel="noopener noreferrer"&gt;Parallel AI agents need a contract first&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://kamilkolodziejczyk.dev/notes/why-i-did-not-integrate-with-messenger" rel="noopener noreferrer"&gt;kamilkolodziejczyk.dev&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>architecture</category>
      <category>ux</category>
      <category>react</category>
    </item>
  </channel>
</rss>
