-
Notifications
You must be signed in to change notification settings - Fork 17
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
Suggestion: Use Prettier to format the HTML #22
Comments
Yeah, could be a useful change to make! If you're feeling up for it, would love for you to make that contribution in a PR. Otherwise, I will try to take a stab at it down the line when I have some time. |
@samijaber Hi, would this be a good first issue/beginner issue? Wouldn't attempting it and try to help out! |
@lucaliebenberg go for it! |
@samijaber thanks, I shall give it a go! |
@samijaber hi Sam, I have cloned the repo and branched off. I have swapped out the beuatify usages and have replaced it with the prettier implementation similar to what @arthurdenner previously said. How am I able to open the PR, as it seems my git is denied |
not sure what issue you're facing, you should be able to use this view https://github.com/BuilderIO/hydration-overlay/compare to take your fork's branch and make a PR against the |
At work, I've built a solution to display server-side errors on the client using the
onRecoverableError
callback from React 18.I've extended that solution to display a diff on hydration errors based on this package, so thank you very much for sharing it.
A different approach I used was to format the HTML using
prettier
instead ofbeautify
. I was getting a lot of false positives withbeautify
due to different things like HTML comments (<!--$-->
), semicolons... So my diff was always huge. Usingprettier
, it's much smaller and there are only some false positives involving inline style attributes.It might be good to explore this approach for the library itself. Here is a code snippet:
The text was updated successfully, but these errors were encountered: