tom_d4rt_generator 1.11.0
tom_d4rt_generator: ^1.11.0 copied to clipboard
D4rt bridge generator for creating BridgedClass implementations from Dart source. Supports per-package generation, deduplication, and cross-package bridging.
1.11.0 #
Lazy bridge factories (import-optimization) #
- Generated per-package bridges now emit factory thunks instead of a
pre-built
List<BridgedClass>:static Map<String, BridgedClass Function()> bridgeClassThunks()— class name → deferred factory that builds one class's member maps + adapter closures on demand.static Map<String, Type> bridgeClassTypes()— class name → nativeType, so the same thunk registers into both the name-keyed and type-keyed registries with the correctsourceUri.registerBridgesnow loops the thunks through the interpreter'sregisterBridgedClassLazy(name, type, thunk, importPath, sourceUri:)instead of constructing everyBridgedClasseagerly. A script that uses N of M generated classes materializes ≈N objects, not M.bridgeClasses()is retained (eager, diagnostic) for callers that still want the full materialized list.
- The aggregator barrel (
per_package_orchestrator) now spreadsbridgeClassThunks()/bridgeClassTypes()from each per-package bridge. - Bumped
tom_d4rtconstraint to^1.9.0: the generatedregisterBridgestargets the import-optimization API (registerBridgedClassLazy) introduced intom_d4rt1.9.0 /tom_d4rt_ast0.1.9.
1.10.0 #
Analyzer 10 migration #
- Upgraded
analyzerto^10.0.0(from^8.4.1). Applied the analyzer-10 API renames the generator relied on:AnalysisContextCollectionImpl(..., packagesFile: …)→packageConfigFile: …(constructor parameter rename) inbridge_generator.dart.NamedType.name2→NamedType.nameincorpus_type_scanner.dart.- Tidied a now-flagged null-aware spread (
...?externalClassLookup) inbridge_generator.dart.Element.isSyntheticremains deprecated-but-functional under analyzer 10; it is left in place because this package already setsdeprecated_member_use: ignoreproject-wide, so no per-call migration was needed.
- Bumped
tom_d4rtto^1.8.25(first analyzer-10 build on pub.dev; earlier1.8.xcarryanalyzer ^8and would conflict) andtom_analyzer_sharedto^0.4.0. - Stale analyzer-8
.sumsummary bundles underexample/d4/.tom/analyzer-cache/are undecodable by analyzer 10'sbundle_reader(RangeErrorin_decodeVariance) and were poisoning the test suites. Added a.gitignorefor**/.tom/analyzer-cache/and untracked the 92 regenerable bundles; they rebuild on demand under the active analyzer.
Incorporates 1.9.9 (published out-of-band, skipping local's 1.9.8): the
tom_analyzer_shared ^0.3.0shared-tool-cache change (analyzer summaries resolved viaToolCacheLocatorinto the shared Tom tool-cache directory) is superseded here by the^0.4.0constraint, so its behaviour is retained. This release also carries the 1.9.8 const-arg suppression that 1.9.9 omitted.
1.9.8 #
Generation quality (suppress unavoidable const-arg warning) #
- Bridge
.b.dartfiles emit constructor calls that forward script-supplied runtime values intoconstconstructors (e.g.IconData(codePoint, …)). Because those arguments are only known at run time they can never be const, so the analyzer reportsnon_const_argument_for_const_parameter— an unavoidable, cosmetic warning for bridged code. Addednon_const_argument_for_const_parameterto the generated// ignore_for_file:directive so regenerated bridge surfaces analyze cleanly (previously surfaced as 3 warnings againstIconDatainwidgets_bridges.b.dartfor bothtom_d4rt_flutterandtom_d4rt_flutter_ast).
1.9.7 #
Bug fixes (AllBridge import surface dropped under single-package inline) #
- GEN-077 — the generated dartscript helper calls
AllBridge.getImportBlock()andAllBridge.subPackageBarrels()unconditionally, but the AllBridge emitter gated both methods behindif (importBlockUri != null)whilesourceLibraries()was always emitted. In the single-package inline strategy (sourceImportunset, soimportBlockUriresolves tonull), AllBridge declaredsourceLibraries()but neithergetImportBlock()norsubPackageBarrels()— and thedartscript.b.darthalf that calls them still compiled, breaking downstream consumers (tom_brain_procedure,tom_brain_run, Observatory) with "method isn't defined" errors after regeneration. The emitter now writes both methods unconditionally: when there is no resolved barrel URI it derives the import block straight from the canonicalsourceLibraries()URIs and returns an emptysubPackageBarrels(). Adds the GEN-077 regression tests (G-ISS-37/38/39) that forceimportBlockUri == null.
1.9.6 #
Bug fixes (empty-Set default coercion) #
- GEN-SET — a
Setparameter whose default was a bareconst {}(e.g.TomCommandParser({Set<String> additionalCommands = const {}}),ParsedCommand({Set<String> flags = const {}})) emitted the default unchanged. Dart parses bareconst {}as an empty Map (static typeObject), so the generated constructor call failed withargument_type_not_assignable("The argument type 'Object' can't be assigned to the parameter type 'Set
1.9.5 #
Bug fixes (AOT-only bridge compile defects) #
Two defects surfaced by tom_core_d4rt's bridge corpus, visible only at
dart compile exe (masked from dart analyze by the generated
ignore_for_file header):
- B3b — generic methods whose callback parameter returns the method's
own type parameter (e.g.
FutureOr<T> Function(MySQLConnection)inMySQLConnectionPool.withConnection<T>/transactional<T>) failed withFutureOr<Object?> Function(X) can't be assigned to FutureOr<Object> Function(X): the callback wrapper resolvesTtoObject?but generic inference picked a non-nullableObject. The generated method call now pins explicit type arguments (each parameter's bound, orObject?when unbounded) via_methodCallTypeArgswhen a function-typed parameter references the method type parameter, bypassing inference. - B4 — package-URI resolution used a hardcoded sub-workspace
searchDirslist that omitteddistributed/, sopart offiles in packages outside that list were imported directly ("has a 'part of' declaration"). Resolution now goes through.dart_tool/package_config.json(_packageRootSync) first, covering every package in the resolution graph, with the directory scan kept as a fallback.
Also removes leftover GEN-060 debug prints. Adds the G-CB-13 regression test.
1.9.4 #
- Housekeeping: test artifacts now live in a gitignored
testlog/folder;doc/no longer ships machine-generated baselines or last_testrun.json. No code changes.
1.9.3 #
Generated-code hygiene #
- Emit expanded
// ignore_for_file:headers in generated*.b.dartbridges so generated bridge corpora (includingtom_d4rt_flutter) are analyzer-clean without per-file hand edits.
Documentation #
- Consolidated proxy/relaxer manual-intervention guidance into
doc/user_proxy_relaxer_annotations.mdand the MCI baseline docs; README aligned with the source-primary documentation reframe.
1.9.2 #
Generator features #
- Annotation-driven proxy/relaxer directive core + scanner (
@D4rtUserProxy/@D4rtUserRelaxer) with a variant-pattern engine. - Template families: B3 generic-constructor reifiers, A4 RenderBox-proxy, super-constructor-arg capture factories, generic-type-arg proxy variants, State-proxy mixin variants, generic interceptor re-dispatch.
genericInterceptorsconfig wired intoBridgeConfig; VM↔web signature-skew coercion table.yieldVoidCallbacksswitch for cooperative input/frame yield (OPEN B.14): void callback wrappers emitted as async closures awaiting a 1ms delay.- Per-symbol
@Deprecatedallowlist; opt-invector_math_64bridge.
Dependency #
- Require
tom_d4rt ^1.8.21.
1.9.1 #
Fix — build_runner path emits a compiling dartscript.b.dart #
The build_runner / orchestrator code path previously produced a
dartscript.b.dart that could not compile, because:
- the delegating barrel (
<Module>Bridge) was missing thesubPackageBarrels()method the shared dartscript template calls unconditionally, and relaxers.b.dart(imported by the dartscript template whenever the config has modules) was never generated on the build_runner path.
Both halves are fixed: the orchestrator's delegating barrel now emits
subPackageBarrels() (primary package excluded, sub-package barrel URIs
listed), and the build_runner path now generates relaxers.b.dart —
falling back to a resolvable no-op stub (registerRelaxers() /
registerGenericConstructors()) when there are no extraction sites. The
standalone/CLI and build_runner paths now emit interchangeable
registration code. Covered by a new regression test
(test/build_runner_dartscript_compile_test.dart) that assembles the
build_runner artifacts and asserts dart analyze reports no errors.
1.9.0 #
Refactoring — summary-backed extraction migration (Phases 1–6) #
Completes the multi-phase migration from dual-path (AST + element) bridge
extraction to a single element-mode code path backed by analyzer .sum
summaries. See doc/summary_refactoring_plan.md for the full plan and
doc/baseline_summary_refactor.md for the regression oracle.
- Phase 1:
ElementModeExtractorreaches output parity with the legacy AST_ResolvedClassVisitor(type aliases, inheritance resolution, default values, metadata, inherited members, substitution). - Phase 2:
BridgeGeneratorroutes every package through the element walker by default; summary-cache stage runs before scanning so external deps resolve from.sumbundles. - Phase 3: Default-value rendering and annotation-arg serialization unit tests lock the extractor API.
- Phase 4:
ProxyGeneratormigrated to the shared element-mode path. - Phase 5:
UserBridgeScannermigrated toLibraryElementwalker; legacyRecursiveAstVisitor<void>path removed. - Phase 6: Deleted the AST extraction path entirely —
_ResolvedClassVisitor(~2,200 lines),_ClassVisitor,_ParsedClass, theuseLegacyAstWalkerdebug flag, andsummary_exclusion.dart.lib/src/bridge_generator.dartdropped from 16,678 → 13,602 lines (−3,076 lines vs the plan's ≥1,800-line target).TOM_D4RT_BRIDGE_USE_SUMMARIESenv-var scaffolding removed.
Maintenance #
- Update dependency on tom_d4rt 1.8.19 (type matching, enum handling, isSubtypeOf, stdlib fixes) — carried over from 1.8.24.
Compatibility #
- Public generator API is unchanged. Generated bridge output for
tom_d4rt_fluttermis byte-identical to the pre-migration baseline modulo theGenerated: <timestamp>header (per Phase 6 exit check). - All five consumers documented in
baseline_summary_refactor.md(flutterm, dcli, exec, dcli_exec, tom_d4rt) match their Phase 0 test baselines — no new regressions.
1.8.24 #
Maintenance #
- Update dependency on tom_d4rt 1.8.19 (type matching, enum handling, isSubtypeOf, stdlib fixes)
1.8.23 #
Bug Fixes #
- RC-2: Fix inline function types with type params (e.g.,
Object? Function(T)) — cast todynamicto bypass static type checking since analyzer expands typedef aliases to inline form which can't be cast back to the typedef - RC-2: This fixes the remaining 3,208 compile errors in flutter_relaxers.b.dart (total error reduction: 441,443 → 0)
1.8.22 #
Bug Fixes #
- RC-2: Comprehensive fix for generic constructor param type handling — reduced compile errors from 441K to 3K (99.3%)
- RC-2: Extended
_rc2SkipTypeswithFutureOr, type param names (T/E/K/V/R/S), and vector_math types - RC-2: Improved
isTypeParamTypedto detect types containing type params (e.g.,MessageCodec<T>) - RC-2: Fixed bounded type params —
Objectbound now correctly excludesdynamicfallback - RC-2: Add
!assertion for non-nullable params since extraction produces nullable values - RC-2: Proper type substitution and casting for params containing type params
1.8.21 #
Bug Fixes #
- RC-2: Fix nullable param passing in
_writeRC2Case()— add!assertion for required non-nullable params - RC-2: Add missing types to
_rc2SkipTypes(meta annotations, vector_math types not imported in relaxer output)
1.8.20 #
1.8.19 #
Bug Fixes #
- RC-2: Wire
registerGenericConstructors()andregisterRelaxers()into dartscript registration - RC-5: Fix 11 misleading comments in annotation filtering (actual: @internal/@visibleForOverriding/@mustBeOverridden only)
1.8.17 #
Features #
- GEN-100d: Auto-generate function typedef registrations from source
- GEN-083: Proxy/adapter class generator for abstract delegates (CustomPainter, CustomClipper, etc.)
- GEN-082: Setter
sourceFilePathfix + resolved 14 skipped and 3 failed tests - GEN-081: Generator now emits
isAssignablecallback inBridgedClassconstructors
Bug Fixes #
- GEN-100: Follow-up fix for secondary_classes_test failures
- Auto
dart pub getfor barrel resolution - Pass
d4rtImportfrom config ingenerateBridges() - Dart format cleanup
1.8.15 #
Bug Fixes #
- GEN-075: Fixed required nullable argument handling — generates null-safe parameter extraction
- GEN-076: Raised non-wrappable default threshold from 4 to 8 to reduce combinatorial explosion
1.8.14 #
Bug Fixes #
- GEN-077: Skip same-package re-exports to prevent duplicate bridge generation (e.g., Tween only in animation module)
- GEN-078: Collect deprecated non-function type aliases (e.g.,
MaterialStateProperty)
1.8.13 #
Added #
- GEN-074 (
bridge_generator.dart) — Added support for type aliases (non-function typedefs) bridging:- New
visitGenericTypeAliasin_ResolvedClassVisitorcollects type aliases liketypedef MaterialStateProperty<T> = WidgetStateProperty<T> - Generated
classAliases()method returns a map of alias name to target class name registerBridges()now automatically registers class aliases with the interpreter- Enables D4rt scripts to use type aliases like
MaterialStatePropertythat resolve to their target classes
- New
Tests #
gen074_type_alias_test.dart— Unit tests for type alias detection and code generation (8 tests)
1.8.12 #
Fixed #
- GEN-073 (
bridge_generator.dart) — AddedIteratorto the list of built-in types that don't need import prefixes. This fixes compile errors in generated code whereIterator<E>was incorrectly prefixed with Flutter imports (e.g.,$flutter_3.Iterator).
1.8.11 #
Fixed #
- GEN-072 (
bridge_generator.dart) — Fixed export detection bug where a direct export (no show/hide clause) didn't override a restrictive re-export from the same package when processed in wrong order. This caused classes like Flutter'sCurvesto be incorrectly marked as "not exported from barrel file" even though they were directly exported. The fix addsisCurrentMorePermissive && !isExistingMorePermissivecheck toshouldOverridelogic.
Added #
gen072_permissive_override_test.dart— Unit tests for GEN-072 fix, verifying permissive exports override restrictive same-package re-exports.
1.8.10 #
Fixed #
- GEN-071 (
bridge_generator.dart) — Fixed required nullable parameters incorrectly rejecting null values. Parameters marked asrequired+ nullable now correctly accept explicit null.
1.8.8 #
Added #
bridge_generator.dart— Dynamic member dispatch for ~24 Flutter access-restricted members (e.g.initState,dispose,build,activate) using(t as dynamic).memberfallback to avoid compile errors in generated bridge code.bridge_generator.dart— Protected override filtering: skips unannotated overrides of protected/visibleForTesting base methods.bridge_generator.dart— Extendedignore_for_filedirective withimplementation_imports,sort_child_properties_last,non_constant_identifier_names,avoid_function_literals_in_foreach_calls.file_generators.dart— Addedignore_for_file: avoid_printto generated test runner files.
Fixed #
- Callback wrapper return cast: only skips redundant
as Object?cast when original return type isdynamic/Object/Object?, preventing type errors on typed callbacks.
1.8.5 #
Added #
bridge_config.dart— Newd4rtImportfield onBridgeConfigto configure the D4rt runtime import path. Defaults topackage:tom_d4rt/d4rt.dart. Enables generating bridges for alternative runtimes (e.g.package:tom_d4rt_exec/d4rt.dart).d4rtgen_tool.dart— AddedworksWithNatures: {DartProjectFolder}to tool definition.
Changed #
bridge_generator.dart— Uses configurabled4rtImportinstead of hardcodedpackage:tom_d4rt/d4rt.dartimport.file_generators.dart— Dartscript file generator usesconfig.d4rtImportfor the runtime import.per_package_orchestrator.dart— Minor formatting cleanup.d4rtgen_executor.dart— Minor formatting cleanup.- Renamed
version.g.dart→version.versioner.dart.
1.8.4 #
Bug Fixes #
- GEN-070: Fixed barrel export bug for multi-chain re-exports — when a symbol is exported through multiple barrel chains (e.g.,
Findclass via direct dcli_core export AND indirect find.dart re-export), the show clauses are now unioned instead of the second chain being blocked by the visited set
Tests #
- Added
gen070_reexport_show_test.dartwith 3 tests for multi-chain re-export scenarios - All 464 tests pass
1.8.3 #
Architecture #
- v2 ToolRunner migration: Refactored d4rtgen CLI to use v2 ToolRunner framework (
D4rtgenTool,D4rtgenExecutor) for better code organization and testability
Bug Fixes #
- GEN-064: Fixed duplicate extension keys in generated bridge files — extensions are now deduplicated by fully qualified key before generation
- GEN-065: Fixed type resolution for cross-file references — types defined in one file but used in another now correctly resolve prefixes
- GEN-066: Fixed extension target resolution when the target type is parameterized with types from other files
- GEN-067: Fixed resolution of types in generic bounds that reference cross-file definitions
- GEN-068: Fixed method return type resolution when the return type is from a different source file than the method declaration
- GEN-069: Fixed parameter type resolution for callbacks and function types that reference cross-file types
Tests #
- Added
cross_file_type_resolution_test.dartwith 132 lines of new test coverage - Added
d4rtgen_traversal_test.dartwith 236 lines validating v2 traversal logic - All 461 tests pass
1.8.1 #
Bug Fixes #
- GEN-058: Fixed nullable generic type resolution — types like
List<RuntimeType>?now correctly retain the?suffix when resolved through_resolveGenericTypeWithPrefixes - GEN-059: Fixed extension filtering — extensions whose target type (
onTypeName) isn't among bridged classes/enums or built-in types are now filtered out before generation, preventing runtime errors for unresolvable extension targets - Multi-barrel registration: Added
subPackageBarrels()static method to bridge classes and registration loop in dartscript.b.dart. This enables imports likeimport 'package:dcli_core/dcli_core.dart'to work when the primary package isdcli— the module loader now finds content under sub-package URIs - Content-based barrel filtering:
getImportBlock()andsubPackageBarrels()now use content-based filtering (derived from actual bridged class/enum/function/extension source URIs) instead of type-reference-based filtering. This prevents including packages that are only type-referenced but not bridged (e.g., crypto with skipReExports)
1.8.0 #
Architecture #
- Direct source file imports: Generator now imports source files directly (
import 'package:<pkg>/<path>.dart' as $<pkgname>_<N>) instead of relying solely on barrel exports. This resolves issues with types not being accessible through barrel files and eliminates prefix collisions across packages.
Bug Fixes #
- GEN-055/056: Fixed type dependency resolution and extension on-type URI resolution for cross-package types
- GEN-057: Fixed return type bridging and prefix stripping in API surface dependencies — return types now correctly use the source file's own import alias
- Part-of files: Fixed prefix resolution for
part offiles and extensions whose on-type comes from a different package - G-DCLI-05/07/08/11/12/13/14: All DCli bridge issues resolved — show/hide clause propagation, callback bridging, and DCli-specific type handling
Tests #
- Updated 46 test expectations to match new direct source import generation patterns (
$<pkgname>_<N>prefixes andD4.callInterpreterCallback) - All 444 tests pass
1.7.0 #
Bug Fixes #
- G-DCLI-07/11: Show/hide clause propagation: Fixed export parsing to properly propagate show/hide clauses when following re-exports. When a barrel file re-exports from another package with a
showclause (e.g.,export 'package:dcli_core/dcli_core.dart' show FindItem), nested exports now correctly filter symbols. This fixes cases where dcli'sfind()was incorrectly bridged from dcli_core (callback-based) instead of dcli's own version (returnsFindProgress).- Added
mergeWithParent()method toExportInfofor clause merging - Added
parentShowClause/parentHideClauseparameters toparseExportFiles() - Show clauses merge via intersection; hide clauses merge via union
- Added
1.6.1 #
Bug Fixes #
- SDK path detection: Compiled d4rtgen binaries now correctly locate the Dart SDK. The analyzer's default SDK detection fails for compiled binaries because
Platform.resolvedExecutablereturns the binary path instead of the Dart executable. Added_getSdkPath()method that checksDART_SDKenvironment variable first, then derives SDK fromdartin PATH (handles Flutter's embedded SDK structure).
1.6.0 #
Features #
- Record type support (G-TYPE-1, G-TYPE-2): Full support for Dart records as function parameters and return types. The generator emits inline conversion code:
- Parameters:
InterpretedRecord→ native Dart record at call sites - Returns: Native Dart record →
InterpretedRecordfor interpreter access - New helpers:
_isRecordType(),_parseRecordType(),_generateRecordParamExtraction(),_generateRecordReturnWrapper()
- Parameters:
Bug Fixes #
- G-TE-1: Added
sourceFilePathparameter to global function type resolution. Type bounds in generic parameters now resolve correctly for global functions. - G-TE-2: Fixed type erasure test expectations — import prefixes for non-barrel-exported types now correctly use auxiliary prefixes.
- G-OP-8: Fixed barrel export collision —
Pointclass now exports fromrun_static_object_methods.dart(which hasoperator ==,hashCode,toString) instead ofrun_constructors.dart. - GEN-045: Barrel name collision for constrained mixins resolved as side effect of G-OP-8 fix.
Tests #
- All 431 tests now pass (was 430 pass, 1 fail)
- Full dart_overview coverage suite validated
1.5.2 #
Bug Fixes #
- GEN-049: Extension methods on bridged classes from imported libraries are now discovered. The generator walks the import tree of each source file to collect extensions from imported packages. This enables D4rt scripts to call extension methods from packages like
package:collectionwhen they are in scope. - GEN-048: Pure
mixindeclarations are now bridged. Previously onlymixin classdeclarations were handled. Mixins are bridged as abstract classes without constructors, including their methods, getters, setters, and fields. - GEN-020: Global exclusions no longer merge across modules. Each module's exclusions now apply only to packages belonging to that module, preventing accidental cross-filtering.
- GEN-046: GlobalsUserBridge overrides now work correctly. Fixed example project annotations and method signatures. The generator already correctly wired up overrides—the issue was missing
@D4rtGlobalsUserBridgeannotations in user code. - GEN-007: Expanded
_knownFunctionTypeAliasesfrom 7 to ~50 common function type aliases. Now covers D4rt, Dart core, Flutter, and async package types for better function type detection in syntactic fallback. - GEN-009: Improved
_isGenericTypeParameter()heuristic to recognize multi-character type parameter patterns likeT1,T2,K2,V2andTValue,TOutput,TState, etc. Eliminates false "Missing export" warnings. - GEN-021: Verified this issue is already resolved — no builder-skip logic exists in the current codebase.
- GEN-011: Global function/variable generation counts now report actual values instead of hardcoded 0.
- GEN-013: Verified already resolved — approximate class count (files × 10) pattern no longer exists.
- GEN-019: Barrel preference now prioritizes primary barrel (
barrelImport) over same-package barrels for consistent$pkgprefix usage. - GEN-008: Expanded
mapPrivateSdkLibrary()from 6 to 20+ entries covering common SDK private libraries. Added optional warning callback for unknown libraries. - GEN-025: Enhanced record type resolution to handle named field groups
({int x, String y})and mixed positional/named fields. - GEN-027: Added explicit
InvalidTypehandling in_collectInfoFromDartType()to gracefully skip analyzer resolution failures.
New Features #
_collectExtensionsFromImports(): New function that walks library imports and collects visible extensionsvisitMixinDeclaration(): Added to both visitors to handle pure mixin declarations_getExclusionsForPackage(): New helper that returns exclusions scoped to a package's owning modules- Verbose mode shows
GEN-049: Discovered extension {name} on {type} from import {uri}messages
Example Fixes #
userbridge_override: Added missing@D4rtGlobalsUserBridgeand@D4rtUserBridgeannotationsuserbridge_override: FixedMyListUserBridgeoperator override signatures
Tests #
- Added
test/import_extension_discovery_test.dart— 5 tests for import-based extension discovery - Added
test/fixtures/external_extensions.dartandtest/fixtures/imports_external_extensions.darttest fixtures - Added
test/mixin_bridge_generation_test.dart— 12 tests for mixin bridging - Added
test/fixtures/mixin_test_source.darttest fixture with pure mixin declarations
1.5.1 #
Documentation #
- Config filename standardization: Updated all documentation references from
tom_build.yamltobuildkit.yaml. All CLI help text, README, user guides, and code comments now use the current filename.
Internal #
d4rt_gen.dart: CLI help text and print statements referencebuildkit.yaml_printBuildYamlSection(): UsesTomBuildConfig.projectFilenameconstantBuildConfigLoader: Updated doc comments
Dependencies #
- Updated
tom_build_baseto^1.3.2(buildkit.yaml references)
1.5.0 #
Features #
- Test infrastructure: New
testing.dartlibrary withD4rtTester— run D4rt test scripts that verify bridge correctness by executing DartScript code against real bridges. - D4rtTestResult: Structured pass/fail/skip/error results with detailed assertion messages for programmatic test evaluation.
- IssueTestHelper: Specialized test helper for writing regression tests against known generator issues (GEN-xxx).
- 94 D4rt test scripts: Comprehensive test coverage across 6 example projects — constructors, fields, methods, operators, generics, inheritance, parameters, async, enums, and UserBridge overrides.
- Test coverage documentation:
doc/test_coverage.mdwith feature inventory across 10 categories.
Refactoring #
- CLI scanning replaced with ProjectDiscovery: Eliminated ~200 lines of manual directory traversal in
d4rt_gen.dart, replaced withProjectDiscovery.resolveProjectPatterns()andscanForProjects()fromtom_build_base. - Removed dead CLI code: Deleted unused
d4rt_generator_cli.dart(274 lines) andcli.dartbarrel export. - Shared YAML utilities: Replaced private
_yamlToJson/_yamlListToJsoninBuildConfigLoaderwith sharedyamlToMap()fromtom_build_base.
Documentation #
- Expanded
doc/issues.mdto 46 documented issues (GEN-001 through GEN-046). - Added
doc/test_coverage.md— full bridge generator feature inventory with pass/fail status. - Added project-level
_copilot_guidelines/testing.md.
Dependencies #
- Updated
tom_build_baseto^1.2.0(addsyamlToMap/yamlListToListutilities).
1.4.0 #
Features #
- CLI: buildkit.yaml support: The
d4rtgenCLI now reads configuration frombuildkit.yamlfiles (in addition tobuild.yamlandd4rt_bridging.json), using the sharedtom_build_baseinfrastructure. - CLI: Multi-project and glob support:
--projectoption now accepts comma-separated lists and glob patterns (e.g.,--project=tom_*_builder,xternal/tom_module_*/*). - CLI:
--listflag: List discovered projects without generating bridges. - CLI: ProjectDiscovery integration: Proper scan vs recursive semantics — scans directories until a project boundary, recursive mode also looks inside projects for nested subprojects.
- Known issues documentation: Comprehensive
doc/issues.mddocumenting 30 known issues and limitations with concrete cause→effect examples from real generated bridge code.
Bug Fixes #
- Multi-barrel registration (GEN-030): Modules with multiple barrel files (e.g.,
dcli.dart+dcli_core.dart) now register bridges under ALL barrel import paths. Previously only the primarybarrelImportwas registered, causingSourceCodeException: Module source not preloaded for URIwhen scripts imported secondary barrels. - CLI export filtering params (GEN-028): CLI code path now passes
followAllReExports,skipReExports,followReExports, andexcludeSourcePatternsfrom module config to the generator. Previously these were silently ignored, causing the CLI to follow all re-exports regardless of configuration. - CLI global export filtering (GEN-029): CLI code path now filters global functions, variables, and enums by barrel export show/hide clauses, matching the build_runner path behavior. Previously the CLI would generate bridges for non-exported globals, causing compile errors.
- Import block for multi-barrel modules:
getImportBlock()now returns import statements for all barrel files, not just the primary barrel.
Dependencies #
- Added
tom_build_base: ^1.0.0as a pub.dev dependency (replaces path dependency).
Documentation #
- Added
doc/issues.mdwith 30 documented issues (GEN-001 through GEN-030) including concrete source→bridge→problem examples. - Updated
doc/d4rt_generator_cli_user_guide.mdwithbuildkit.yamlconfiguration and multi-project/glob support.
1.3.0 #
Features #
- Per-package bridge generation: Generate separate bridge files per package to improve code organization and enable deduplication
- Cross-package support: Package URI support for generating bridges that reference types from other packages
- Bridge deduplication: Automatic deduplication for enums, variables, and global functions with
sourceUritracking - Element-aware exclusions: Exclude specific elements by source file pattern
- Show/hide filtering: Filter enums, functions, and variables with show/hide lists
- Callback wrapping: Automatic wrapping of function-type parameters for proper bridge integration
- Improved dartscript generation: Generated file headers and stdlib imports in dartscript output
Bug Fixes #
- Fixed type erasure for complex generic types
- Fixed dartscript.dart generation for cross-package scenarios
- Fixed unwrappable defaults using combinatorial dispatch
- Fixed typedef callback wrapping
- Fixed auxiliary import resolution for complex dependency graphs
- Fixed Windows filename compatibility (renamed files with invalid characters)
Breaking Changes #
- Per-package generation is now the default behavior
- Generator output structure may differ from 1.2.x for multi-package projects
Internal #
- Consolidated duplicated file generation code into file_generators.dart
- Improved error aggregation for bridge registration failures
- Refactored type resolution for better accuracy
1.2.0 #
Features #
- GlobalsUserBridge: New override system for top-level global variables, getters, and functions
overrideGlobalVariableXxx- override global variable valuesoverrideGlobalGetterXxx- override global getters with lazy evaluation functionsoverrideGlobalFunctionXxx- override global function implementations
- Getter vs Variable distinction: Generator now correctly uses
registerGlobalGetterfor top-level getters (lazy evaluation) andregisterGlobalVariablefor constants/variables - Operator overrides enabled: Removed outdated skip for operator UserBridge overrides - operators are now fully supported
Documentation #
- Updated bridgegenerator_user_guide.md with GlobalsUserBridge documentation
- Updated bridgegenerator_user_reference.md with global override reference
- Added global overrides section to userbridge_override_design.md
1.1.2 #
Changes #
- Repository reorganization: Moved to tom_module_d4rt repository as part of modular workspace structure
- Updated repository URL to https://github.com/al-the-bear/tom_module_d4rt
- Package now published to pub.dev (removed
publish_to: none) - followReExports feature: Bridge generator can now follow re-exports from external packages
1.1.1 #
Fixes #
- Operator argument typing: Operator bridges now use
D4.getRequiredArg<T>()for properly typed argument extraction - This ensures type-safe operator implementations (e.g.,
operator+extractsotheras the correct type) - Affected operators:
[],[]=, and all binary operators (+,-,*,/,%,&,|,^,<<,>>,>>>,<,>,<=,>=,==)
1.1.0 #
Features #
- Operator bridging: Full support for all Dart operators (+, -, *, /, [], []=, ==, <, >, etc.)
- UserBridge override system: Selective method overrides via
*UserBridgecompanion classes extendingD4UserBridge - Override individual constructors, getters, setters, methods, and operators while generating the rest
Documentation #
- Added comprehensive operator override reference
- Added UserBridge override design documentation
1.0.1 #
- Fix: BuildRunnerFileWriter now writes directly to filesystem for
build_to: sourcecompatibility - This fixes
UnexpectedOutputExceptionwhen using build_runner integration
1.0.0 #
- Initial version.