| commit | 0e06fcfca46471506ffcb5d1f988221bfb9d2d7f | [log] [tgz] |
|---|---|---|
| author | Daco Harkes <dacoharkes@google.com> | Mon Feb 09 09:32:06 2026 -0800 |
| committer | GitHub <noreply@github.com> | Mon Feb 09 17:32:06 2026 +0000 |
| tree | 8c7adecdb674715125fec270f27a1059933eb249 | |
| parent | 51d34eb76bb2b08347cb8406f9d022dfcf13afe4 [diff] |
[record_use] Remove definition loading unit (#3061) In `dart2js`, definitions currently include a `loading_unit` property which typically represents the "dominating" loading unit (the shared ancestor of all loading units where that definition is used). When assets are associated with a definition, using this definition-level `loading_unit` can lead to assets being loaded too early. For example, if a definition is used in two different deferred loading units, its dominating unit might be the main bundle. Loading the asset in the main bundle defeats the purpose of deferring it. To fix this, we want to postpone asset loading until one of the actual loading units that uses the definition is loaded. Since every recorded `Call` and `Instance` already includes its own `loading_unit`, the property on the `Definition` itself is redundant and misleading for the web backend. Closes: https://github.com/dart-lang/native/issues/2986 Issues to be addressed in follow up PRs: * https://github.com/dart-lang/native/issues/3022 * https://github.com/dart-lang/native/issues/2888 ## Changes ### 1. JSON Schema & Syntax - Removed `loading_unit` from the `Definition` object in `record_use.schema.json`. - Updated `Recording` to use `identifier` directly as its key property. ### 2. Dart API - Removed the `Definition` class. `Recordings` now uses `Identifier` as the primary key for the `callsForDefinition` and `instancesForDefinition` maps. - Added a `TODO` to `Identifier` to rename it to `Definition` in a future refactor ([#2888](https://github.com/dart-lang/native/issues/2888)).
This repository is home to Dart packages related to FFI and native assets building and bundling.
See the doc directory for more documentation.
| Package | Description | Issues | Version |
|---|---|---|---|
| code_assets | This package contains the Dart API for code assets in hook/build.dart and hook/link.dart. | ||
| data_assets | This package contains the Dart API for data assets in hook/build.dart and hook/link.dart. | ||
| ffi | Utilities for working with Foreign Function Interface (FFI) code. | ||
| ffigen | Generator for FFI bindings, using LibClang to parse C, Objective-C, and Swift files. | ||
| hooks | This package contains the API for hook/build.dart and hook/link.dart. | ||
| hooks_runner | This package is the backend that invokes hook/build.dart and hook/link.dart from Dart and Flutter. | ||
| jni | A library to access JNI from Dart and Flutter that acts as a support library for package:jnigen. | ||
| jnigen | A Dart bindings generator for Java and Kotlin that uses JNI under the hood to interop with Java virtual machine. | ||
| native_doc_dartifier | A library that converts code snippets from other languages into Dart. | ||
| native_toolchain_c | A library to invoke the native C compiler installed on the host machine. | ||
| objective_c | A library to access Objective C from Flutter that acts as a support library for package:ffigen. | ||
| swift2objc | A tool for generating bindings that allow interop between Dart and Swift code. | ||
| swiftgen | A tool for generating bindings that allow interop between Dart and Swift code. |
Packages not on this repo but also related to FFI and native assets. ❤️
| Package | Description | Version |
|---|---|---|
| native_toolchain_cmake | A library to invoke CMake for Dart Native Assets. | |
| native_toolchain_go | A library to invoke the native Go compiler installed on the host machine. | |
| native_toolchain_rust | A library to invoke the native Rust compiler installed on the host machine. | |
| native_toolchain_rs | A library to build and bundle Rust code for Dart Native Assets. |
For information about our publishing automation and release process, see https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.
For additional information about contributing, see our contributing page.