Skip to content

Update shipyard requirement from 0.7 to 0.8 #126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

dependabot[bot]
Copy link

@dependabot dependabot bot commented on behalf of github Apr 1, 2025

Updates the requirements on shipyard to permit the latest version.

Release notes

Sourced from shipyard's releases.

Shipyard 0.8

Shiperator is back

A long time ago in a galaxy not that far away... Shipyard had a Shiperator trait. This trait was a copy of std's Iterator. The problem it solved was filter iteration over storage tracking modification. filter iterates through all elements before applying the filter. This is important because back then components were flagged for modification as soon as the reference was created, before the filter ran. That meant all components would get flagged. To prevent that, Shiperator returned a shipyard::Filter. It was aware of tracking and didn't flag filtered out components. Shiperator was then removed when Mut was introduced. Instead of flagging component immediately, they only get flagged when Mut is dereferenced.

iter module rework

One of the main goal of this rework was to enable custom views and built-in views iteration.

Example:

use shipyard::{Borrow, Component, IntoIter, View, World};
#[derive(Component)]
struct FlightSpeed;
#[derive(Component)]
struct HasHorn;
#[derive(Component)]
struct IsFrozen;
#[derive(Borrow, IntoIter)]
struct PegasusView<'v> {
v_flight_speed: View<'v, FlightSpeed>,
v_has_horn: View<'v, HasHorn>
// Could have multiple other fields
}
fn main() {
let mut world = World::new();
world.add_entity((FlightSpeed, HasHorn, IsFrozen));
world.run(|v_pegasus: PegasusView, v_is_frozen: View&lt;IsFrozen&gt;| {
// Here we want to iterate over entities that have all FlightSpeed, HasHorn and IsFrozen components
for (pegasus, is_frozen) in (&amp;v_pegasus, &amp;v_is_frozen).iter() {
let _: (Pegasus, &amp;IsFrozen) = (pegasus, is_frozen);
}
});

}

(&v_pegasus, &v_is_frozen).iter() this iterator didn't work in v0.7. It was possible to iterate multiple built-in views OR a custom view but not both.

Some traits that I used to know

... (truncated)

Commits
  • 57e8ed8 Switch shipyard proc to crates.io
  • 7ad064f Switch guide version in README from 0.7 to 0.8
  • 49029d9 Bump shipyard version to 0.8
  • 745b260 Bump shipyard proc version to 0.5
  • d5e5835 Duplicate guide for 0.8
  • 9e9d025 Update wasm pack for bunny demo
  • ed372f4 Fix slice iteration
  • 3fdbcf7 Refactor exports
  • 4db4fbf Add extended_tuple cargo feature
  • f1a4c87 Fix internal macro names
  • Additional commits viewable in compare view

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Updates the requirements on [shipyard](https://github.com/leudz/shipyard) to permit the latest version.
- [Release notes](https://github.com/leudz/shipyard/releases)
- [Changelog](https://github.com/leudz/shipyard/blob/master/release-check-list.md)
- [Commits](leudz/shipyard@v0.7.0...v0.8.0)

---
updated-dependencies:
- dependency-name: shipyard
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file rust Pull requests that update rust code labels Apr 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file rust Pull requests that update rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants