If you are upgrading from 7.x.x, you will need to change your code as follows. All necessary changes will be flagged as type errors by the compiler, so you can use the compiler to identify the necessary changes.
-
Most event handlers now live in
Options
. E.g., there is no longer aButton.onClick
; use insteadOptions.onClick
.Motivation. This change is to avoid re-implementing substantial parts of
Html.Events
in each component. -
Toggles.onClick
is renamedOptions.onToggle
.Motivation. This change enables you to register a regular
onClick
handler should you need to. (onToggle
is a shorthand for registering bothonClick
andonChange
.) -
Textfield now takes an extra argument:
Textfield.render Mdl [0] model.mdl [] -- 7.x.x
becomes
Textfield.render Mdl [0] model.mdl [] [] -- 8.0.0
Motivation. Although never used since a Textfield cannot have child elements, this argument makes all elm-mdl
render
functions have the same number and meaning of parameters. -
Textfield.inner
andTextfield.style
becomeOptions.input
.Motivation. Some elm-mdl components pretend to be input elements, even though they are implemented as a number of
div
s containing aninput
element somewhere. -
Slider.container
is renamedSlider.element
.Motivation. See change (4) above.
-
Options.when x y
becomesOptions.when y x
(switch of parameter order).Motivation.
when
was intended to be used infix, with backticks, but this usage is no longer supported by Elm 0.18. The switching of parameter order allows usingwhen
with piping:cs "important-css-class" `when` model.isImportant
becomes
cs "important-css-class" |> when model.isImportant
-
The
Material.update
function now needs a lifting function.Material.update msg model -- 7.x.x becomes Material.update Mdl msg model -- 8.0.0
Motivation. This change is necessitated by the move away from the Parts library.