Coming from Elm
The same
Section titled “The same”- The language: syntax, type system, pattern matching, records, custom types, ports.
- The error messages, written to match Elm’s.
Html,Html.Attributes,Html.Events,Html.Keyed,Html.Lazy.Browser.sandbox,element,documentandapplication, withBrowser.Navigation,Browser.EventsandBrowser.Dom.- The upstream TodoMVC builds and runs without changes.
What to change
Section titled “What to change”The global is Dartea
Section titled “The global is Dartea”const app = Elm.Main.init({ node: document.getElementById("app") });const app = Dartea.Main.init({ node: document.getElementById("app") });The command
Section titled “The command”elm make src/Main.elm --output=index.htmlnpx dartea make src/Main.elm --output index.htmldartea make takes the same shape of arguments as elm make, and the extension of --output chooses a page, a script or a folder of modules.
Build tools
Section titled “Build tools”vite-plugin-elm and elm-webpack-loader call the elm binary. They do not know about dartea yet. Until they do, build with dartea make and point your bundler at the output.
Projects and packages
Section titled “Projects and packages”dartea reads dartea.json. An existing elm.json is read too, for its source-directories. Dependencies come from npm through dartea install. Packages from the Elm package registry are not downloaded yet.
Standard library
Section titled “Standard library”| Package | Status |
|---|---|
elm/core |
Ready, except Debug, Bitwise, Set, Array and Process |
elm/html |
Ready |
elm/browser |
Ready |
elm/json |
Ready |
elm/url |
Ready |
elm/http |
Ready, without Bytes and File bodies |
elm/time |
Partly |
elm/random |
Not yet |
elm/virtual-dom |
Ready, through Html |
Differences you might notice
Section titled “Differences you might notice”- A
Taskis anasyncfunction and can be cancelled through itsAbortSignal. Cmd.batchstarts every command at once. Messages still arrive in order.- The output is modern JavaScript. It does not run in browsers without ES modules and
async.