<?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: Danyal Muneer</title>
    <description>The latest articles on DEV Community by Danyal Muneer (@danyal_muneer_decd8f77c04).</description>
    <link>https://dev.to/danyal_muneer_decd8f77c04</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%2F4235743%2F273e1a96-380f-4156-b0df-cc0911a483a8.jpg</url>
      <title>DEV Community: Danyal Muneer</title>
      <link>https://dev.to/danyal_muneer_decd8f77c04</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/danyal_muneer_decd8f77c04"/>
    <language>en</language>
    <item>
      <title>We removed 82 MB of native code that nothing imported</title>
      <dc:creator>Danyal Muneer</dc:creator>
      <pubDate>Sat, 14 Nov 2026 19:43:27 +0000</pubDate>
      <link>https://dev.to/danyal_muneer_decd8f77c04/we-removed-82-mb-of-native-code-that-nothing-imported-1ibe</link>
      <guid>https://dev.to/danyal_muneer_decd8f77c04/we-removed-82-mb-of-native-code-that-nothing-imported-1ibe</guid>
      <description>&lt;p&gt;Our Android APK was carrying two native libraries that no JavaScript file used anymore.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;librnskia.so&lt;/code&gt;: 41 MB across 4 ABIs.&lt;/strong&gt; Skia stayed in &lt;code&gt;package.json&lt;/code&gt; after we replaced our charts with plain &lt;code&gt;react-native-svg&lt;/code&gt; rings and Views.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;WebRTC (&lt;code&gt;libjingle_peerconnection_so.so&lt;/code&gt;): 41 MB across ABIs.&lt;/strong&gt; It was left over from a voice path we had already retired. Worse, it was being &lt;code&gt;dlopen&lt;/code&gt;'d &lt;strong&gt;574 ms into every cold start&lt;/strong&gt;, before the first frame, for code nothing imported.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The lesson
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Autolinking compiles a library's native code into the APK whether or not any JS imports it.&lt;/strong&gt; A package you "parked" in &lt;code&gt;package.json&lt;/code&gt; for later is not free. You pay for it in download size and, sometimes, in startup time.&lt;/p&gt;

&lt;h2&gt;
  
  
  How we found them
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Break the APK down&lt;/strong&gt; by ABI, library and asset. We have a small script (&lt;code&gt;yarn perf apk&lt;/code&gt;) that unzips the build and sorts every &lt;code&gt;.so&lt;/code&gt; by size. Two 41 MB entries for features we no longer shipped stood out immediately.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Watch what loads at startup.&lt;/strong&gt; A second script (&lt;code&gt;yarn perf soload&lt;/code&gt;) reads logcat during a cold start and lists every &lt;code&gt;.so&lt;/code&gt; that loads, with a timestamp. That's how WebRTC showed up at 574 ms.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Remove it and make sure it stays removed.&lt;/strong&gt; We deleted the packages and added an ESLint &lt;code&gt;no-restricted-imports&lt;/code&gt; entry for each one, with the reason in the message, so nobody adds them back without reading why.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Bonus: BlurView on Android
&lt;/h2&gt;

&lt;p&gt;On iOS, &lt;code&gt;BlurView&lt;/code&gt; is a hardware-accelerated &lt;code&gt;UIVisualEffectView&lt;/code&gt;. On Android it re-samples the whole view tree into a bitmap and blurs it &lt;strong&gt;every frame&lt;/strong&gt; for as long as it is mounted.&lt;/p&gt;

&lt;p&gt;Our floating action menu used a full-screen blur and measured p50 51 ms and p95 101 ms per frame, with 8.3% of frames over 100 ms. It was the worst interaction in the app. Replacing the blur with a flat scrim on Android (keeping the blur on iOS) fixed it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Audit your APK by library, not just total size.&lt;/li&gt;
&lt;li&gt;Check which native libraries load before your first frame.&lt;/li&gt;
&lt;li&gt;Remove unused native packages and lint against them coming back.&lt;/li&gt;
&lt;li&gt;Gate full-screen blur to iOS.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;I'm building &lt;a href="https://finovaa.app" rel="noopener noreferrer"&gt;Finovaa&lt;/a&gt;, an AI budgeting coach for iOS and Android, currently in store review.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>android</category>
      <category>performance</category>
      <category>mobile</category>
    </item>
    <item>
      <title>How we stop our AI budgeting coach from making up numbers</title>
      <dc:creator>Danyal Muneer</dc:creator>
      <pubDate>Mon, 09 Nov 2026 19:04:40 +0000</pubDate>
      <link>https://dev.to/danyal_muneer_decd8f77c04/how-we-stop-our-ai-budgeting-coach-from-making-up-numbers-hg9</link>
      <guid>https://dev.to/danyal_muneer_decd8f77c04/how-we-stop-our-ai-budgeting-coach-from-making-up-numbers-hg9</guid>
      <description>&lt;p&gt;I'm building &lt;a href="https://finovaa.app" rel="noopener noreferrer"&gt;Finovaa&lt;/a&gt;, a budgeting app with an AI coach. It's launching on iOS and Android soon.&lt;/p&gt;

