Skip to content

Upgrading package_config 2 to 3

Breaking2.2.0 → 3.0.0Breaking3Deprecated1New2Changed1

BreakingUpgrade verdict

3 breaking changes.

  • The package no longer reads the old .packages file format. Only the newer package_config.json format is supported.
  • The function for reading a configuration file has a new name and no longer takes the preferNewest option.
  • The function for reading a configuration file URI has a new name and no longer takes the preferNewest option.
  • The old function names still work but are deprecated and ignore the preferNewest option.
4 items need code or config changes

Dart SDK requirement changed in 3.0.0: ^3.4.0 → ^3.11.0.

Breaking3
Removes support for the .packages file, which the Dart SDK no longer supports or generates.
.packages
Renames readAnyConfigFile to readConfigFile and removes the preferNewest parameter.
readAnyConfigFilereadConfigFilepreferNewest
Renames readAnyConfigFileUri to readConfigFileUri and removes the preferNewest parameter.
readAnyConfigFileUrireadConfigFileUripreferNewest
Deprecated1
Keeps the old readAnyConfigFile and readAnyConfigFileUri functions as deprecated, forwarding to the new functions without preferNewest.
readAnyConfigFilereadAnyConfigFileUripreferNewest