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

rbx_reflection: Superclass Iterator #448

Merged
merged 11 commits into from
Sep 30, 2024
Merged

Conversation

krakow10
Copy link
Contributor

I thought it was weird that database.superclasses() returns a Vec rather than an iterator, perhaps it should be replaced or supplemented by something like this?

Copy link
Member

@Dekkonot Dekkonot left a comment

Choose a reason for hiding this comment

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

I'm open to this conceptually, but not with the provided implementation; I've left a review of it.

In the future, try to open issues before making a pull request so we can determine if something is even something we want to do.

rbx_reflection/src/database.rs Outdated Show resolved Hide resolved
rbx_reflection/src/database.rs Show resolved Hide resolved
@Dekkonot
Copy link
Member

Would love a test (nothing too complicated, just enough to verify it works and includes the starting value and the ending values), and this needs a changelog entry.

Otherwise, it looks good now.

@krakow10
Copy link
Contributor Author

I'm open to this conceptually, but not with the provided implementation; I've left a review of it.

In the future, try to open issues before making a pull request so we can determine if something is even something we want to do.

I figure suggesting an idea with code is better since it can be immediately iterated upon. You're saying I should post a patch as a comment? Or push to my fork and link the branch maybe?

Thanks for the review, the code I had was rather tragic.

@Dekkonot
Copy link
Member

What I mean is that you got lucky with this PR! There's a chance that I would have just said "no" and closed it, and your effort would've been wasted.

In the interest of everyone's time, I'd prefer we have issues where we at least go "yeah ok" before implementing things so that nobody's time is wasted.

@krakow10
Copy link
Contributor Author

krakow10 commented Sep 21, 2024

There's a chance that I would have just said "no" and closed it, and your effort would've been wasted.

An acceptable loss to me 😃

My mind's compiler says this implementation would miss the final ClassDescriptor ("Instance"). My first implementation before the PR would have missed the first one (the descriptor passed to the function), which I resolved by making the descriptor optional, hence the compilation mistake. I will look around the code and see what I can do about writing a test.

@krakow10
Copy link
Contributor Author

krakow10 commented Sep 21, 2024

My mind's compiler says this implementation would miss the final ClassDescriptor ("Instance")

I was correct. Here is a version that works, doesn't look horrible, and has a nice test.

@krakow10
Copy link
Contributor Author

krakow10 commented Sep 21, 2024

Side question... why does the superclasses function return an Option<Vec<_>> instead of just Vec<_>?

@Dekkonot
Copy link
Member

Dekkonot commented Sep 26, 2024

Side question... why does the superclasses function return an Option<Vec<>> instead of just Vec<>?

Honest answer: It used to accept a &str as an argument and then I forgot to change it from a Option<Vec<_>> to a Vec<_>. I'm going to pretend that it's because you could construct a ClassDescriptor that doesn't exist in the database though, since that feels like it's more deliberate and makes sense. ;)

Copy link
Member

@Dekkonot Dekkonot left a comment

Choose a reason for hiding this comment

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

Good enough. Thanks for the contribution!

@Dekkonot Dekkonot merged commit a9252ac into rojo-rbx:master Sep 30, 2024
3 checks passed
@krakow10 krakow10 deleted the superclass_iter branch September 30, 2024 01:23
@krakow10
Copy link
Contributor Author

Is it also a good enough time for a release? I'm hoping to drop the patched packages I've been maintaining now that UTF8 conversion is merged.

@Dekkonot
Copy link
Member

Dekkonot commented Oct 2, 2024

I can make a new release in a few days if it's necessary; I generally don't cut them until we need them, but if it's a blocker for you I can make it a priority.

@krakow10
Copy link
Contributor Author

krakow10 commented Oct 2, 2024

All my packages are compiling fine, so it'd just be a convenience to me. You're welcome to release whenever you feel is best.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants