@@ -86,6 +86,8 @@ import Reflex.Dom.Builder.Class
8686import Reflex.Dom.Builder.Immediate hiding (askEvents, askParent, append, wrap, makeElement, textNodeInternal, traverseIntMapWithKeyWithAdjust', traverseDMapWithKeyWithAdjust', hoistTraverseWithKeyWithAdjust, hoistTraverseIntMapWithKeyWithAdjust, drawChildUpdate, ChildReadyState(..))
8787import Reflex.Dynamic
8888import Reflex.Host.Class
89+import Reflex.Patch.DMapWithMove (PatchDMapWithMove(..))
90+import Reflex.Patch.MapWithMove (PatchMapWithMove(..))
8991import Reflex.PerformEvent.Class
9092import Reflex.PostBuild.Class
9193import Reflex.Requester.Base
@@ -112,6 +114,7 @@ import qualified GHCJS.DOM.Text as DOM
112114import qualified GHCJS.DOM.Types as DOM
113115import qualified Reflex.Patch.DMap as PatchDMap
114116import qualified Reflex.Patch.DMapWithMove as PatchDMapWithMove
117+import qualified Reflex.Patch.MapWithMove as PatchMapWithMove
115118import qualified Reflex.TriggerEvent.Base as TriggerEventT (askEvents)
116119
117120#ifndef USE_TEMPLATE_HASKELL
@@ -1028,7 +1031,15 @@ instance (Adjustable t m, MonadJSM m, MonadHold t m, MonadFix m, PrimMonad m) =>
10281031 True -> do
10291032 Constant <$> mapM (`collectUpTo` nextPlaceholder) mThisPlaceholder
10301033 collected <- DMap.traverseWithKey collectIfMoved p
1031− let !phsAfter = fromMaybe phsBefore $ apply (weakenPatchDMapWithMoveWith (_traverseChildImmediate_placeholder . error "FIXME" . _traverseChild_mode . getCompose) p_) phsBefore --TODO: Don't recompute this
1034+ let !phsAfter = fromMaybe phsBefore $ apply filtered phsBefore
1035+ weakened :: PatchMapWithMove (Some k) (Either (TraverseChildHydration t m) (TraverseChildImmediate (Some k)))
1036+ weakened = weakenPatchDMapWithMoveWith (_traverseChild_mode . getCompose) p_
1037+ filtered :: PatchMapWithMove (Some k) DOM.Text
1038+ filtered = PatchMapWithMove $ flip Map.mapMaybe (unPatchMapWithMove weakened) $ \(PatchMapWithMove.NodeInfo from to) -> flip PatchMapWithMove.NodeInfo to <$> case from of
1039+ PatchMapWithMove.From_Insert (Left _hydration) -> Nothing
1040+ PatchMapWithMove.From_Insert (Right immediate) -> Just $ PatchMapWithMove.From_Insert $ _traverseChildImmediate_placeholder immediate
1041+ PatchMapWithMove.From_Delete -> Just $ PatchMapWithMove.From_Delete
1042+ PatchMapWithMove.From_Move k -> Just $ PatchMapWithMove.From_Move k
10321043 let placeFragment :: forall a. k a -> PatchDMapWithMove.NodeInfo k (Compose (TraverseChild t m (Some k)) v') a -> JSM (Constant () a)
10331044 placeFragment k e = do
10341045 let nextPlaceholder = maybe lastPlaceholder snd $ Map.lookupGT (This k) phsAfter