Skip to content

Zokka-Dev/zokka-basic-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Basic Example of using the Zokka compiler

This is a basic example of how the Zokka compiler allows us to override package versions in order to fix a bug in elm/core.

elm/core has a bug which can cause an application to hang forever with certain String operations, as demonstrated in elm/core#1137. We can use Zokka to override the default elm/core with a version of elm/core that fixes this bug.

Building this example

To compare and contrast Elm vs Zokka, we can first use Elm to build this.

Run

elm make src/Main.elm

Now when you open index.html in your web browser of choice, you should see a blank page that is just hanging due to infinite Javascript execution.

Let's switch to Zokka.

zokka make src/Main.elm

Now open index.html again in your web browser. You should see The length of hangsInVanillaElm is 1 appear.

Now go ahead and open elm.json. You'll see that we've added a new field called zokka-package-overrides, which tells us we are overriding elm/core version 1.0.5 with zokka/elm-core-1-0-override version 1.0.0. zokka/elm-core-1-0-override contains the bug fix that we are using. This means everywhere in our dependency tree we replace elm/core:1.0.5 with zokka/elm-core-1-0-override:1.0.0, even in transitive dependencies.

This allows us to take full advantage of all the bug fixes provided in our override package.

About

Basic example of using the Zelm compiler

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages