Skip to content

Refactor EventReader::iter to read#9631

Merged
alice-i-cecile merged 4 commits intobevyengine:mainfrom
SuchAndThings:eventreaderref
Aug 30, 2023
Merged

Refactor EventReader::iter to read#9631
alice-i-cecile merged 4 commits intobevyengine:mainfrom
SuchAndThings:eventreaderref

Conversation

@hate
Copy link
Copy Markdown
Contributor

@hate hate commented Aug 29, 2023

Objective

  • The current EventReader::iter has been determined to cause confusion among new Bevy users. It was suggested by @JoJoJet to rename the method to better clarify its usage.
  • Solves Rename EventReader::iter #9624

Solution

  • Rename EventReader::iter to EventReader::read.
  • Rename EventReader::iter_with_id to EventReader::read_with_id.
  • Rename ManualEventReader::iter to ManualEventReader::read.
  • Rename ManualEventReader::iter_with_id to ManualEventReader::read_with_id.

Changelog

  • EventReader::iter has been renamed to EventReader::read.
  • EventReader::iter_with_id has been renamed to EventReader::read_with_id.
  • ManualEventReader::iter has been renamed to ManualEventReader::read.
  • ManualEventReader::iter_with_id has been renamed to ManualEventReader::read_with_id.
  • Deprecated EventReader::iter
  • Deprecated EventReader::iter_with_id
  • Deprecated ManualEventReader::iter
  • Deprecated ManualEventReader::iter_with_id

Migration Guide

  • Existing usages of EventReader::iter and EventReader::iter_with_id will have to be changed to EventReader::read and EventReader::read_with_id respectively.
  • Existing usages of ManualEventReader::iter and ManualEventReader::iter_with_id will have to be changed to ManualEventReader::read and ManualEventReader::read_with_id respectively.

@alice-i-cecile alice-i-cecile added A-ECS Entities, components, systems, and events C-Usability A targeted quality-of-life change that makes Bevy easier to use M-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide labels Aug 29, 2023
@joseph-gio
Copy link
Copy Markdown
Member

Can you rename the methods for ManualEventReader too? Also, it would be good to add deprecated methods with the old names to ease migration.

@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Aug 29, 2023
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Aug 30, 2023
Merged via the queue into bevyengine:main with commit 42e6dc8 Aug 30, 2023
rdrpenguin04 pushed a commit to rdrpenguin04/bevy that referenced this pull request Jan 9, 2024
# Objective

- The current `EventReader::iter` has been determined to cause confusion
among new Bevy users. It was suggested by @JoJoJet to rename the method
to better clarify its usage.
- Solves bevyengine#9624 

## Solution

- Rename `EventReader::iter` to `EventReader::read`.
- Rename `EventReader::iter_with_id` to `EventReader::read_with_id`.
- Rename `ManualEventReader::iter` to `ManualEventReader::read`.
- Rename `ManualEventReader::iter_with_id` to
`ManualEventReader::read_with_id`.

---

## Changelog

- `EventReader::iter` has been renamed to `EventReader::read`.
- `EventReader::iter_with_id` has been renamed to
`EventReader::read_with_id`.
- `ManualEventReader::iter` has been renamed to
`ManualEventReader::read`.
- `ManualEventReader::iter_with_id` has been renamed to
`ManualEventReader::read_with_id`.
- Deprecated `EventReader::iter`
- Deprecated `EventReader::iter_with_id`
- Deprecated `ManualEventReader::iter`
- Deprecated `ManualEventReader::iter_with_id`

## Migration Guide

- Existing usages of `EventReader::iter` and `EventReader::iter_with_id`
will have to be changed to `EventReader::read` and
`EventReader::read_with_id` respectively.
- Existing usages of `ManualEventReader::iter` and
`ManualEventReader::iter_with_id` will have to be changed to
`ManualEventReader::read` and `ManualEventReader::read_with_id`
respectively.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ECS Entities, components, systems, and events C-Usability A targeted quality-of-life change that makes Bevy easier to use M-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants