# Can the compiler skip virtual DOM?

**URL:** <https://discourse.elm-lang.org/t/can-the-compiler-skip-virtual-dom/6300>\
**Category:** Learn\
**Created:** [September 24, 2020, 2:32pm UTC](https://discourse.elm-lang.org/t/can-the-compiler-skip-virtual-dom/6300 "2020-09-24T14:32:03Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![jfmengels](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/jfmengels/32/3124_2.png) [@jfmengels](https://discourse.elm-lang.org/u/jfmengels)\
**Post date:** [September 30, 2020, 10:31am UTC](https://discourse.elm-lang.org/t/can-the-compiler-skip-virtual-dom/6300/10 "2020-09-30T10:31:19Z")

</div>

`Html.Lazy` is definitely tricky. It’s really easy to put in place, but also really hard to keep make it keep work and not fail on you **silently** because of “spooky actions at at distance”.

IMO, this could be solved through static analysis (probably through some other means too), and I proposed an `elm-review` rule idea targeting this exact problem (link below).

Detecting the problem will not solve the problem entirely as you will have to re-think and re-structure how you architecture the parts of the code that lead to that lazy view, which might be more work than what Svelte gives you out of the box, but it would remove the biggest pain point around it.

> <https://github.com/jfmengels/elm-review-rule-ideas/issues/14>
>
> What the rule should do:
> Detect cases where Html.Lazy functions will miss the cache.
> What problems does it solve:
> Html laziness is a very...

---

_[View the full topic](https://discourse.elm-lang.org/t/can-the-compiler-skip-virtual-dom/6300)._
