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

docs: note about a silly edge case in the ssr guide #18628

Merged
merged 3 commits into from
Nov 11, 2024

Conversation

andriibeee
Copy link
Contributor

Description

This is just a mere heads up so people blindly copy-pasting the code from guide won't run in obscure hydration errors
The thing is String.prototype.replace function has a silly edge case where it can literally swallow a dollar and the remedy is just specifying a replacer function so it would ignore dollars and be less greedy
Note to reviewers: Please take the comment change with extra care bc i'm not rly sure i worded it properly

Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to use a function here to avoid the issue, but I don't think we need the additional comments to explain it. Or if you prefer explaining, I think it should be kept a short single-line comment explaining why.

@andriibeee
Copy link
Contributor Author

Makes sense to use a function here to avoid the issue, but I don't think we need the additional comments to explain it. Or if you prefer explaining, I think it should be kept a short single-line comment explaining why.

Oh yeah, makes sense, I'd prefer to get rid of the comment since I struggled with keeping it a single-liner when i originally posted that PR, people who concerned why there's a function are free to consult to MDN

@andriibeee andriibeee requested a review from bluwy November 11, 2024 10:10
@patak-dev patak-dev merged commit 584a573 into vitejs:main Nov 11, 2024
11 checks passed
@andriibeee andriibeee deleted the patch-1 branch November 11, 2024 20:54
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.

3 participants