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
chore: Add alert/flash content replacement runtime API #2647
chore: Add alert/flash content replacement runtime API #2647
Changes from all commits
a239e13
f1cc542
3fe30e7
49aee65
630e672
d48a512
8f48792
7680b0c
1d309e1
5c88b5d
e703307
fb6b140
85dd6fc
6b7303d
41c7be5
f6c3c7d
5ee57a0
55c5923
1b2a313
2b588f1
b7f37b1
417801c
45c4d2b
4696fe3
acd5f3e
681fe47
a0987e2
823c373
1ee7cc8
6a0e3c3
bbab06e
facfc6c
55af3ac
bd57707
ea6ff69
538df4b
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.
This unrelated state does not demonstrate the any issues, because all alert content is primitive strings. Try placing JSX in the first alert and see what happens
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 added content swap to test page. When set - the content between the first and the second alert swaps. I observed no issues with this.
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 provided specific steps to reproduce the issue:
You did not follow these steps and report you do not see the issue.
I am not sure what else I can do here. I surrender on this thread.
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.
Please clarify what is the issue I should see if placing JSX. The replacement is already JSX. If I use some
<Box>content</Box>
instead of'content'
that seems to work alright.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 is the issue
Screen.Recording.2024-09-12.at.10.23.37.mov
I would say changing the "unrelated state" should not trigger any updates, none of these console logs should be happening.
If you think it is fine, handling possible impact of this risk is on you.
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.
Thanks, it is clear now. I think this is inline with how React works. If the JSX is memoized with memo or useMemo - the behaviour is not observed.
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.
The consuming team may put some expensive code inside the
doRender
function. The quip proposal mentions there might be a network call there. Are we okay with that many network calls on unrelated state changes?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 means all existing
Alert
usage will have to be changed. I do not think it is a reasonable mitigation