Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add API to Renderer to trigger a UI refresh on hot reload #30884
Add API to Renderer to trigger a UI refresh on hot reload #30884
Changes from all commits
55e88af
7311d25
eec977a
89b9b4b
ee77867
cebf3bf
b9e9b5a
faadec8
aea65f3
5bbe396
d9e3b4d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Is there any chance that a static constructor prevents the linker from removing the type? I would guess that static constructors may always have side effects and hence always have to be left in and will run.
It's probably not a big deal. I'll leave it up to you whether you think it's worth doing in a less convenient way!
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.
Actually I have no idea how smart the linker is about figuring out whether the static constructor would run or not.
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.
Static ctors are hard to trim away and guarantee correctness. I believe the only time a static ctor will be trimmed is if the whole type can be trimmed. Maybe also if it was
BeforeFieldInit
and all the static fields were removed?@vitek-karas and @MichalStrehovsky would know the exact rules here.
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.
I think the rule is basically:
BeforeFieldInit
then linker may trim it.cctor
is preserved only if there's a field preserved on the typeThere 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.
I was able to do some "fun" substitutions.xml to trim references to this type. Here's what the trimmed results look like now:
Removing the interface and the context is difficult because
ComponentBase
implements it. If we were determined we could turn the context in to aFunc<bool>
that would eliminate the context type.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.
Can we replace this with a property on
RenderHandle
? e.g.RenderHandle.IsHotReloading