# Changelog ## 1.19.0 - 2026-10-05 ## 1.19.0-rc3 - 2026-10-01 ### Bug fixes - Fixed a bug where documentation pages configuration could be missing fields in `gleam.toml`. ([Louis Pilfold](https://github.com/lpil)) - Fixed a bug where documentation pages could be read from outside the package directory. ([Louis Pilfold](https://github.com/lpil)) ## 1.19.0-rc2 - 2026-09-26 ### Compiler - The `--src-only` flag has been renamed to `--no-dev`. ([Louis Pilfold](https://github.com/lpil)) - The error message for failing to load data about already compiled modules has been improved. ([Louis Pilfold](https://github.com/lpil)) ### Bug fixes - Fixed a bug with `gleam compile-package` where `dev_dependencies` would not be included in the `.app` file regardless of whether `--no-dev` was provided. ([Rodrigo Álvarez](https://github.com/Papipo)) - Fixed a bug where `gleam compile-package` would not use Erlang abstract forms for compilation to BEAM. ([Louis Pilfold](https://github.com/lpil)) ## 1.19.0-rc1 - 2026-09-22 ### Compiler - When compiling to Erlang, Gleam now compiles to the Erlang Abstract Format instead of textual Erlang. This format supports mapping every generated Erlang line back to its corresponding line in the original Gleam source file. ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) - When compiling to Erlang compile times have been reduced for a typical Gleam package. ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) - The compiler now emits a warning when trying to use the pattern of a spread and a variable when pattern matching inside a 'case' clause. This syntax may be removed in a future (major) release. Considering the following Gleam code: ```gleam pub fn main() { let letters = ["b", "c"] case letters { [] -> [] [..x] -> x } } ``` The compiler will emit the following warning: ```txt warning: Deprecated list pattern matching syntax ┌─ /main.gleam:6:9 │ 6 │ [..x] -> x │ ^^^^^ Replace this with `x`. This syntax for pattern matching on lists is deprecated. This spread matches the entire list, so the variable x can be used as the pattern directly instead. ``` ([Khalid Belkassmi E.H.](https://github.com/khalidbelk)) - The compiler now has a specific error message for when trying to use procedural operators that do not exist in Gleam, such as `+=` and `++`. ([0xda157](https://github.com/0xda157)) - The error message for calling a function in a guard expression or constant expression now points to the entire function call. ([mmustafasenoglu](https://github.com/mmustafasenoglu)) - Pattern matching on the JavaScript target now generates flatter code, with nested `if` statements collapsed into a single condition and fewer intermediate variables. This makes little difference to the size of a bundled application, but the resulting code has fewer branches for JavaScript engines to optimise. For example, this code: ```gleam pub fn go(x) { case x { Wibble(1, 2) -> 1 _ -> 2 } } ``` Previously would generate this JavaScript: ```js export function go(x) { if (x instanceof Wibble) { let $ = x[0]; if ($ === 1) { let $1 = x[1]; if ($1 === 2) { return 1; } else { return 2; } } else { return 2; } } else { return 2; } } ``` But now it generates this: ```js export function go(x) { if (x instanceof Wibble && x[0] === 1 && x[1] === 2) { return 1; } else { return 2; } } ``` ([John Downey](https://github.com/jtdowney)) - When producing TypeScript annotations, the compiler now produces overloads to narrow the type of variants of a custom type. For example, given the following type: ```gleam pub type Box(value) { Full(value) Empty } ``` Will now produce these two additional overloads: ```ts export function Box$isFull(value: Box$): value is Full; export function Box$isEmpty(value: Box$): value is Empty; ``` ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) - The compiler is now fault tolerant when it runs into unsupported binary operators used in constants. Instead than stopping to analyse the whole module the compiler now produces an error message explaining the operator is not supported. For example: ```gleam pub const wibble = 1.1 *. 11.0 ``` Results in the following error: ``` error: Unsupported operator in constant expression ┌─ /Users/giacomocavalieri/Desktop/prova/src/prova.gleam:1:24 │ 1 │ pub const wibble = 1.1 *. 11.0 │ ^^ This operator is currently not supported in constants. ``` ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) - When generating Erlang type definitions, types called `Record` will be renamed to `record_` to not overwrite Erlang's built-in `record` type introduced in OTP29. ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) - Creation of literal lists has been optimised on the JavaScript target. ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) - The compiler now provides a specific error message directing the user to the correct syntax when trying to update a record after providing fields. ([0xda157](https://github.com/0xda157)) - The compiler now provides a more specific error message when encountering a merge conflict indicator ([0xda157](https://github.com/0xda157)) - The compiler now provides hint about `|` in pattern matching ([n0kk23](https://github.com/n0kk23)) - The compiler now provides better error message when trying to import or use private value or type from modules within current package. For example: ```gleam import wibble // ^^^^^^ `wibble` is a module in same package fn go() -> wibble.Wobble { todo } ``` Results in following errors: ``` error: Use of private module type ┌─ /workspaces/wobble/src/wobble.gleam:4:12 │ 4 │ fn go() -> wibble.Wobble { │ ^^^^^^^^^^^^^ `wibble.Wobble` is a private type. ``` ([Andrey Kozhev](https://github.com/ankddev)) - When an invalid type alias is created the error messages no longer cascade through further usages. ([James Dolan](https://github.com/jamesdolan16)) - Matching on bit array patterns which contain empty string segments is now deprecated. ([Surya Rose](https://github.com/GearsDatapacks)) - The compiler now recognises more unreachable clauses in a `case` where an earlier clause matches an overlapping string. ```gleam pub fn go(input: String, x: Int) { case input, x { "ab", 1 -> 7 "a" <> _, _ -> 2 "ab", _ -> 3 _, _ -> 4 } } ``` The compiler will emit the following warning: ```txt warning: Unreachable pattern ┌─ /main.gleam:5:5 │ 5 │ "ab", _ -> 3 │ ^^^^^^^ This pattern cannot be reached as a previous pattern matches the same values. Hint: It can be safely removed. ``` Anything reaching the third clause starts with `"a"`, so the second clause has already matched it. Code that previously compiled cleanly may now emit this warning. ([John Downey](https://github.com/jtdowney)) - The compiler's lexer now uses byte indexing with an ASCII fast path instead of iterating over characters, and builds tokens from source slices to reduce allocations. ([John Downey](https://github.com/jtdowney)) - The performance of `echo` for floats has been improved on the Erlang target. ([Andrey Kozhev](https://github.com/ankddev)) ### Build tool - The build tool now stores its build cache in a more compact binary format, making the cache files noticeably smaller. ([Andrey Kozhev](https://github.com/ankddev)) - The `ext` protocol is now explicitly disabled when when fetching git dependencies. This protocol is disabled by default since 2015, so this has no impact unless the user is using a very old version of git or has enabled this protocol in their configuration. ([Amr Kadry](https://github.com/Amrkadry) and [Louis Pilfold](https://github.com/lpil)) - The ordering of import statements in generated JavaScript code is now stable. Previously the same code compiled twice could produce different output, as the singleton constants imported for a type's fieldless variants were emitted in a different order on each run. ([John Downey](https://github.com/jtdowney)) - Make links to Tangled repositories use their new domain & URL format. ([Naomi Roberts](https://github.com/naomieow)) - `compile-package` now supports a `--src-only` flag to compile only the `/src` folder. ([Rodrigo Álvarez](https://github.com/Papipo)) - The build tool now shows a better error when trying to add a package as a dependency when it is already a development dependency (or vice-versa). ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) - `--out` argument in `export package-information` and `export package-interface` commands is no longer required. Those commands now print to stdout by default. ([Rodrigo Álvarez](https://github.com/Papipo)) - The `export javascript-prelude` and `export typescript-prelude` commands gain the `--out` parameter. ([Louis Pilfold](https://github.com/lpil)) - `gleam compile-package` now generates a .app file in the ebin folder, listing all .beam modules (this includes Erlang and Elixir ones). ([Rodrigo Álvarez](https://github.com/Papipo)) - `gleam compile-package` gains a new `--otp-app-names` flag, letting the caller specify dependencies' OTP application names when they differ from their Gleam package names, as comma separated `package=otp_app` pairs. ([Rodrigo Álvarez](https://github.com/Papipo)) ### Language server - The "Generate dynamic decoder" code action is now only offered when the `gleam_stdlib` package is available. ([0xda157](https://github.com/0xda157)) - Renaming a prelude item to its original name no longer unnecessarily imports it. ([0xda157](https://github.com/0xda157)) - The "add missing patterns" code action now has higher precedence than the code action to discard an unused result. ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) - The "pattern match on argument" code action now has higher precedence over the "discard unused argument" code action. ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) - The language server will now surround value completions right after dot in imports with braces. For example, consider following code: ```gleam import wibble.| ``` where cursor is denoted with `|`. Completing value `Wibble` will result in following code: ```gleam import wibble.{Wibble} ``` ([Andrey Kozhev](https://github.com/ankddev)) - The language server now supports triggering "Convert int to different base" code action in constants, patterns and bit array "size" options. ([Andrey Kozhev](https://github.com/ankddev)) - The language server now supports go-to-definition, find-references and renaming for function argument labels. ([Alistair Smith](https://github.com/alii)) ### Formatter ### Compiler Wasm API - The WebAssembly build of the compiler now exposes a `format_source` function for formatting Gleam source code. ([John Downey](https://github.com/jtdowney)) ### Bug fixes - Fixed a bug where the generated Erlang `.app` file's module list could be missing Erlang or Elixir native modules that hadn't been recompiled since a previous build. ([Rodrigo Álvarez](https://github.com/Papipo)) - Fixed a bug where on the JavaScript target a case clause whose guard's top level operator was `||` could run for a subject its pattern did not match. ([John Downey](https://github.com/jtdowney)) - Fixed a bug where `gleam export erlang-shipment` would add Gleam contributor copyright metadata to the generated POSIX entrypoint. ([John Downey](https://github.com/jtdowney)) - Fixed a bug where the `echo` on the JavaScript target would incorrectly print numbers like `1.0e300`. ([Andrey Kozhev](https://github.com/ankddev)) - Fixed a bug where the `echo` on the JavaScript target would incorrectly print `NaN` and `Infinity`. ([Andrey Kozhev](https://github.com/ankddev)) - Fixed a bug where the language server would incorrectly rename values and types with a same-named import alias. ([Andrey Kozhev](https://github.com/ankddev)) - Fixed a bug where the language server would crash if the client disconnected unexpectedly. ([Senthilnathan](https://github.com/ssenthilnathan3)) - Fixed a bug where a bit array segment pattern of an empty string would generate invalid code on JavaScript. ([Louis Pilfold](https://github.com/lpil)) - Fixed a bug where comments after the last item in a tuple, or after the last argument in a function call wouldn't be formatted properly. ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) - Fixed a bug where file permissions were not set in Hex tarballs. ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) - Fixed a bug where echo would print BitArrays like `<<1, 2, 3>>` as strings on the Erlang target. ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) - Fixed a bug where the compiler would not produce a type error when using a record constructor as the updated record in a record update expression in a constant. ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) - Fixed a bug where the compiler would crash when writing a constant record update depending on another invalid constant. ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) - Fixed a bug where the "Discard unused variable" language server code action would produce invalid code when discarding left side assignment of string prefix patterns. ([Andrey Kozhev](https://github.com/ankddev)) - Fixed a bug where the "Discard unused variable" language server code action would produce invalid code when discarding bindings in patterns with alternative patterns. ([Andrey Kozhev](https://github.com/ankddev)) - Fixed a bug where the language server would not suggest prefix pattern prefix alias. ([Andrey Kozhev](https://github.com/ankddev)) - Fixed a bug where on the JavaScript target a name shadowed inside a case clause that always matched would be used in place of the outer binding by the code that followed the case expression. This could produce a wrong value, or a runtime crash when the shadowed name was a module function or constant. ([John Downey](https://github.com/jtdowney)) - Fixed a bug where on the JavaScript target the variables a clause guard needed would be declared in the enclosing scope of a case that always matched, so a later `let` binding one of those names produced a duplicate declaration and the whole module failed to parse. ([John Downey](https://github.com/jtdowney)) - Fixed a bug where a package's optional dependency requirements could be ignored, or could pull a package into the dependency tree that nothing actually required. ([John Downey](https://github.com/jtdowney)) - Fixed a bug where comparing `0.0` and `-0.0` resulted in a redundant comparison warning, which is incorrect on Erlang/OTP 27+. ([Jack Programs](https://github.com/jackprogramsjp)) - Fixed a bug where a project with multiple path dependencies would perform dependency resolution once per path dependency, so commands run after `gleam deps download` would needlessly resolve versions again. ([John Downey](https://github.com/jtdowney)) - Fixed a bug where concatenating a string to a string in a block would produce an invalid bitstring on the Erlang target. ([Lillian Rose](https://github.com/lillianrubyrose) with [Mar Bloeiman](https://github.com/strawmelonjuice)) - Fixed a bug where the compiler would suggest wrapping a mismatched type in `Ok()` even when doing so would not fix the type unification error. ([Hari Mohan](https://github.com/seafoamteal)) - Fixed a bug where `gleam export hex-tarball` and `gleam publish` could fail on Windows with a "path is outside this Gleam project" error for files that were inside the project. ([John Downey](https://github.com/jtdowney)) - Fixed a bug in generating TypeScript annotations for function signatures that use types from aliased modules. ([Ian Chamberlain](https://github.com/ian-h-chamberlain)) - Fixed a bug where the generated `package-interface.json` would not include deprecation messages for constructors. ([Surya Rose](https://github.com/GearsDatapacks)) - Fixed a bug where on the JavaScript target a string prefix pattern could be skipped when an earlier clause matched an overlapping string, but then failed for another reason. ([John Downey](https://github.com/jtdowney)) - Fixed a bug where on the JavaScript target a name given to a string prefix or bit array in a pattern would not be bound in every branch it was used in. ([John Downey](https://github.com/jtdowney)) - Fixed a bug where the end position of the final token was incorrect when the source ended with a multi-byte character. ([John Downey](https://github.com/jtdowney)) - Fixed a bug where the build tool would exit with an error when the gleam.toml licence array contained a licence starting with `LicenseRef-`, which are used by hex.pm to support non-SPDX licences. ([Vivid](https://github.com/absolutely-vivid)) - Fixed a bug where packages published from Windows would record their file paths in `metadata.config` using `\` separators, which Erlang reads as escape characters, corrupting the paths or making the metadata unparseable. ([John Downey](https://github.com/jtdowney)) ## v1.18.1 - 2026-08-01 - Fixed a bug where the Erlang code generator would generate wrong code when referencing constants that are aliases to other constants in bit array segments, string concatenation and clause guards. ([Andrey Kozhev](https://github.com/ankddev))