Skip to content

Upgrading build_runner 1 to 2

Breaking1.12.2 → 2.17.1Breaking8Security3Platform2New22Changed67Fixed58Other24

Fetching 78 releases from GitHub…44 / 78
BreakingUpgrade verdict

8 breaking changes and 2 platform requirement changes and 3 security fixes.

  • A command-line option for reducing memory use is gone, since the tool now uses less memory by default.
  • Two command-line options for measuring performance are removed; use `--dart-aot-perf` instead.
  • build_runner no longer asks you to confirm file deletions.
  • Files are now always deleted without needing the `-d` flag.
Top 5 of 13 that need code or config changes

Dart SDK requirement changed in 2.15.2: >=2.11.99 <3.0.0 → ^3.11.0.

Breaking8
Removes the --low-resources-mode flag because default memory usage has improved.
--low-resources-mode
Removes the --log-performance and --track-performance flags.
--log-performance--track-performance--dart-aot-perf
Removes interactive prompts asking whether to delete files.
Ignores the -d flag and always deletes files as if -d was passed.
-d
Removes the --use-polling-watcher flag.
--use-polling-watcher
Removes the $graph and $perf handlers from build_runner serve mode.
build_runner serve$graph$perf
Paths given to --build-filter with --workspace now apply to the current package, not the workspace root.
--build-filter--workspacepackage:asset:
Removes undocumented and unused features: lib/build_script_generate.dart, bin/graph_inspector.dart, and two build_runner commands.
lib/build_script_generate.dartbin/graph_inspector.dartbuild_runner doctorbuild_runner generate-build-script
Security3
The serve command rejects non-loopback Host and Origin headers when bound to loopback, and validates them against --hostname.
serveHostOrigin--hostname
The daemon asset server now rejects various non-local connections.
daemon
serve live reload websocket checks for localhost origin.
serve
Platform2
Requires Dart 3.11.0.
Requires Dart 3.8.0.