-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
fix: have rendered blocks render themselves on construction #7355
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change itself seems fine, but it seems like #5146 still has more work to be done but this PR says it closes it. For example, you did not remove the TODO comment on the initBlock
function in serialization/blocks
. Which makes sense, because in #5146 you said you want to refactor the serialization system so that it does not need to do checking based on whether the block is rendered or not. Are you still planning on addressing that? If not could you remove the todo comment and if so could you update this PR so it doesn't say it's closing that issue?
Also, there are a lot of places in core where we still call initSvg
and then render
/ queueRender
. Are you planning to update those as well? If not in this PR, could you file an issue for that if one doesn't exist?
Ah yeah you're right, I should have marked this as "work on", not closing. I'm planning to punt on fully cleaning up
Gosh darn it :P I was trying to do too many things at once yesterday. I checked for references on devsite but not other places in core haha. So still need to:
Please tell me if there's anything I'm forgetting again! |
This ran into problems because having the constructor call So we're going to refactor That means that for v10.1 I'm going to open up a different PR dedeprecating |
The basics
npm run format
andnpm run lint
The details
Resolves
Work on #5146
Proposed Changes
Makes it so that BlockSvgs automatically render themselves when they are constructed.
Reason for Changes
Before this change external devs needed to call
initSvg
andrender
on their blocks if they were instantiating them viaworkspace.newBlock
. But I deprecatedrender
recently. This makes it so callingrender
is no longer necessary.Test Coverage
Tested that loading the spaghetti code, and instantiating via
newBlock
both worked as expected.Documentation
N/A
Additional Information
I decided to have these queue the render instead of rendering immediately. External devs calling
render
currently will trigger the immediate render, so this is non-breaking. And this way they can properly switch to usingfinishQueuedRenders
.