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

Add failing test for null hydration #3379

Merged
merged 1 commit into from
Sep 8, 2019

Conversation

eps1lon
Copy link
Contributor

@eps1lon eps1lon commented Aug 8, 2019

This is only a failing test for inconsistent server vs client side behavior for null children. For undefined both server and client stringify them but for null only the server stringifies them. The client removes children if it encounters null.

Would like to fix those but I would need to know who's at fault here: client, server or user and where a good starting point for fixing this would be.

@Rich-Harris Rich-Harris merged commit 12c667f into sveltejs:master Sep 8, 2019
@Rich-Harris
Copy link
Member

Thank you! This is a real edge case — it turns out that

text = document.createTextNode(null);

results in "null", but if you do

text.data = null

you get "". Go figure. The correct behaviour here would be for null to show up in both cases, so I've implemented that here: 3f33d35

@eps1lon eps1lon deleted the test/nil-hydrate branch September 9, 2019 10:45
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.

None yet

2 participants