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

Support nesting Parent #48

Merged
merged 4 commits into from
Feb 23, 2025
Merged

Support nesting Parent #48

merged 4 commits into from
Feb 23, 2025

Conversation

ewd3v
Copy link
Contributor

@ewd3v ewd3v commented Feb 5, 2025

This pull request adds the support to do nested Parent property writes and closes #47 , like this:

local frame: Frame = ...

create "TextLabel" {
    { Parent = frame }
}

This makes Parent property writes more consistent with other properties.

I also added tests to check for this as how it's supported is a little different from how other nested properties are implememented.
(I also included a fix for mock instances as the .Parent property was not a proxy when reading it, please review.)

I'm not sure the way I added this is the best way but it does work (I'm using the Cache object to store what instance it should be parented to).

This pr also makes Parent property get checked for duplicates at the same depth like other properties (was an easy fix and I'm assuming it's intended anyways, if not tell me and I'll remove this behaviour from the pr.)

@ewd3v ewd3v changed the title Support nested Parent property writes Support nesting Parent Feb 5, 2025
@centau centau merged commit 37e8e05 into centau:main Feb 23, 2025
1 check passed
@centau
Copy link
Owner

centau commented Feb 23, 2025

Thanks

@ewd3v ewd3v deleted the nested-parent branch March 9, 2025 23:38
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.

Nesting Parent does not work
2 participants