SShortSingh.
Back to feed

Dev builds Gradle plugin to cut KMP iOS export bloat, trims 5.7 MB in minutes

0
·1 views

A developer optimizing a personal Kotlin Multiplatform app discovered that 61% of its 459 Objective-C exports had no Swift call sites, generating thousands of lines of unnecessary bridging code. To investigate, he built a Gradle plugin called kmprofiler that parses the generated Objective-C header and flags declarations never referenced in Swift source files. The bloat stemmed mainly from public theme constants, internal UI state models, and third-party library types leaking into the header via exposed function signatures. By marking just five files as internal in the shared Kotlin module, he reduced the Shared.h header from 23,622 to 13,327 lines and cut the compiled framework object size by 5.7 MB. The plugin, kmprofiler v0.1.0, has been published to the Gradle Plugin Portal for other KMP developers to use.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Why JSON Validation Must Come Before LLM Gateway Failover in Node.js APIs

Developers building private knowledge-base classifiers with Node.js should benchmark multi-provider LLM gateways on validated, policy-compliant outputs per unit of spend rather than on advertised token costs alone. A single API key via gateways like OpenRouter reduces credential and adapter overhead, but JSON mode only guarantees syntactic structure, not correct taxonomy tags, proper value types, or resistance to prompt-injection within documents. Every response must pass through a parse, schema validation, and allowed-tag check before being accepted, since a failed validation that triggers a retry is not cheap and a label-changing fallback is a classification decision, not a recovery. Direct providers such as OpenAI, Claude, and Gemini each require their own native adapters, while a gateway normalizes access but cannot define application-specific taxonomy or determine label correctness. The recommended engineering approach places a strict validator between the adapter and business logic so that transport changes do not affect downstream application behavior.

0
ProgrammingDEV Community ·

Engineers Propose Adaptive AI Disclosure System to Balance Transparency and Persona UX

A technical discussion on DEV Community outlines engineering approaches for maintaining persistent AI identity disclosure in chatbot personas without degrading the user experience. The article argues that both one-time disclaimers and per-message repetition are ineffective, as the former gets forgotten while the latter becomes noise users tune out. The proposed solution uses risk-weighted disclosure frequency, injecting reminders more often during emotionally sensitive or high-stakes exchanges and less during routine ones. Disclosure language is varied in phrasing and woven into the persona's voice to avoid feeling mechanical, while a persistent UI badge provides a structural, always-visible signal independent of conversation timing. The system also couples disclosure logic with escalation detection, ensuring crisis scenarios trigger mandatory, explicit AI identification alongside appropriate resources.

0
ProgrammingDEV Community ·

Developer Credits Nutrition Deficiencies for Slowing Burnout Recovery Twice

A software developer experienced two burnouts within three years, following standard recovery advice both times — including taking time off, setting boundaries, and addressing psychological factors. Recovery remained unusually slow until bloodwork revealed critically low vitamin D, low RBC magnesium, an omega-3 index of 3.1%, and elevated inflammation marker hs-CRP at 2.9 mg/L. The developer explains that low vitamin D impairs dopamine synthesis, while low magnesium disrupts the HPA axis stress-response system, both of which can hinder burnout recovery. After supplementing with D3+K2, magnesium glycinate, and EPA-focused omega-3s over roughly eight weeks, cognitive and motivational symptoms reportedly improved. The developer notes that neither burnout prompted any clinician to suggest checking these nutritional markers, and has reported no recurrence in over two years since addressing them.

0
ProgrammingDEV Community ·

Google Adds 'Select from Screen' to Gemini in Chrome for Targeted Page Analysis

Google has introduced a new feature called 'Select from Screen' for Gemini in Chrome, allowing desktop users to draw a box around a specific area of a webpage and send it directly to the AI assistant for analysis. The selected region can include text, images, or a combination of both, giving users more precise control over the context they provide to Gemini. Users access the feature through Chrome's side panel, where they choose the option and manually define the area they want to share. The update aims to reduce friction in AI-assisted browser workflows, benefiting use cases such as product research, creative review, and document analysis. Availability may vary depending on account tier, region, rollout phase, and administrator settings in managed environments.