Skip to content

Instantly share code, notes, and snippets.

@mdgriffith
Last active July 30, 2019 22:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdgriffith/2e38acd2d6565de6d6ef0bb2a9531429 to your computer and use it in GitHub Desktop.
Save mdgriffith/2e38acd2d6565de6d6ef0bb2a9531429 to your computer and use it in GitHub Desktop.
Elm UI Performance Mode

There's a new Elm performance mode.

If you’re still interested in trying it out, here’s how to ge it working.

  1. clone the elm-ui repo locally and point your source-directories to it.
    • You can make sure to checkout the commit for the latest release (1.1.1) in order to avoid pulling unpublished changes
  2. Enable the virtual css in elm land via
import Internal.Model as Internal
...
 Element.layoutWith
        { options =
            [ Internal.RenderModeOption
                Internal.WithVirtualCss
            ]
        }
...
  1. Add this virtual-css javascript to your page

In my benchmarks skips the RecalcStyle step if all the styles have been rendered at some point.

  1. Let me know if it made a difference for you.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment