-
Notifications
You must be signed in to change notification settings - Fork 25
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
Re:Hydration #54
base: master
Are you sure you want to change the base?
Re:Hydration #54
Conversation
Co-Authored-By: Serhii Khoma <[email protected]>
Co-Authored-By: Serhii Khoma <[email protected]>
Co-Authored-By: Serhii Khoma <[email protected]>
Co-Authored-By: Serhii Khoma <[email protected]>
Co-Authored-By: Serhii Khoma <[email protected]>
Co-Authored-By: Serhii Khoma <[email protected]>
This puts the various xProp functions inside buildProp at the module level to prepare for code-sharing with the hydrateProp implementation. Co-Authored-By: Serhii Khoma <[email protected]>
Up to 83b8772, the changes have been relatively simple as a lot of the shared code between rendering/hydration already exists at the module level. What's a little more difficult is implementing |
Basic.elem "div" [ "id" := "root" ] $ | ||
if isClient then [] | ||
else [ Basic.elem "span" [] [ Basic.text "Server!" ] ] | ||
expectError $ renderHydrate mismatch |
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 would also add a test
- if trying to hydrate
Basic.elem "div" [ "] [ Basic.text "1", Basic.text "2" ]
on<div>12</div>
then it will not throw error (bc it should splitTEXT_NODE "12"
onTEXT_NODE "1"
andTEXT_NODE "2"
- if trying to hydrate
Basic.elem "div" [ "] [ Basic.text "1", Basic.text "" ]
on<div>1</div>
then it will not throw error (bc it should add toTEXT_NODE "1"
theTEXT_NODE ""
Closes #37 and #38. This picks up on the awesome work done by @srghma on #38 with the goal of producing a smaller diff.
TODO
spec
andspec-mocha
cc: @garyb @natefaubion