Skip to content

Commit

Permalink
refactor!: 450 - finalizing the breaking changes (#656)
Browse files Browse the repository at this point in the history
Deleted files:
* `page.dart`: deprecated from 2022-04-20
* `product_list_query_configuration.dart`: deprecated from 2022-08-03
* `to_be_completed_configuration.dart`: deprecated from 2022-08-03

Impacted files:
* `image_helper.dart`: removed code deprecated from 2022-08-18, and so we can get rid of package `image`
* `insight.g.dart`: generated
* `nutriments.dart`: removed 1655 (!) lines of code deprecated from 2022-10-04 - it was not urgent but now seemed a good opportunity
* `nutriments_helper.dart`: removed code deprecated from 2022-10-04 - it was not urgent but now seemed a good opportunity
* `open_food_api_client.dart`: removed code deprecated from 2022-01-22 and 2022-07-26
* `openfoodfacts.dart`: removed export deprecated from 2022-04-20
* `product.dart`: fixed typo
* `product.g.dart`: generated
* `pubspec.yaml`: removed deprecated dependency on `image`; upgraded versions
* `README.md`: added info about how to deal with 2.x.x breaking changes
  • Loading branch information
monsieurtanuki committed Dec 26, 2022
1 parent d05d49c commit c8e8e37
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 1,919 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,20 @@ You can find automated code documentation here: [Documentation](https://openfoo
- If you can't get the information on a specific product, you can get your user to send photos and data, that will then be processed by Open Food Facts AI and contributors to get the computed result you want to show them.
- You can also implement the complete flow so that they get immediately the result with some effort on their side.

## Main fixes to apply when dealing with 2.x.x breaking changes.

* Now the only entry point is `import 'package:openfoodfacts/openfoodfacts.dart';`
* replace all your instances of `import 'package:openfoodfacts/...';` with a single `import 'package:openfoodfacts/openfoodfacts.dart';`
* If you used `State` from `product_state.dart`, you have to rename it to `ProductState`
* If you used `Level` from `nutrient_levels.dart`, you have to rename it to `NutrientLevel`
* Removed deprecated classes:
* `Page`
* `ProductListQueryConfiguration`
* `ToBeCompletedConfiguration`
* Removed deprecated fields and methods in `Nutriments`
* _all_ the single nutrient value _fields_ were removed - use `getValue` and `setValue` instead
* instead of `getUnit` use `nutrient.typicalUnit`

## Contributing

### If your users do not expect a specific result immediately (eg. Inventory apps)
Expand Down
1 change: 0 additions & 1 deletion lib/openfoodfacts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ export 'src/model/user_agent.dart';
export 'src/model/parameter/allergens_parameter.dart';
export 'src/model/parameter/barcode_parameter.dart';
export 'src/model/parameter/ingredients_analysis_parameter.dart';
export 'src/model/parameter/page.dart';
export 'src/model/parameter/page_number.dart';
export 'src/model/parameter/page_size.dart';
export 'src/model/parameter/pnns_group2_filter.dart';
Expand Down
19 changes: 5 additions & 14 deletions lib/src/model/insight.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c8e8e37

Please sign in to comment.