Upgrading build 3 to 4
Breaking3.1.0 → 4.0.11Breaking2Platform2Deprecated1Changed8Fixed1Other3
BreakingUpgrade verdict
2 breaking changes and 2 platform requirement changes.
In plain terms
- Code that still uses older APIs marked obsolete in version 4.0.0 will no longer compile.
- Any custom AssetReader implementation must now provide its own digest method.
- You need Dart SDK version 3.11.0 or newer to use this version.
- You need Dart 3.8.0 or newer to use this version.
Must act 5 items need code or config changes
Dart SDK requirement changed in 4.0.8: ^3.7.0 → ^3.11.0.
What you must change
Breaking2
Removes methods and classes deprecated in 4.0.0.
Makes AssetReader.digest abstract.
AssetReader.digestPlatform2
Requires Dart 3.11.0.
Requires Dart 3.8.0.
Deprecations to plan for
Deprecated1
Replaces the Builder extension method hasOutputFor with matchesInput and deprecates hasOutputFor.
BuilderhasOutputFormatchesInputAPI changes
Generated by DepDelta from published Dart source. Not mixed with prose notes.
- removed:
class AssetWriterSpy implements AssetWriter - removed:
class MultiplexingBuilder implements Builder - removed:
ctor AssetWriterSpy(this._delegate) - removed:
ctor MultiplexingBuilder(this._builders) - removed:
function runBuilder( Builder builder, Iterable<AssetId> inputs, AssetReader assetReader, AssetWriter assetWriter, Resolvers? resolvers, { Logger? logger, ResourceManager? resourceManager, build_runner_core.StageTracker? stageTracker, void Function(AssetId input, Iterable<AssetId> assets)? reportUnusedAssetsForInput, PackageConfig? packageConfig, }): Future<void> - removed:
function runPostProcessBuilder( PostProcessBuilder builder, AssetId inputId, AssetReader reader, AssetWriter writer, Logger logger, { required void Function(AssetId) addAsset, required void Function(AssetId) deleteAsset, }): Future<void> - removed:
get AssetWriterSpy.assetsWritten: Iterable<AssetId> - removed:
get MultiplexingBuilder.buildExtensions: Map<String, List<String>> - removed:
method AssetWriterSpy.writeAsBytes(AssetId id, List<int> bytes): Future<void> - removed:
method AssetWriterSpy.writeAsString( AssetId id, String contents, { Encoding encoding = …, }): Future<void> - removed:
method MultiplexingBuilder.build(BuildStep buildStep): FutureOr<void> - removed:
method MultiplexingBuilder.toString(): String - changed:
ctor AssetId.deserialize(List<dynamic> data) → ctor AssetId.deserialize(List<dynamic> serialized) - changed:
ctor AssetId.parse(String description) → ctor AssetId.parse(String id) - changed:
field SyntaxErrorInAssetException.filesWithErrors: final List<AnalysisResultWithErrors> → field SyntaxErrorInAssetException.filesWithErrors: final List<AnalysisResultWithDiagnostics> - changed:
get BuildStep.inputLibrary: Future<LibraryElement2> → get BuildStep.inputLibrary: Future<LibraryElement> - changed:
get Resolver.libraries: Stream<LibraryElement2> → get Resolver.libraries: Stream<LibraryElement> - changed:
get SyntaxErrorInAssetException.errorToResult: Map<AnalysisError, AnalysisResultWithErrors> → get SyntaxErrorInAssetException.errorToResult: Map<Diagnostic, AnalysisResultWithDiagnostics> - changed:
get SyntaxErrorInAssetException.syntaxErrors: Iterable<AnalysisError> → get SyntaxErrorInAssetException.syntaxErrors: Iterable<Diagnostic> - changed:
method Resolver.assetIdForElement(Element2 element): Future<AssetId> → method Resolver.assetIdForElement(Element element): Future<AssetId> - changed:
method Resolver.findLibraryByName(String libraryName): Future<LibraryElement2?> → method Resolver.findLibraryByName(String libraryName): Future<LibraryElement?> - changed:
method Resolver.libraryFor( AssetId assetId, { bool allowSyntaxErrors = …, }): Future<LibraryElement2> → method Resolver.libraryFor( AssetId assetId, { bool allowSyntaxErrors = …, }): Future<LibraryElement> - added:
method BuildOutputExtensions.matchesInput(AssetId input): bool - added:
method BuildStep.canRead(AssetId id): Future<bool> - added:
method BuildStep.findAssets(Glob glob): Stream<AssetId> - added:
method BuildStep.readAsBytes(AssetId id): Future<List<int>> - added:
method BuildStep.readAsString(AssetId id, {Encoding encoding = …}): Future<String>