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

Serialize UniqueId properties + support setting default property value in patches #437

Merged
merged 10 commits into from
Aug 16, 2024

Conversation

Dekkonot
Copy link
Member

As discussed in #435 and previously in #418, this allows us to specify the default value for properties using patches in rbx-reflector.

In addition to that, this PR also sets a default for Archivable and also reverts #327 and overrides their defaults instead. Since several of these properties are on Instance, this results in a very large change to the reflection database.

We can and should in the future make it so defaults are stored in a method that respects inheritance and encourage people to use ReflectionDatabase::find_default_property to find defaults. The reason I'm not doing it at this moment is that historically people haven't had to care about inheritance to get defaults. Though it's not a breaking change, I feel like we should give some warning if we change it so they have to, especially for critical things like Archivable.

Copy link
Member

@kennethloeffler kennethloeffler left a comment

Choose a reason for hiding this comment

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

Well, I'm not jazzed about how complex the code to propagate default values to all subclasses ended up (nor the additional space it uses), but I agree with the reasoning for why. Just a couple comments:

patches/instance.yml Show resolved Hide resolved
rbx_reflector/src/patches.rs Outdated Show resolved Hide resolved
@Dekkonot
Copy link
Member Author

Yeah I'm not super jazzed either, but it's what we gotta do for now because the other option is committing to a broader change. We should probably prioritize it, but I don't think it's worth crying over right now.

@kennethloeffler kennethloeffler changed the title Support overriding default value for properties with patches Serialize UniqueId properties, add default property value patches Aug 16, 2024
@kennethloeffler
Copy link
Member

Last thing: I've edited the PR's title to mention that it's making UniqueId props serialize again, since we've had problems with UniqueId in the past. If this title isn't quite to your liking feel free to change it

@Dekkonot Dekkonot changed the title Serialize UniqueId properties, add default property value patches Serialize UniqueId properties + support setting default property value in patches Aug 16, 2024
@Dekkonot Dekkonot merged commit 99b73cc into rojo-rbx:master Aug 16, 2024
2 checks passed
@Dekkonot Dekkonot deleted the set-default-database branch August 16, 2024 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants