-
Notifications
You must be signed in to change notification settings - Fork 15
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
Remove BlockBase.parent and BlockBase.next properties #45
Comments
/cc @PullJosh for your thoughts on this. Also @towerofnix, |
Removing both makes sense. 👍 |
@adroitwhiz Yep! It's safe to remove parent and next. I was slightly concerned about "next" but that block link is calculated by |
@adroitwhiz Do you think it still makes sense to remove these relational properties? It's worth noting that it will have an influence on how "mutation" functions are written (for lack of a proper term, currently) — any function which performs static analysis and replaces input blocks with an equivalent but different set. (We don't have any of those yet, and maybe we won't include any as built-in behavior, but sb-edit is ostensibly about manipulating projects including blocks, so it's worth considering for the sake of library-consuming code too. By removing |
I think removing these would actually make it much easier to manipulate block stacks. It might even open up the possibility of placing the same block object in multiple stacks at once, which you can't do right now. |
Sure thing! I think the styles it rules out forces you into much cleaner ones as a consequence, which is a win in my books 📦 |
Currently, the
BlockBase
class has the propertiesparent
andnext
, which appears to be the IDs of its parent block and the next block in the stack respectively.They don't appear to be used anywhere in the export code, and could make it much harder to manipulate the block tree.
It looks like they're modeled after the SB3 JSON structure, but given that
sb-edit
's API has already deviated from SB3, it's unnecessary to have them. Can/should these properties be removed?The text was updated successfully, but these errors were encountered: