Skip to content
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

V3: Removed indirection from asset graph #298

Merged
merged 1 commit into from
Jan 9, 2025
Merged

Conversation

alshdavid
Copy link
Contributor

@alshdavid alshdavid commented Jan 2, 2025

  • AssetNode and DependencyNode stored directly in the AssetGraph avoiding the need for external Vec<_> and tracking both the node_index and vec_index
  • AssetGraph only handle data storage and operation on the data structure are externalized and done at the call site.
  • Using **_idx naming convention for node indexes in the graph

@alshdavid alshdavid force-pushed the alsh/asset-graph-tidy branch 6 times, most recently from f72eb16 to ee85e3e Compare January 3, 2025 03:21
Copy link
Contributor Author

@alshdavid alshdavid Jan 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separated this into a dedicated function, removed recursion and removed the closure. I removed the closure because it's annoying to deal with move semantics in the closure - particularly as we refactor the request tracker approach in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is more a concern for the binding layer rather than of the AssetGraph itself. Extracted it into a function, should probably move it into node_bindings

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a lot of serialisation baked into the core types already, but it can go in either location 🤷

Copy link
Contributor Author

@alshdavid alshdavid Jan 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying to keep this data structure focused on being a holder of data and minimize manipulation of that data in methods.

Essentially, this is just a graph with add/get methods, consumers decide what to do with the data so the details of manipulations to the data live at the call site

@alshdavid alshdavid force-pushed the alsh/asset-graph-tidy branch from 9d32054 to 6950a0f Compare January 8, 2025 02:10
@alshdavid alshdavid marked this pull request as ready for review January 8, 2025 02:11
@alshdavid alshdavid force-pushed the alsh/asset-graph-tidy branch from 6950a0f to 9f71dd0 Compare January 8, 2025 06:49
}

first_asset
}
Copy link
Contributor Author

@alshdavid alshdavid Jan 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The AssetGraph looks like:

root -> (n) dependency -> (n) asset (entry)

This will walk the graph and find the first asset which should be the entry asset

@alshdavid alshdavid merged commit 7e9e0e6 into main Jan 9, 2025
17 checks passed
@alshdavid alshdavid deleted the alsh/asset-graph-tidy branch January 9, 2025 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants