Monday, November 18, 2024

Google pitches WebAssembly for Flutter, Dart

Must read

Google has updated both its Flutter multiplatform application development framework and the accompanying Dart language. In making these updates, the company stressed the addition of the WebAssembly bytecode instruction format as a compilation target for web apps built with Flutter and Dart. The announcement follows recent reports of Google laying off staff from the Dart and Flutter teams.

Flutter 3.22 and Dart 3.4 were announced on May 14, offering performance boosts and platform-specific refinements. With Flutter 3.22, WebAssembly (Wasm) is brought to the stable channel, offering “significant” performance improvements, Google said. Wasm’s performance assist helps with animations and rich transitions. With Wasm, performance bottlenecks are reduced, resulting in smoother animations and transitions, according to Google.

Complete support for Wasm is available for Flutter Web Apps via Flutter 3.22. Incremental developments have included adding a new Dart compiler back end to generate WasmGC code and revamping web and JavaScript interop offerings to best support Wasm. Plans call for enabling full support for Wasm in pure Dart apps. End-to-end tooling for Wasm compilation is still in development, but a preview is available now. Also eyed is support for Wasm in Dart outside of JavaScript environments such as wasmer.

Also in Flutter 3.22, the Impeller rendering engine has been updated, with the completion of the Vulkan back end on Android for smoother graphics and better performance and ongoing optimizations for blur effects and complex path rendering. Also, a new experimental API is offered for testing with Impeller. Plans call for enhancing Impeller quality and performance in the future. In compliance with the Flutter roadmap, Google plans to enhance Impeller performance and quality, including completing an iOS migration to Impeller and increasing Android support.

Flutter and Dart are paired with the intent of enabling developers to build multiplatform applications from a single, shared codebase. These applications can be run on mobile, web, and desktop platforms. Flutter also now supports Android’s upcoming predictive back feature, where users can look at the previous route or the previous app during a back gesture. This feature is still behind a feature flag on Android devices. For the Kotlin language, meanwhile, Gradle Kotlin DSL now is supported, providing an alternative to the traditional Gradle Groovy DSL. This enables better code editing, with auto-completion, source navigation, context-aware refactoring, and fast access to documentation, according to Google.

With Dart 3.4, proponents announced a new approach for JSON serialization: the JsonCodable macro, currently in an experimental stage. A macro generates more code through introspecting other code at compile time. Also with version 3.4, Dart builders reported resolving more than 50% of analyzer code-completion bugs and improving the alignment of type analysis on conditional expressions, if-null expressions, and switch expressions with the language spec. They also removed incomplete tools from the dart:cli library and addressed inadequacies to improve the new dart:js_interop library.

Updates to Flutter were promised for this week’s Google I/O conference despite recent reports of Google laying off Dart and Flutter staff

Copyright © 2024 IDG Communications, Inc.

Latest article