Upgrading from v0.28 to v0.29.0

This page lists every change in v0.29.0 that can affect code or a deploy that worked on v0.28.1. Each entry is one bullet: what changed, the old code, and the new code.

The full story of each change is in CHANGELOG.md under v0.29.0.

v0.29.1 and v0.29.2 are patch releases. The sections marked (v0.29.1) list what v0.29.1 changes for code that worked on v0.29.0, and the sections marked (v0.29.2) list what v0.29.2 changes for code that worked on v0.29.1. Their full stories are in CHANGELOG.md under v0.29.1 and v0.29.2.

v0.29.2 is a patch release too. The sections marked (v0.29.2) list what it changes for code that worked on v0.29.1. Its full story is in CHANGELOG.md under v0.29.2.

Loud (fails to compile, the error shows the fix)

New stdlib names

Regex takes a compiled Regex

Sky.Core.Regex now has a type Regex. Regex.fromString : String -> Result Error Regex is the only way to make one, and every other function takes the compiled value instead of the pattern String. Before, each call compiled the pattern again, and an invalid pattern silently matched nothing (False, Nothing, [], the input unchanged). Now an invalid pattern is an Err with the RE2 error text, and a literal pattern is checked when the program compiles ([E2014], see docs/errors/E2014-invalid-regex.md).

Old code fails to compile with a type error whose hint names this section: Regex functions take a compiled Regex since v0.29.0.

Before:

import Sky.Core.Regex as Regex

isCode : String -> Bool
isCode s =
    Regex.match "^[A-Z]{3}-\\d{4}$" s

After: compile the pattern once, at the top level, and use the value:

import Sky.Core.Regex as Regex exposing (Regex)

codeRe : Regex
codeRe =
    Regex.fromString """^[A-Z]{3}-\d{4}$"""
        |> Result.withDefault Regex.never

isCode : String -> Bool
isCode s =
    Regex.contains codeRe s

A literal pattern is checked when the program compiles, so Result.withDefault Regex.never never gives never for it. For a pattern that comes from outside (a setting, a user's search), handle the Err:

search : String -> List String -> Result Error (List String)
search pattern lines =
    Regex.fromString pattern
        |> Result.map (\re -> List.filter (Regex.contains re) lines)

Writing patterns: a triple-quoted string keeps a backslash ("""\d+""" is \d+; a plain string needs "\\d+"). Inside one, \\ is one backslash ("""\\d""" is also \d) and {{ opens an interpolation, so a literal {{ is written \{{. A single { (\d{2,4}) is kept. A Regex cannot be stored with a Codec or in a session: store the pattern.

import Sky.Core.Regex exposing (..) now also exposes contains and fromString. Beside Sky.Core.String exposing (..) (contains), or Sky.Core.Bytes, Sky.Core.Secret, Std.Decimal or Std.Money with exposing (..) (fromString), a bare use is [E1012]: qualify it (Regex.contains, String.contains).

Std.Image.Format has two more constructors

A value defined in terms of itself

Every type variable in an annotation is rigid (v0.29.2)

Codec.ColType has CDecimal and CMoneyIn (v0.29.2)

Money results

v0.29.2 redesigns Std.Money around one rule: every operation that combines two Money values by arithmetic or by order returns Result Error _, an Err (kind InvalidInput, naming both currencies) for two different currencies. Before, Money.add of two currencies returned the left operand and Money.lt compared the amounts and ignored the currency, in silence. The compiler names each removed function and its replacement.

BeforeAfter
Money.add a b : MoneyMoney.add a b : Result Error Money
Money.sub a b : MoneyMoney.sub a b : Result Error Money
Money.sumOf c xs : MoneyMoney.sum c xs : Result Error Money
Money.compare a b : IntMoney.compare a b : Result Error Int
Money.lt / lte / gt / gte : Bool: Result Error Bool
Money.zeroOf mMoney.zero (Money.currency m)
Money.setRate USD EUR r then Money.convert EUR mMoney.convert (Money.rates [ ( USD, EUR, r ) ]) EUR m
Money.getRate from to : Result Error DecimalMoney.rate from to rates : Maybe Decimal
Money.hasRate / clearRatesMoney.rate … /= Nothing / a new Money.rates value
Money.parseCurrency s : CurrencyMoney.currencyFromCode s : Maybe Currency
Money.isKnownCode s / knownCurrency cMoney.currencyFromCode s and a match on CurrencyRaw _

Money.eq / neq, fromMinor, formatWithCode, amount, the Money type and every scaling function (mul, percentOf, allocate, …) are unchanged.

-- Before
total = Money.add price tax
isOver = Money.gt total budget

-- After: handle the Err once, where the values meet
total = Money.add price tax          -- Result Error Money
isOver =
    total
        |> Result.andThen (\t -> Money.gt t budget)
        |> Result.withDefault True   -- an amount in another currency is over

Money.sum also collides with Std.Decimal.sum: a program that imports both modules with exposing (..) and uses a bare sum gets [E1012]; qualify it.

In Std.Ai, Provider.cost returns Result Error Money and Trace.forResponse returns Result Error Trace (a price book whose two rates are in different currencies has no single cost). Eval.run and Synthetic.run refuse such a book, or a budget in another currency than its price book, before the first call (InvalidSetting), and a report whose cost budget is in another currency than its costs fails Eval.check with that reason.

Ui.html takes an Html msg (v0.29.11)

Std.Ui.html was typed any -> Element msg, so the compiler checked nothing inside the escape hatch. A raw node with an argument missing is a function, not a node: Html.textarea [ Attr.name "lines" ] has no children list, so it is a List (Html msg) -> Html msg. It passed sky check, built, and the view panicked when it rendered, with rt.Coerce: expected rt.SkyADT, got func([]rt.SkyADT) rt.SkyADT.

Ui.html is now Html msg -> Element msg. The same code is [E2001] at the call, and the error names the missing argument.

Before:

Ui.html (Html.textarea [ Attr.name "lines", Attr.rows 3 ])

After:

Ui.html (Html.textarea [ Attr.name "lines", Attr.rows 3 ] [])

Every Ui.html call that already passed a complete Html msg compiles as it did. A call that passed another value must build an Html msg first, for example with Html.node tag attrs children. Html.input takes one argument (List (Attribute msg) -> Html msg), so Ui.html (Html.input [ … ]) is complete and unchanged.

The message type is checked too. A helper typed with your own Msg that a view typed Element msg wraps is [E2001] on that view, because the view promises any message type and the helper fixes one:

-- before: compiled, because Ui.html took `any`
privacy : Element msg
privacy =
    Ui.column [] [ Ui.html (privacyBody ()) ]

privacyBody : () -> Html.Html Msg

-- after: a helper that sends no message takes any message type
privacyBody : () -> Html.Html msg

If the helper does send messages, type the view Element Msg instead.

Loud at run time (compiles, then stops with an error)

Std.Db.Store checks names before any statement

Each item below is now Err (InvalidInput …) with a message that names the bad name. No statement reaches the database.

Std.Db.Store refuses a name it cannot write (v0.29.2)

A decimal field on a Codec.auto JSON text column (v0.29.2)

A stored Money with an empty currency (v0.29.2)

Codec.auto refuses a field it cannot read back (v0.29.2)

A Store write refuses a Just written as null (v0.29.2)

Decimal and Money to Int out of range (v0.29.2)

Decimal places and allocation limits (v0.29.2)

sky db status runs the app read-only (v0.29.2)

sky db status reports EDITED (v0.29.2)

Std.Db.Store checks value kinds before any statement

A value of the wrong kind for its column used to reach the database, which converted it with no error (SQLite's CAST('abc' AS BIGINT) is 0, a 2.7 in an integer column truncated on SQLite and rounded on PostgreSQL), or reached the decoder, which read it as Nothing. Each item below is now an Err that names the column, the kind and the value. The rule is in docs/skydb/overview.md ("Value kinds").

Codec.maybe reads only null as Nothing

Codec.maybe c decoded any value c could not read as Nothing, so a mistyped value disappeared with no error: "x" in a Maybe Int field, a name that is not one of an enum's, an element of a List (Maybe a) of the wrong shape. Now only JSON null is Nothing. Any other value must decode as the inner value, and one that does not makes the whole decode an Err that names where it failed (at .note: expected Int, got String). This holds for Codec.fromJson, Codec.fromJsonSafe, Codec.fromXml, Std.Db.Store reads, Sky.Spa wire decoding and every other use of the codec.

Std.Image refuses images over its decode limits

Silent (compiles, behaves differently)

Task-valued root discards execute their effects (unreleased)

A root let _ = pending in … now runs pending once when its static type is Task, including when that type comes from a signature or local annotation. Previously, body-only inference could lose that Task classification and emit a plain value discard, silently skipping the effect. Existing direct Task calls still run once.

Rebuilding affected code can therefore start an I/O operation or shared-state update that the old compiler skipped. Review code that depended on the skipped effect. Keep a Task as a named value and run it explicitly later when delayed execution is intended. A nested tuple wildcard, as in let (kept, _) = (value, pending) in kept, continues to discard Task data without executing it. Ordinary function and unconstrained polymorphic value discards remain latent.

Money.allocate keeps the part below the minor unit (v0.29.2)

== on Decimal and Json.Value compares the value (v0.29.2)

A currency code is read in upper case by Std.Money (v0.29.2)

Sky.Live sessions start fresh

Codec.auto writes a Dict Int key as its decimal (v0.29.9)

Std.Image Preserve keeps a GIF a GIF

Std.Db.Store

Std.Db.Store migrate: one rule for both paths

Store.migrate (and sky db push) and sky db migrate --gen now follow the user's rule D1: "A Maybe field gives a nullable column, any other field gives NOT NULL. A declared builder default wins (defaultInt / defaultText / defaultBool / defaultNow, plus a new defaultFloat), else the zero value of the type. Existing columns are never altered. No builder makes a required field's column nullable."

What changes for an existing app on its next migrate:

sky db migrate: one rule for every migration file

sky db migrate (and SKY_DB_OP=migrate ./app) renders every migration file in db/migrations/ with the rule above, old files and new files alike. There is no op version and no header line. The _sky_migrations ledger now keeps, for a migration file, a checksum of its ops (the op list in a canonical form, the same on SQLite and PostgreSQL), not a checksum of the SQL they render to. It also has a new column, kind: ops for a migration file, sql for hand-written Db.migrate SQL. Hand-written SQL keeps the checksum of its text, as before.

What changes for an existing app:

  1. Applied files are re-stamped once, automatically. On the first sky db migrate with v0.29, the runtime adds the kind column to _sky_migrations and gives each applied migration file its ops checksum. It logs one info line per file: db.migrate: migration '<id>' re-stamped from the v0.28 checksum to its ops checksum. Nothing in your schema changes. There is no configuration and no command to run. Before that first migrate, sky db status shows these files as applied.
  2. A file applied by v0.29 is checked by its ops. A later change to how an op renders to SQL never makes it look edited. An edit to the file itself still fails with "checksum mismatch", as before.
  3. A pending file written by v0.28 applies with the new rule. A required field gives a NOT NULL column with its declared default, else the zero value. A required unique column on a table with 2 or more rows fails, and the migration rolls back with a message that names the table, the column and the fix.
  4. The same file can give a different column in two environments. A pending v0.28 file that adds a required field gives a nullable column if v0.28 applies it, and a NOT NULL column if v0.29 applies it. Existing columns are never altered. If that difference matters to you, apply the pending migrations in every environment before you upgrade.
  5. Downgrade to v0.28 is not supported after a v0.29 migrate. v0.28 reads the new checksums as a mismatch and stops.

Std.Db.Store insertMany and upsert compute defaultWith

External columns (v0.29.1)

An external column is a column the table has and the record codec does not carry, such as a created_at the record leaves out.

A form POST to a page (v0.29.1)

A form submitted before a Sky.Spa or Sky.Live page is live no longer ends on a 403 JSON page.

Telemetry records no raw URL or full client IP (v0.29.1)

Spans, metrics, the access log, panic reports, Middleware.withLogging and Std.Analytics page views no longer record a request's raw path, its query string or the full client IP. Outbound Http spans and transport error text no longer carry the query string or userinfo. See docs/observability.md, "Request paths, query strings and client addresses".

Header names in any case (v0.29.1)

HTTP header names are case-insensitive. HTTP/2 sends them in lower case.

File error kinds (v0.29.1)

File.remove, readDir, mkdirAll, readFile, readFileLimit, readFileBytes, writeFile, writeBytes and append no longer report an os error as Ffi. A missing path is NotFound, a refused one PermissionDenied, a path that already exists Conflict, anything else Io, as File.stat already did.

sky test with a DSN in .env (v0.29.1)

sky test never takes a database from the project's .env, and test mode never loads .env at all. A .env often names a shared or a production database, and the tests and their seeds wrote to it.

Database time columns read as stable text (v0.29.1)

A PostgreSQL timestamptz, timestamp, date or time column read as text (Db.query + Db.getField, a Store or Codec String field, with no ::text in the SQL) now reads as PostgreSQL's own text on a UTC server, whatever the time zone of the app's host. A SQLite DATE, DATETIME or TIMESTAMP column reads in the same shapes. Before, both were Go's time text in the host's local zone.

Columnv0.29.0 (London host)v0.29.1
timestamptz2026-11-01 02:13:48.987333 +0000 GMT2026-11-01 02:13:48.987333+00
timestamp2026-11-01 02:13:48.5 +0000 UTC2026-11-01 02:13:48.5
date2026-11-01 00:00:00 +0000 UTC2026-11-01
time02:13:4802:13:48 (unchanged)

Std.Ui layout fixes (v0.29.10)

An audit of the Std.Ui renderer fixed ten places where the CSS did not do what the attribute says. Nothing stops compiling. A page can look different where it used one of these, so check the places listed:

WhereBeforeNow
centerY / alignTop / alignBottom on a child of an el, a button or a textColumnmoved the child sideways (centerY centred it horizontally)moves it vertically. Add Ui.centerX where the horizontal centring was wanted
Ui.width (Ui.px n) in a row, Ui.height (Ui.px n) in a column or elshrank below n in a crowded rowkeeps n. Write Ui.width (Ui.fill |> Ui.maximum n) for a box that may give way
alignRight / centerX on inFront, above, below and the other nearby elementsdid not move the elementmove it. An inFront element without height fill is now as tall as its content
alignment in and on a Ui.gridused flex axes (vertical for X)uses grid axes
a height fill child of a row with centerY, alignTop or alignBottomcontent-tallfills the row
a labelled single-line Input.* with a layout attributecould grow tall and stretch its formone line tall
Ui.shrinkmax-content: text never wrappedfit-content: text wraps in a narrow space
Ui.spacing on a Ui.paragraphno effectspace between lines
Border.shadow with Border.innerShadow or Border.glowonly the last showedall show

docs/skyui/overview.md ("Layout fixes") has the details.

Other silent changes