-
Notifications
You must be signed in to change notification settings - Fork 25
Re:Hydration #54
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
base: master
Are you sure you want to change the base?
Re:Hydration #54
Conversation
Co-Authored-By: Serhii Khoma <srghma@gmail.com>
Co-Authored-By: Serhii Khoma <srghma@gmail.com>
Co-Authored-By: Serhii Khoma <srghma@gmail.com>
Co-Authored-By: Serhii Khoma <srghma@gmail.com>
Co-Authored-By: Serhii Khoma <srghma@gmail.com>
Co-Authored-By: Serhii Khoma <srghma@gmail.com>
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 <srghma@gmail.com>
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 |
Co-Authored-By: Serhii Khoma <srghma@gmail.com>
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 ""
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.
@purefunctor made a small optional pr into Your pr https://github.com/purefunctor/purescript-halogen-vdom/pull/1/files#diff-bc1f063505b67a8a522a55988b3085b23bb81b8f83155bf62cd8bf0df908cbdf using Your branch recreated halogen pr purescript-halogen/purescript-halogen#833 About TODOs:
|
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