&lt;p&gt;The scariest bug in a money app isn't a crash. It's the coach confidently telling you that you have $240 left when you have $24. A crash is obvious. A wrong number said in a friendly voice gets believed.&lt;/p&gt;

&lt;p&gt;So the coach is built on one rule, and four pieces of code enforce it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The rule: decide locally, let the model only rephrase
&lt;/h2&gt;

&lt;p&gt;Every coaching surface has to be &lt;strong&gt;correct, instant and useful before any model is called&lt;/strong&gt;. The model's only job is to reword a decision the app has already made. If the model is slow, down, over quota, or wrong, the user still gets the right answer.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. A pure signal engine decides &lt;em&gt;what&lt;/em&gt; to say
&lt;/h2&gt;

&lt;p&gt;Detectors for budget pace, unusual spending, recurring charges, goal gaps and month-end shortfall run as pure, synchronous functions over data the screen has already loaded. Their results are ranked by severity: &lt;code&gt;risk &amp;gt; watch &amp;gt; info &amp;gt; win&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Two things make this work:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;They're pure and clock-injected.&lt;/strong&gt; &lt;code&gt;now&lt;/code&gt; is passed in, so every detector is an ordinary unit test. No mocking &lt;code&gt;Date&lt;/code&gt;, no flaky "it fails on the 31st".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Returning nothing is a normal outcome.&lt;/strong&gt; A coach that always has something to say is noise. Most days, most signals are silent.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. A deterministic sentence ships first
&lt;/h2&gt;

&lt;p&gt;Each signal builds a real sentence from its own facts, synchronously, before any network call. The free tier gets exactly this, so nobody ever sees an empty card or a spinner where advice should be. The numbers in it come from the same engine the rest of the screen uses, so the card can never disagree with the chart above it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0gkgycw26xpqaejqi4h7.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0gkgycw26xpqaejqi4h7.jpg" alt="Finovaa budget screen: £437 left of £520, £17 a day for 25 days, with the coach's one-line read underneath" width="800" height="1422"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. The model gets the facts, as plain lines
&lt;/h2&gt;

&lt;p&gt;For Pro users, the app asks the model to reword the verdict. The facts go in as short, labelled lines, something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Budget: Groceries, monthly, limit £520
Day 5 of 30; 25 days left including today
Spent: £83 (16% of the limit)
Safe to spend per day for the rest: £17
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One small detail that mattered: a projection from the first few days of a month is one purchase extrapolated over thirty days. The screen doesn't show it that early, so the model isn't handed it either. &lt;strong&gt;Anything you don't want the model to say, don't give it.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4. A grounding check throws out invented numbers
&lt;/h2&gt;

&lt;p&gt;Before a reply is shown, every number in it has to appear in the facts we sent. If one doesn't, the reply is dropped and the deterministic sentence stays on screen.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;numbersIn&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="se"&gt;\d&lt;/span&gt;&lt;span class="sr"&gt;+&lt;/span&gt;&lt;span class="se"&gt;(?:[&lt;/span&gt;&lt;span class="sr"&gt;.,&lt;/span&gt;&lt;span class="se"&gt;]\d&lt;/span&gt;&lt;span class="sr"&gt;+&lt;/span&gt;&lt;span class="se"&gt;)&lt;/span&gt;&lt;span class="sr"&gt;*/g&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="p"&gt;[]).&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/,/g&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;isGroundedReply&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;reply&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;facts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nx"&gt;boolean&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;reply&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;trim&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;MAX_REPLY_CHARS&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/undefined|null|NaN|&lt;/span&gt;&lt;span class="se"&gt;\{\{&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;allowed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;numbersIn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;facts&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;numbersIn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;every&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;allowed&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;has&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's deliberately blunt. It doesn't try to understand the sentence; it just refuses any figure it didn't supply. That also catches the embarrassing failures: a template that leaked &lt;code&gt;{{amount}}&lt;/code&gt;, or a reply that says "undefined".&lt;/p&gt;

&lt;p&gt;(The real version also normalises Arabic-Indic digits, because the app ships in Arabic and "١٧" should match "17".)&lt;/p&gt;

&lt;h2&gt;
  
  
  What this buys
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The free tier is complete.&lt;/strong&gt; The AI is an upgrade to the wording, not a dependency of the feature.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Outages are invisible.&lt;/strong&gt; If the model fails, the user sees a correct sentence instead of an error.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The tests are boring.&lt;/strong&gt; The logic that matters is pure functions with plain inputs and outputs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trust.&lt;/strong&gt; The coach can be warm, blunt or funny, but it can't be wrong about your money in a way the app wasn't.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The trade-off is that the model can't come up with an insight the engine didn't detect. For money, I'll take that trade every time.&lt;/p&gt;




&lt;p&gt;If you're curious what this looks like in the app, the waitlist is open at &lt;a href="https://finovaa.app" rel="noopener noreferrer"&gt;finovaa.app&lt;/a&gt;. I'd also love to hear how other people are keeping LLM output honest in apps where the numbers matter.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>reactnative</category>
      <category>llm</category>
      <category>fintech</category>
    </item>
  </channel>
</rss>
