<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Web on terrakok</title><link>https://terrablog.pages.dev/tags/web/</link><description>Recent content in Web on terrakok</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Mon, 02 Nov 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://terrablog.pages.dev/tags/web/index.xml" rel="self" type="application/rss+xml"/><item><title>Multithreading in Compose Multiplatform Web Apps</title><link>https://terrablog.pages.dev/blog/multithreading-compose-multiplatform-web-apps/</link><pubDate>Mon, 02 Nov 2026 00:00:00 +0000</pubDate><guid>https://terrablog.pages.dev/blog/multithreading-compose-multiplatform-web-apps/</guid><description>&lt;p&gt;The standard way to work with multithreading and asynchronous code in Kotlin is to use the &lt;code&gt;kotlinx.coroutines&lt;/code&gt; library.&lt;/p&gt;&#10;&lt;p&gt;To make code execution easier to manage, the library provides several standard dispatchers:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;code&gt;Dispatchers.Main&lt;/code&gt; — for working on the UI thread, if the platform has one.&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;Dispatchers.Default&lt;/code&gt; — for CPU-intensive work, such as calculations and data processing. Used by default when no dispatcher is specified.&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;Dispatchers.IO&lt;/code&gt; — for blocking I/O operations, such as file operations or blocking network calls.&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;Dispatchers.Unconfined&lt;/code&gt; — starts a coroutine on the current thread until its first suspension. After that, the coroutine may resume on a thread chosen by the suspending operation.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;In Compose Multiplatform apps, application code usually starts running on &lt;code&gt;Dispatchers.Main&lt;/code&gt;. So all blocking and heavy operations need to move to other threads to avoid blocking the UI.&lt;/p&gt;</description></item><item><title>Profiling a Compose Multiplatform app in the browser</title><link>https://terrablog.pages.dev/blog/profiling-compose-multiplatform-app-in-browser/</link><pubDate>Wed, 07 Oct 2026 00:00:00 +0000</pubDate><guid>https://terrablog.pages.dev/blog/profiling-compose-multiplatform-app-in-browser/</guid><description>&lt;h2 id="youve-noticed-a-performance-problem" class="heading-with-anchor"&gt;&#10; You&amp;rsquo;ve noticed a performance problem&#10; &lt;a class="heading-anchor" href="#youve-noticed-a-performance-problem" data-copy-heading-link data-heading-title="You’ve noticed a performance problem" title="Copy a link to this heading" aria-label="Copy a link to heading: You’ve noticed a performance problem"&gt;#&lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;h3 id="first-steps" class="heading-with-anchor"&gt;&#10; First steps&#10; &lt;a class="heading-anchor" href="#first-steps" data-copy-heading-link data-heading-title="First steps" title="Copy a link to this heading" aria-label="Copy a link to heading: First steps"&gt;#&lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;p&gt;I hope everyone already knows that to check the performance of a Compose app, you need to run it in &lt;strong&gt;release mode&lt;/strong&gt;. Development mode is designed for quick iterations and skips a lot of build-time optimizations.&#10;So first of all, if you see that the app is lagging and dropping frames, make sure you&amp;rsquo;re &lt;strong&gt;not&lt;/strong&gt; running it in development mode.&lt;br&gt;&#10;If the problems are still there even in a release build, then, of course, you need to figure out what went wrong.&#10;Don&amp;rsquo;t jump straight into the &lt;em&gt;hardcore&lt;/em&gt; stuff! First, just take a sensible look at what&amp;rsquo;s happening inside the app.&#10;Nobody knows your codebase better than you do. Maybe, by accident, you&amp;rsquo;re decoding a large JSON file on the UI thread. Or maybe you&amp;rsquo;re making a database query. And so on. 😉&lt;/p&gt;</description></item><item><title>Offline Support for Compose Multiplatform Web Apps</title><link>https://terrablog.pages.dev/blog/offline-support-compose-multiplatform-web-apps/</link><pubDate>Wed, 30 Sep 2026 00:00:00 +0000</pubDate><guid>https://terrablog.pages.dev/blog/offline-support-compose-multiplatform-web-apps/</guid><description>&lt;h2 id="the-no-internet-problem" class="heading-with-anchor"&gt;&#10; The No-Internet Problem.&#10; &lt;a class="heading-anchor" href="#the-no-internet-problem" data-copy-heading-link data-heading-title="The No-Internet Problem." title="Copy a link to this heading" aria-label="Copy a link to heading: The No-Internet Problem."&gt;#&lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;Let&amp;rsquo;s assume you already have a Compose Multiplatform app that runs on the web.&lt;br&gt;&#10;Perhaps you&amp;rsquo;ve even configured a &lt;a href="https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Manifest"&gt;web manifest&lt;/a&gt; so users can install it on their device as a PWA.&lt;br&gt;&#10;&lt;strong&gt;Let&amp;rsquo;s make it even better and bring its behavior closer to a native app.&lt;/strong&gt;&lt;br&gt;&#10;When a user runs an app in a browser, it&amp;rsquo;s reasonable to assume they have an internet connection. But if a user has installed a PWA app and its icon is available on the desktop, it&amp;rsquo;s reasonable to expect it to behave like a native app when there&amp;rsquo;s no internet connection.&lt;/p&gt;</description></item><item><title>Compose Multiplatform vs CORS</title><link>https://terrablog.pages.dev/blog/2026-03-10-cors-problem-and-simple-solution/</link><pubDate>Thu, 24 Sep 2026 00:00:00 +0000</pubDate><guid>https://terrablog.pages.dev/blog/2026-03-10-cors-problem-and-simple-solution/</guid><description>&lt;h2 id="the-problem" class="heading-with-anchor"&gt;&#10; The problem&#10; &lt;a class="heading-anchor" href="#the-problem" data-copy-heading-link data-heading-title="The problem" title="Copy a link to this heading" aria-label="Copy a link to heading: The problem"&gt;#&lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;I’m a Kotlin developer, and I really love building my own side projects in Kotlin.&#10;For the UI, I use Compose Multiplatform, of course.&lt;/p&gt;&#10;&lt;p&gt;On the one hand, my apps work natively on all platforms, including Android and iOS.&#10;On the other hand, publishing them in the official app stores is a huge problem. It’s expensive and requires filling out a lot of forms. And every six months to a year, both Google and Apple require you to update your apps to use new SDKs.&lt;/p&gt;</description></item></channel></rss>