Fork of daniellemaywood.uk/gleam — Wasm codegen work
2

Configure Feed

Select the types of activity you want to include in your feed.

1<!-- 2 SPDX-License-Identifier: Apache-2.0 3 SPDX-FileCopyrightText: 2020 The Gleam contributors 4--> 5 6# Changelog 7 8## v1.1.0 - 2024-04-16 9 10### Formatter 11 12- Fixed a bug where the first subject of a case expression clause would be 13 indented more than necessary. 14 15## v1.1.0-rc3 - 2024-04-12 16 17### Formatter 18 19- Fixed a bug where the `@internal` annotation wouldn't be displayed. 20- Fixed a bug where a record update's arguments would be incorrectly split on 21 multiple lines. 22 23## v1.1.0-rc2 - 2024-04-10 24 25### Compiler 26 27- Fixed a bug on the JavaScript target where variables named `debugger`, which 28 is a JavaScript keyword, were not being renamed, leading to runtime errors. 29 30### Formatter 31 32- Fixed a bug where comments would be moved out of an empty bit array. 33- Fixed a bug where the formatter could add a trailing comma inside empty 34 bit arrays, generating invalid syntax. 35- Revert the warning about internal types being exposed in a package's public 36 API. 37 38### Build tool 39 40- Revert the change that would make the build tool refuse to publish a package 41 that exposes an internal type in its public API. 42 43## v1.1.0-rc1 - 2024-04-08 44 45### Compiler 46 47- The `@internal` attribute can now be used to annotate definitions. 48 This will hide those definitions from the generated documentation, 49 autocompletions and the exported module interface. 50- Prepending to lists in JavaScript (`[x, ..xs]` syntax) has been optimised. 51- Function stubs are no longer generated for functions that do not have an 52 implementation for the current targeting being compiled for. 53- Fixed a bug where some functions would not result in a compile error when 54 compiled for a target that they do not support. 55- Fixed a bug where sometimes a warning would not be emitted when a result is 56 discarded. 57- Fixed a bug with JavaScript code generation of pattern matching guards. 58- URLs in error messages have been updated for the new language tour. 59- Improved error message when erroneously trying to append items to a list using 60 the spread syntax (like `[..rest, last]`). 61- Generate [type references](https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html#-reference-types-) 62 when compiling to JavaScript with TypeScript definitions enabled. 63- Fix a bug where JavaScript code generation would not properly return the 64 result of nested blocks. 65- Fix a bug where JavaScript code generation would not properly handle functions 66 returned by blocks. 67- Fix a bug where Erlang code generation would not properly handle list case 68 patterns with no head and a spread tail. 69- The compiler will now raise a warning if you're pattern matching on tuple 70 literals and suggest you use multiple subjects instead. 71- Fixed a bug where JavaScript code generation would incorrectly parenthesise a 72 return statement. 73- Nested tuple access (`tuple.0.1`) now parses successfully. 74- Error messages are more clear about expecting values instead of types. 75- Fixed a bug where pattern matching on a string would cause the program to 76 crash on the JavaScript target. 77- A warning is now emitted when defining an opaque external type. 78- Improve error message when using incorrect quotes (`'`) to define a string 79- Fixed a bug where Erlang string prefix patterns could generate invalid Erlang. 80- Fixed string prefix matching producing wrong results on the JavaScript target 81 when the prefix had a Unicode codepoint escape sequence (`\u{...}`). 82- Improved error message for wrong patterns using constructors from other 83 modules. 84- Fixed a bug on the JavaScript target where variables bound by patterns, if 85 used within a bit array literal inside a `case` clause's guard, would be used 86 before they were defined, leading to a runtime error when evaluating the 87 `case` expression. 88- Improved error messages when failing to parse a series of things. 89- A warning is now raised for unused binary operations, records, record access 90 and record updates. 91- Fixed a bug when using constant as the size option parameter 92 for `BitArray` caused unknown variable exception. 93- Improved recommendations on error messages. 94- Improved error message for `BitArray` segment sizes. 95- A warning is now raised when an internal type is accidentally exposed in a 96 package's public API. 97- Fixed the error message when using `panic` on the JavaScript target: it now 98 correctly identifies the error variant as a `panic` instead of a `todo`. 99- Fixed a bug on the JavaScript target where empty lists with little space 100 available could compile to a conversion from the array `[ , ]`, causing them 101 to wrongly have a length of one (the array has a single `undefined` element). 102 103### Formatter 104 105- The formatting of case expressions with multiple subjects has been improved. 106- Fixed a bug where the formatter would move comments from the end of bounded 107 expressions like lists, tuples, case expressions or function calls. 108- Fixed a bug where a record update's arguments would not be indented correctly. 109- Fixed a bug where function call arguments, tuple items and list items would be 110 needlessly indented if preceded by a comment. 111- Line endings other than `\n` are now handled by the formatter, preserving 112 blank lines and converting them to `\n`. 113- The formatter can now format groups of imports alphabetically. 114- Fixed a bug where comments would be moved out of an empty list. 115- Fixed a bug where pipes and binary operations in function calls would be 116 nested more than necessary. 117- Improved formatting of comments in binary operation chains. 118 119### Build tool 120 121- Added support for the [Bun](https://bun.sh/) runtime when compiling to 122 JavaScript by using `gleam run --target javascript --runtime bun` 123- Allow compilation of packages that require `"rebar"` using the rebar3 124 compiler. 125- A warning is now emitted if there is a `.gleam` file with a path that would be 126 invalid as a module name. 127- The `~> x.y` version constraint syntax has been dropped in favour of 128 `> x.y.z and <= xx.0.0` syntax in `gleam add` and `gleam new`, for clarity. 129- New projects are created with the GitHub `actions/checkout` v4 action. 130- Fixed a bug where bit arrays would break syntax highlighting in the generated 131 HTML documentation. 132- Dependencies that use Erlang-only bit options can now compile on JavaScript, 133 though the functions that use them will not be available for use in the root 134 package. 135- The output format of the command line help messages have been changed 136 slightly. 137- The command line help text now lists valid targets and runtimes. 138- Generated documentation no longer exposes the constructors of opaque types, 139 no longer exposes the values of constants, and indicates which types are 140 opaque. 141- Generated HTML documentation now includes a link to the package on Hex. 142- Terminal colors can now be forced by setting the `FORCE_COLOR` environment 143 variable to any non-empty value. 144- Rust's Reqwest's `webpki-roots` are now used for TLS verification. 145- Update Deno config to allow passing `--location` runtime flag. 146- Fixed a bug with dependency resolution of exact versions of RC releases. 147- Fixed a bug where the documentation of a labelled record constructor could be 148 assigned to the wrong definition in the doc site. 149- Fixed a bug where the code blocks in the generated documentation's site would 150 have a wrong indentation. 151- Fixed a bug where the compiler would panic when it cannot get current 152 directory. 153- Improved error message for non-UTF-8 paths encountered during Gleam commands. 154 Now includes the path that caused the error for better diagnostics. 155- Fixed a bug where on windows local packages had absolute paths in the manifest 156 instead of relative. 157- The `gleam publish` command now asks for confirmation if the package 158 repository URL doesn't return a successful status code. 159- `gleam publish` can now optionally use a Hex API key to authorise publishing 160 and retiring packages, set via the environment variable `HEXPM_API_KEY`. 161- `gleam publish` will now refuse to publish placeholder packages, to prevent 162 name squatting which is against the Hex terms of service. 163- If a package leaks an internal type in its public API, then the build tool 164 will now refuse to publish it to Hex. 165- Monospaced links in the generated documentation now have the same color as 166 common links. 167- Fixed a bug where the `export package interface` command would always 168 recompile the project ignoring the cache. 169 170### Language Server 171 172- Update messages from the client are now batched to avoid doing excess 173 compilation work in the language server, improving performance. This makes a 174 large difference in low power machines where the language server could 175 struggle to keep up with the edits from the client. 176- The `Compiling Gleam` message is no longer emitted each time code is compiled. 177 This is to reduce noise in editors that show this message prominently such as 178 Neovim. 179- Fixed a bug where hovering over an expression in the middle of a pipe would 180 give the wrong node. 181- Go to definition now works for values in dependency Gleam modules. 182- Completions are now provided for module imports. 183 184## v1.0.0 - 2024-03-04 185 186### Language changes 187 188- Comments have been added to the JavaScript prelude to indicate which members 189 are in the public API and which are internal. 190 191### Build tool 192 193- Fixed a bug where the exported package interface would not have a module's 194 documentation. 195 196## v1.0.0-rc2 - 2024-02-14 197 198### Bug fixes 199 200- Fixed a bug where the exhaustiveness checker could crash for some generic 201 types. 202 203### Formatter 204 205- The format used by the formatter has been improved in some niche cases. 206- Improved the formatting of long case guards. 207 208## v1.0.0-rc1 - 2024-02-10 209 210### Language changes 211 212- Using a reserved word is now a compile error, not a warning. 213- Inexhaustive matches are now compile errors, not warnings. 214- The warning for an unused module alias now shows how to not assign a name to 215 the module. 216- Type aliases with unused type parameters now emit an error. 217- Type definitions with duplicate type parameters now emit an error. 218 219### Formatter 220 221- Now the formatter will nest pipelines and binary operators that are used as 222 function arguments, list items or as tuple items. 223- The format function literals used as the last argument in a function call 224 on long lines has been improved. 225 226### Build tool 227 228- If a package contains a `todo` expression then the build tool will now refuse 229 to publish it to Hex. 230- `gleam export` now takes a `package-interface` option to export a json file 231 containing metadata about the root package. 232- `gleam docs build` now creates a json file containing metadata about the root 233 package. 234- The order of dependencies in `manifest.toml` is now in alphabetical order. 235- The search bar in generated docs now has a darker background color. 236- The generated docs no longer shows whether an argument is discarded or 237 not in a function signature. 238- It is now possible to use `gleam run -m` to run a dependency module even if 239 that dependency uses a compile target that your project does not support. 240 241### Bug fixes 242 243- Fixed a bug the build tool could be make to attempt to run a main function 244 that does not support the current target in some circumstances. 245- Fixed a bug where the exhaustiveness checker could crash when checking nested 246 values inserted into the parent type using type parameters. 247- Fixed a bug where `functionname(_name)` would incorrectly parse as a function 248 capture instead of a syntax error. 249- Fixed a bug where external only functions would "successfully" compile for a 250 target they do not support, leading to a runtime error. 251 252## v0.34.1 - 2023-01-17 253 254### Build tool changes 255 256- Support has been added for using SourceHut as a repository. 257 258### Bug fixes 259 260- Fixed a bug where long function headers with external implementations could 261 format incorrectly. 262- The `@deprecated` attribute can now be used to annotate module constants. 263 This will cause a warning to be emitted when the constant is used. 264 265## v0.34.0 - 2023-01-16 266 267## v0.34.0-rc3 - 2023-01-12 268 269### Language changes 270 271- "echo" is now a reserved word. 272- A warning is no longer emitted when a function has a Gleam implementation as 273 well as external implementations for both targets. This is because having a 274 default Gleam implementation means the code is future-proof and continues to 275 be cross platform even if a new target is added. 276 277### Bug fixes 278 279- Fixed a bug where function heads would go over the line limit in the 280 formatter. 281 282## v0.34.0-rc2 - 2023-01-11 283 284### Bug fixes 285 286- Fixed a bug where `gleam run` would fail when the current directory is not 287 the root of the project and using the JavaScript target. 288- Fixed a bug where the compiler would in some cases fail to error when an 289 application uses functions that do not support the current compilation 290 target. 291 292## v0.34.0-rc1 - 2024-01-07 293 294### Language changes 295 296- Warn about function body not being used, because it already has external 297 implementations for all targets. 298- It's now possible to compile a project with external functions in dependency 299 packages that are not supported by the compilation target so long as they are 300 not used on the current target. 301- The error message for when one imports a constructor instead of an homonymous 302 type has been improved. 303 304### Language Server Changes 305 306- Added a `View on HexDocs` link on function hover. 307 308### Formatter 309 310- Fixed some quirk with the formatting of binary operators. 311- Fixed a bug where the formatter would move a function call's closed 312 parentheses on a new line instead of splitting the function's arguments. 313- Now the formatter will format tuples as if they were functions, trying to 314 first split just the last element before splitting the whole tuple. 315- Improved the formatting of multiline strings in string concatenation. 316 317### Build tool changes 318 319- The `gleam new` command now accepts any existing path, as long as there are 320 no conflicts with already existing files. Examples: `gleam new .`, `gleam new 321..`, `gleam new ~/projects/test`. 322- The format for the README created by `gleam new` has been altered. 323- The `gleam.toml` created by `gleam new` now has a link to the full reference 324 for its available options. 325- The `gleam` binary is now statically linked on Windows. 326- New projects are created requiring between versions of v0.34.0 inclusive and 327 exclusive v2.0.0. 328- The `repository` section now supports additional VCS types in the form of 329 codeberg, forgejo and gitea allowing a `user`, `repo` and additionally a 330 `host` url. 331- TypeScript declaration for the prelude exports previously missing functions 332 and classes. Additionally, swaps interfaces for classes and adds missing 333 attributes to classes. 334- `gleam` commands now look in parent directories for a `gleam.toml` file. 335 336### Bug fixes 337 338- Fixed a bug where `gleam add` would not update `manifest.toml` correctly. 339- Fixed a bug where `fn() { Nil }()` could generate invalid JavaScript code. 340- Fixed a bug where the build tool would make unnecessary calls to the Hex API 341 when path dependencies are used. 342- Fixed a bug where `gleam new` would generate a gitignore with `build` rather 343 than `/build`. 344- Fixed where the types of generic constants could be incorrectly inferred. 345- `Utf8Codepoint` has been renamed to `UtfCodepoint` in `prelude.d.mts`. 346- Fixed a bug where `gleam deps list` would look in filesystem root instead of 347 the current directory. 348- Fixed a bug with the `isEqual` function in `prelude.js` where RegExps were 349 being incorrectly structurally compared and being falsely reported as being 350 equal. 351- JavaScript: export from `prelude.d.mts` in `gleam.d.mts` to fix the error: 352 "Type 'Result' is not generic". 353- Not providing a definition after some attributes is now a parse error. 354 355## v0.33.0 - 2023-12-18 356 357## v0.33.0-rc4 - 2023-12-17 358 359- The deprecated bit array options `binary` and `bit_string` have been removed. 360- The deprecated ambiguous type import syntax has been removed. 361- The deprecated `BitString` type has been removed. 362- The deprecated `inspect` functions and `BitString` type has been removed from 363 the JavaScript prelude. 364 365## v0.33.0-rc3 - 2023-12-17 366 367### Formatter 368 369- The formatter now tries to split long chains of binary operations around the 370 operator itself, rather than around other elements like lists or function 371 calls. 372 373### Bug fixes 374 375- Fixed a bug where string prefix aliases defined in alternative case branches 376 would all be bound to the same constant. 377 378## v0.33.0-rc2 - 2023-12-07 379 380### Language changes 381 382- The `\e` string escape sequence has been removed. Use `\u{001b}` instead. 383- Generated Erlang now disabled redundant case clause warnings as these are now 384 redundant due to exhaustiveness checking. 385 386### Bug fixes 387 388- Fixed a bug where the `\u` string escape sequence would not work with 389 on Erlang on the right hand side of a string concatenation. 390 391## v0.33.0-rc1 - 2023-12-06 392 393### Formatter 394 395- The formatter now tries to keep a function body and its arguments on a single 396 line by first trying to split only its last argument on multiple lines. 397- Fixed a bug where the formatter would move comments out of blocks. 398- `gleam format` now ignores the Gleam build directory by default, even when not 399 in a git repository. 400 401### Language changes 402 403- Gleam now has full exhaustiveness checking. Exhaustiveness issues have been 404 downgraded from errors to warnings so that existing Gleam code can be 405 upgraded to be exhaustive without breaking existing code. In a future version 406 they will be upgraded to errors. 407- The `!` operator can now be used in clause guards. 408- The words `auto`, `delegate`, `derive`, `else`, `implement`, `macro`, and 409 `test` are now reserved for future use. If used they will emit a warning. In 410 a future version this may be upgraded to an error. 411- The `\u{...}` syntax can be used in strings to specify unicode codepoints via a 412 hexadecimal number with 1 to 6 digits. 413- The `todo as` and `panic as` syntaxes now accept an expression that evaluates 414 to a string rather than just a string literal. 415 416### Build tool changes 417 418- The `gleam run` and `gleam test` commands gain the `-t` flag, which is an 419 alias of the `--target` flag. 420- The `gleam build`, `gleam check`, `gleam run` and `gleam test` commands now 421 also accept `js` and `erl` as values for the `--target` flag. 422- The `gleam new` command now creates packages at version 1.0.0. 423- The `gleam publish` command now asks for confirmation if the package being 424 published is not yet version 1.0.0. 425- The `gleam publish` command now asks for confirmation if the package name is 426 one that implies the package is maintained by the Gleam core team. 427- The error messages shown when dependency resolution fails have been improved. 428 429### Compiler WASM API 430 431- The WASM API for the compiler has been rewritten to be simpler. 432- The WASM API for the compiler now exposes warnings. 433 434### HTML documentation generator 435 436- Searching in rendered HTML documentation now also matches words that do not 437 start with the input but do contain it. 438 439### Bug fixes 440 441- Fixed a bug where the JavaScript code generator could generate invalid code 442 when pretty printing a zero arity function call when the line is over 80 443 columns wide. 444- Fixed a bug where the build directory could be left in an invalid state if 445 there is Elixir code to compile and running on Windows without permission to 446 create symlinks. 447- Fixed a bug where numbers with preceding zeros could generate incorrect 448 JavaScript. 449- The Erlang code generated by the `/.` operator no longer generates a warning 450 for the upcoming negative zero float change in Erlang OTP 27. 451- Fixed a bug where using only types from an aliased import, wouldn't stop the 452 compiler from emitting an unused alias warning for that import. 453- Fixed a bug where the formatter would remove the ` as name` from string prefix 454 patterns. 455- Fixed a bug where the formatter would misplace comments at the start of a 456 block. 457- Fixed a bug where using a string prefix pattern in `let assert` would generate 458 incorrect JavaScript. 459 460## v0.32.4 - 2023-11-09 461 462### Build tool changes 463 464- The build tool now supports rebar3 and mix hex packages where the package name 465 differs from the otp application name. 466 467### bug fixes 468 469- Fixed a bug where invalid javascript code could be generated when a module 470 function calls another function that was passed as an argument and the 471 argument has the same name as the module function. 472- Fixed the `target` property of `gleam.toml` being ignored for local path 473 dependencies by `gleam run -m module/name` 474 475## v0.32.3 - 2023-11-07 476 477### Language changes 478 479- Imported modules can now be discarded by giving them an alias starting with `_`. 480 481### Build tool changes 482 483- New projects are now generated with the call to `gleam format` coming last in 484 the GitHub Actions workflow. This is so that feedback from tests is presented 485 even if formatting is incorrect. 486- Added Windows support for the `gleam export erlang-shipment` command. 487 488### Bug fixes 489 490- Fixed a bug where some nested pipelines could fail to type check. 491 492## v0.32.2 - 2023-11-03 493 494### Build tool changes 495 496- New Gleam projects are created with `gleam_stdlib` v0.32 and `gleeunit` v1.0. 497 498### Bug fixes 499 500- Fixed a bug where `gleam fix` would not produce correct results for code that 501 shadowed a prelude name with an import of the same name but a different kind. 502- Fixed a bug where documentation would not publish to Hexdocs for packages with 503 a number in the name. 504- Fixed a bug where aliased unqualified types and values of the same name could 505 produce an incorrect error. 506 507## v0.32.1 - 2023-11-02 508 509### Bug fixes 510 511- Fixed a bug where `gleam fix` would not produce correct results for code that 512 shadowed a prelude name with an import of the same name but a different kind. 513- Fixed a bug where incorrect JavaScript could be generated due to backwards 514 compatibility with the deprecated import syntax. 515 516## v0.32.0 - 2023-11-01 517 518### Bug fixes 519 520- Fixed a bug where running `gleam fix` multiple times could produce incorrect 521 results. 522 523## v0.32.0-rc3 - 2023-10-26 524 525### Bug fixes 526 527- Fixed a bug where `gleam fix` would fail to update the deprecated type import 528 syntax for aliased unqualified types. 529 530## v0.32.0-rc2 - 2023-10-26 531 532### Bug fixes 533 534- Fixed a bug where the backward compatibility for the deprecated import syntax 535 could result in an import error with some valid imports. 536 537## v0.32.0-rc1 - 2023-10-25 538 539### Language changes 540 541- Using `import module.{TypeName}` to import a type has been deprecated, 542 replaced by `import module.{type TypeName}`. In a future version of Gleam the 543 old syntax will only import the value of the same name. Run `gleam fix` to 544 update your code. 545- The `BitString` type has been renamed to `BitArray`. Run `gleam fix` to update 546 your code. 547- The `binary` and `bit_string` bit array modifier have been deprecated in favour 548 of `bytes` and `bits`. 549- The error message for when one element in a list doesn't match the others has 550 been improved. 551- The error message for when the elements of a list's tail don't match the 552 previous ones has been improved. 553- The error message for when one tries to access an unknown field has been 554 improved. 555- The `__gleam_prelude_variant__` property has been removed from the classes 556 defined in the JavaScript prelude. 557- The deprecated `todo("...")` syntax has been removed. 558- Module access can now be used in case clause guards. 559- The JS target now supports bit syntax for module constants. 560- The Erlang compiler will no longer emit a duplicate warning for unused 561 functions. 562- The `@deprecated` attribute can now be used with type definitions. 563- A warning is now emitted if a module alias is unused. 564 565### Language server changes 566 567- The language server now has a code action for removing unused items. 568- The language server now shows the type of variables defined using `use` on 569 hover. 570 571### Build tool changes 572 573- The `gleam check` command supports the `target` flag. 574- The `gleam fix` command updates code to use `BitArray` rather than `BitString`. 575- The `gleam fix` command updates code to use the new import type syntax. 576- `gleam fix` sets the `gleam` version constraint in `gleam.toml` to `>= 0.32.0`. 577- The `gleam` version constraint field in `gleam.toml` now disregards pre and 578 build components when checking for compatibility. 579- The prelude is no longer rendered once per package when compiling to 580 JavaScript, instead one copy is rendered for the entire project. If you are 581 using the `gleam compile-package` API you now need to give a path to the 582 prelude using the `--javascript-prelude` flag. 583- The `gleam export javascript-prelude` and `gleam export typescript-prelude` 584 commands have been added to export a copy of the prelude. This command may be 585 useful for build tools that use the compiler via the `gleam compile-package` 586 API. 587- Fixed a bug where some deprecation messages would not be printed. 588- The content has been made wider in rendered HTML documentation. 589- Dependencies that can be built with both `mix` and `rebar3` are now built 590 with `mix` if it exists on the system, and with `rebar3` if it doesn't. 591 592### Bug fixes 593 594- "Compiling $package" is now only printed when a package has new changes to 595 compile. 596- The main process started with `gleam run` no longer traps exits on Erlang. 597- The formatting of code in rendered HTML documentation has been improved. 598- The formatter no longer moves trailing comments out of custom type definitions. 599- Fixed a bug where some hexadecimal numbers would generate incorrect Erlang. 600- Fixed a bug where markdown tables would not render correctly in HTML 601 documentation. 602- The float 0.0 is now rendered in Erlang as `+0.0` to silence warnings in 603 Erlang/OTP 27. 604 605## v0.31.0 - 2023-09-25 606 607- New Gleam projects are created with `gleam_stdlib` v0.31, `actions/checkout` 608 v3.\*, and `erlef/setup-beam` v1.\*. 609- A note is included in the generated HTML documentation if a function is 610 deprecated. 611 612## v0.31.0-rc1 - 2023-09-18 613 614- The `@deprecated("...")` attribute can be used to mark a function as 615 deprecated. This will cause a warning to be emitted when the function is used. 616- A warning is now emitted if a module from a transitive dependency is imported. 617- Record access can now be used in case clause guards. 618- Fixed a bug where `manifest.toml` could contain absolute paths for path 619 dependencies. 620- The `as` keyword can now be used to assign the literal prefix to a variable 621 when pattern matching on a string. 622- The `if` conditional compilation, `external fn`, and `external type` syntaxes 623 have been removed. 624- The `description` flag for the `gleam new` command has been removed. 625- The highlight.js grammar included with generated HTML documentation has been 626 updated for the latest syntax. 627- Packages are no longer precompiled to Erlang when publishing to Hex if the 628 package target is set to JavaScript. 629- An exception is now raised if JavaScript code uses the `BitString` class 630 constructor and passes in the incorrect argument type. 631- Fixed a bug where mutually recursive functions could be incorrectly inferred 632 as having an overly general type. 633- Fixed a bug where recursive type constructors could incorrectly infer a type 634 error. 635- Fixed a bug where some mutually recursive functions would be inferred as 636 having too general a type. 637- Fixed a bug where constants where not being correctly inlined when used in the 638 size option of a bit string pattern match. 639- Fixed a bug where anonymous functions could parse successfully when missing a 640 body. 641- Fixed a bug where incorrect unused variable warnings could be emitted for code 642 that doesn't type check. 643- Fixed a bug where packages defaulting to the JavaScript target could have 644 modules missing from their HTML documentation when published. 645- Corrected some outdated links in error messages. 646- Hovering over a function definition will now display the function signature, 647 or the type of the hovered argument. 648- Use `import type` for importing types from typescript declarations. 649- Use `.d.mts` extension for typescript declarations to match `.mjs`. 650- Prefix module names with dollar sign in typescript to avoid name collisions. 651 652## v0.30.4 - 2023-07-26 653 654- External implementations are always referenced directly in generated code, to 655 avoid the overhead of an extra function call. 656- Fixed a bug where the compiler could infer incorrect generic type parameters 657 when analysing a module without type annotations with self recursive 658 functions that reference themselves multiple times. 659 660## v0.30.3 - 2023-07-23 661 662- Fixed a bug where JavaScript module path such as `node:fs` would be rejected. 663- New Gleam projects are created with `gleam_stdlib` v0.30, Erlang OTP v26.0.2, 664 Elixir v1.15.4, actions/checkout v3.5.1, and erlef/setup-beam v1.16.0. 665 666## v0.30.2 - 2023-07-20 667 668- Fixed a bug where the compiler could infer incorrect generic type parameters 669 when analysing a module without type annotations with self recursive 670 functions. 671- Fixed a bug where the formatter would incorrectly format external functions 672 by breaking the return annotation instead of the function arguments. 673 674## v0.30.1 - 2023-07-13 675 676- Fixed a bug where the language server could fail to import path dependencies 677 in monorepos. 678 679## v0.30.0 - 2023-07-12 680 681- A warning is now emitted for the deprecated external fn syntax. 682 683## v0.30.0-rc4 - 2023-07-10 684 685- An error is now emitted for invalid JavaScript external implementations. 686- Fixed a bug where Erlang external implementations could generate invalid code. 687 688## v0.30.0-rc3 - 2023-07-05 689 690- Fixed a bug where `gleam fix` would fail to parse command line flags. 691 692## v0.30.0-rc2 - 2023-07-03 693 694- Fixed a bug where `gleam fix` would merge external functions of the same name 695 but incompatible types. 696- Fixed a bug where external function arguments would incorrectly be marked as 697 unused. 698 699## v0.30.0-rc1 - 2023-06-29 700 701- The new `@target(erlang)` and `@target(javascript)` attribute syntax has been 702 added for conditional compilation. The existing `if` conditional compilation 703 syntax has been deprecated. Run `gleam fix` to update your code. 704- The new `type TypeName` syntax syntax replaces the `external type TypeName` 705 syntax. The existing external type syntax has been deprecated. Run `gleam format` 706 to update your code. 707- Adding a new dependency now unlocks the target package. This helps avoid 708 failing to find a suitable version for the package due to already being 709 locked. 710- A custom message can now be specified for `panic` with `panic as "..."`. 711- The syntax for specifying a custom message for `todo` is now `todo as "..."`. 712- The Erlang error raised by `let assert` is now tagged `let_assert`. 713- Types named `Dynamic` are now called `dynamic_` in Erlang to avoid a clash 714 with the new Erlang `dynamic` type introduced in OTP26. 715- Dependencies can now be loaded from paths using the 716 `packagename = { path = "..." }` syntax in `gleam.toml`. 717- The `javascript.deno.unstable` field in `gleam.toml` can now be used to 718 enable Deno's unstable APIs when targeting JavaScript. 719- Blockquotes are now styled in rendered HTML documentation. 720- The `gleam` property can be set in `gleam.toml` can be set to a version 721 requirement to specify the version of Gleam required to build the project. 722- Type aliases can now refer to type aliases defined later in the same module. 723- Fixed a bug where unapplied record constructors in constant expressions would 724 generate invalid Erlang. 725- Fixed a bug where the prescedence of `<>` and `|>` would clash. 726- Fixed a bug where `gleam docs build` would print an incorrect path upon 727 completion. 728- Warnings from dependency packages are no longer surfaced in the language 729 server. 730- A warning is now emitted when a Gleam file is found with an invalid name. 731- A warning is now emitted when using `list.length` to check for the empty list, 732 which is slow compared to checking for equality or pattern matching (#2180). 733- The new `gleam remove <package_name>` can be used to remove dependencies 734 from a Gleam project. 735- Fixed a bug where the formatter could crash. 736- Fixed a bug where invalid Erlang would be generated when piping into `panic`. 737- The `gleam docs build` command gains the `--open` flag to open the docs after 738 they are generated (#2188). 739- Fixed a bug where type annotations for constants could not be written with 740 type annotations. 741- Updated font loading in generated HTML documentation to fix an issue with 742 fonts not loading properly in some browsers (#2209). 743 744## v0.29.0 - 2023-05-23 745 746- New projects now require `gleam_stdlib` v0.29. 747 748## v0.29.0-rc2 - 2023-05-22 749 750- The `gleam lsp` command is no longer hidden from the help output. 751- Fixed a bug where some language server clients would show autocompletion 752 suggestions too eagerly. 753 754## v0.29.0-rc1 - 2023-05-16 755 756- The language server will now provide autocomplete suggestions for types and 757 values either imported or defined at the top level of the current module. 758- Fixed a bug where record patterns using the spread operator (`..`) to discard 759 unwanted arguments would not type check correctly when the record had no 760 labelled fields. 761- Add support for using sized binary segments in pattern matches when targeting 762 JavaScript. 763- A warning is now emitted for double unary negation on ints (`--`) and bools 764 (`!!`) as this does nothing but return the original value. 765- Previously the build tool would discard the entire build directory when dependencies 766 were changed. Now it will only discard the build artefacts for removed 767 dependencies. 768- The errors emitted when a name is reused in a module have been made clearer. 769- Fixed an incorrect URL in the error message for failing to parse a let binding 770 with a type annotation. 771- Fixed a bug where shadowing a prelude type name could result in incorrect 772 errors in exhaustiveness checking. 773- Fixed a bug where the language server would in some scenarios not remove an 774 error diagnostic after it becomes outdated. 775- Fixed a bug where the formatter would incorrectly format blocks with a comment 776 before them that were the only argument to a function call. 777- Fixed a bug where the language server would not reset the build directory when 778 it was created by a different version of Gleam. 779- New Gleam projects are created with `erlef/setup-beam@v1.15.4` in their GitHub 780 actions CI configuration. 781- Running a module now uses the dependency's target and runtime in its `gleam.toml`. 782 783## v0.28.3 - 2023-04-17 784 785- Fixed a bug where the language server would show outdated error diagnostics 786 when a new one was emitted in a different module. 787- Fixed a bug where the language server would attempt to analyse Gleam modules 788 that were outside of the `src` or `test` directories. 789- New Gleam projects are created with `actions/checkout@v3.5.1` and 790 `erlef/setup-beam@1.15.3` in their GitHub actions CI configuration. 791 792## v0.28.2 - 2023-04-10 793 794- Fixed a bug where comments above a `use` expression would be formatted 795 incorrectly. 796- Fixed a bug where the formatter would fail to preserve empty lines after a 797 block. 798- Fixed a bug where the formatter would fail to preserve empty lines after an 799 anonymous function with a return annotation. 800 801## v0.28.1 - 2023-04-05 802 803- Fixed a bug where the language server would unset too many error diagnostics 804 when multiple projects are open, more than one have errors, and one of them is 805 successfully compiled. 806- Fixed a bug where the language server would unset error diagnostics when 807 displaying information on hover. 808- Added support for type annotations in use statements. 809 810## v0.28.0 - 2023-04-03 811 812- New projects now require `gleam_stdlib` v0.28. 813 814## v0.28.0-rc3 - 2023-03-31 815 816- Fixed a bug where source links would be incorrect in HTML documentation. 817 818## v0.28.0-rc2 - 2023-03-27 819 820- Fixed a bug where single statement blocks inside binary operators could 821 generate invalid JavaScript. 822- Fixed a bug where the formatter could incorrectly place comments. 823- Fixed a bug where the language server would show outdated diagnostics when a 824 file with an error reverts to the previous valid version, causing the compiler 825 to use the cached version of the file. 826 827## v0.28.0-rc1 - 2023-03-26 828 829- The language server now analyzes files on edit rather than on save, providing 830 feedback faster. 831- The language server now supports editor sessions that span multiple projects. 832 This is useful for mono-repos and projects with both a frontend and backend in 833 Gleam. 834- The language server now also shows documentation on hover for expressions. 835- The language server now shows types and documentation on hover for patterns. 836- Added support for negation of integers with the new `-` unary operator. 837- Variable assignments are now only permitted within a function or a block, not 838 anywhere that an expression is permitted. 839- The deprecated `try` expression has been removed. 840- The deprecated `assert ... = ...` syntax has been removed. 841- Semicolons are no longer whitespace. An error will be emitted if one is 842 encountered. 843- Warnings are now immediately emitted rather than being buffered until the end 844 of the compilation. 845- The `--warnings-as-errors` flag is now supported by `gleam build`. 846- Blocks are now preserved by the formatter when they only have a single 847 expression within them. 848- Generated docs now export more meta data to improve the developer experience, 849 accessibility and search engine discoverability. 850- Files are now only recompiled if they have changed since the last compilation, 851 detected by file hash and modification time. Previously only the modification 852 time was used. 853- Autocompletion of module imports was removed due to a buggy implementation. 854- Fixed a bug where the formatter would incorrectly remove `{ ... }` from bit 855 string segment value expressions. 856- Fixed a bug where TypeScript type definitions files could include incorrect 857 type names. 858- Fixed a bug where the compiler used VSCode specific behaviour in the language 859 server which was incompatible with Helix. 860- Fixed a bug where string concatenation patterns on strings with escape 861 characters would generate javascript code with wrong slice index. 862- Fixed a bug where blocks could parse incorrectly. 863- Allow modules to be run with the `gleam run --module` command. 864 865## v0.27.0 - 2023-03-01 866 867- Fixed a bug where `panic` could generate incorrect JavaScript code. 868- New projects now require `gleam_stdlib` v0.27. 869 870## v0.27.0-rc1 - 2023-02-26 871 872- The new `panic` keyword can be used to crash the program. This may be useful 873 for situations in which a program has got into an unrecoverable invalid state. 874- `try` expressions are now deprecated and will be removed in a future version. 875- The new `gleam fix` command can be used to automatically convert `try` 876 expressions to `use` expressions. 877- `let assert ... = ...` is now the syntax for assertion assignments. The 878 `assert ... = ...` syntax is deprecated and will be removed in a future 879 version. Run `gleam format` to automatically update your code. 880- `gleam export hex-tarball` can be used to create a tarball suitable for 881 uploading to a Hex compatible package repository. 882- The unused private type and constructor detection has been improved. 883- The argument `--runtime` now accepts `nodejs` as the name for that runtime. 884 The previous name `node` is still accepted. 885- Patterns can now be used in `use` expressions. 886- Fixed a bug where string concatenation patterns could generate javascript 887 code with wrong slice index due to ut8/ut16 length mismatch. 888- The Erlang compiler will no longer emit a duplicate warning for unused 889 variables. 890- Fixed a bug where typescript type definitions for types with unlabelled 891 arguments where generated with an invalid identifier and unlabelled fields 892 were generated with a name that didn't match the javascript implementation. 893- Fixed a bug in the type inferrer were unannotated functions that were 894 used before they were defined in a module could in rare cased be inferred 895 with a more general type than is correct. 896- Fixed a bug where the LSP would fail to show type information on hover for 897 expressions after a use expression. 898- Fixed a bug where imported constants could generated incorrect JavaScript 899 code. 900- Fixed a bug where the LSP would perform codegen for dependencies. 901- Fixed a bug where the LSP would compile native dependencies needlessly. 902- Fixed a bug where integer division with large numbers on JavaScript could 903 produce incorrect results. 904- Fixed a bug where pattern matches on custom types with mixed labelled and 905 unlabelled arguments could not be compiled when targeting JavaScript. 906- Fixed a bug where local variables in case guard constant expressions caused 907 the compiler to panic. 908- The formatter now truncates meaningless zeroes of floats' fractional parts. 909- Anonymous functions may now have an empty body. The compiler will emit a 910 warning for functions without a body, and these functions will crash at 911 runtime if executed. 912- Fixed bug where raised errors on JS would have an extra stack frame recorded 913 in them. 914 915## v0.26.2 - 2023-02-03 916 917- The formatter now wraps long `|` patterns in case clauses over multiple lines. 918- Fixed a bug where unlabelled function arguments could be declared after 919 labelled ones. 920- A broken link was removed from the error messages. 921- Fixed a bug where using a qualified imported record constructor function as a 922 value would produce invalid Erlang code if the name of the record variant was 923 an Erlang reserved word. 924 925## v0.26.1 - 2023-01-22 926 927- New projects now require `gleeunit` v0.10. 928- Rebar3 dependency projects are now compiled in-place. This fixes an issue 929 where some NIF using projects would fail to boot due to some paths not being 930 copied to the `build` directory. 931- An error is now emitted if a list spread expression is written without a tail 932 value. 933- An error is now emitted when a function is defined with multiple arguments 934 with the same name. 935- The error message emitted when a `let` does not match all possible values has 936 been improved. 937- Fixed a bug where the language server wouldn't analyse test code. 938- Fixed a bug where `assert` expressions can generate invalid Erlang. 939 warning. 940- Fixed a bug where arguments would be passed incorrectly to Deno. 941- Fixed a bug where defining variables that shadow external functions could 942 generate invalid JavaScript. 943 944## v0.26.0 - 2023-01-19 945 946[Release blog post](https://gleam.run/news/v0.26-incremental-compilation-and-deno/) 947 948- New projects require `gleam_stdlib` v0.26 and `gleeunit` v0.9. 949- Fixed a bug where JavaScript default projects would fail to publish to Hex. 950 951## v0.26.0-rc1 - 2023-01-12 952 953- Added support for Deno runtime for JavaScript target. 954- Scientific notation is now available for float literals. 955- The compiler now supports incremental compilation at the module level. If a 956 module or its dependencies have not been changed then it will not be 957 recompiled. 958- The format used by the formatter has been improved. 959- 4 digit integers are now always formatted without underscores. 960- Running `gleam new` will skip `git init` if the new project directory is 961 already part of a git work tree. 962- Generated HTML documentation now includes all static assets, including web 963 fonts, so that it can be accessed offline and in future once CDNs would 404. 964- Generated HTML documentation now supports TypeScript syntax highlighting. 965- New Gleam projects are created using GitHub actions erlef/setup-beam@v1.15.2. 966- Some modules can now be hidden from the docs by specifying a list of glob 967 patterns in `internal_modules` in `gleam.toml`. The default value for this 968 list is `["$package_name/internal", "$package_name/internal/*"]`. 969- The `gleam new` command gains the `--skip-git` flag to skip creation of 970 `.git/*`, `.gitignore` and `.github/*` files. 971- The `gleam new` command gains the `--skip-github` flag to skip creation of 972 `.github/*` files. 973- Fixed a bug where no error would be emitted if a `src` module imported a 974 `test` module. 975- Fixed a bug where comments in list prepending expressions could be formatted 976 incorrectly. 977- Fixed a bug where comments in record update expressions could be formatted 978 incorrectly. 979- Fixed a bug where long `use` expressions could be formatted incorrectly. 980- Fixed a bug integer multiplication would overflow large integers when 981 compiling to JavaScript. 982- Fixed `int` and `float` formatting in `const`s and patterns. 983- Fixed a bug where piping into a function capture expression with a pipe as one 984 of the arguments would produce invalid Erlang code. 985- Formatter no longer removes new lines in expression blocks within case branches 986 987## v0.25.3 - 2022-12-16 988 989- 4 digit integers are no longer automatically formatted with underscores. 990 991## v0.25.2 - 2022-12-16 992 993- Updated `actions/checkout` from `actions/checkout@v3.0.0` to `@v3.2.0` for 994 projects created via `gleam new`. 995- Fixed a bug where `gleam new` would set a `Rebar3` version to `25.1` 996 instead of the latest stable `3`. 997- Updated following runtime versions set via `gleam new`: `Erlang/OTP` 998 to `25.2`, and `Elixir` to `1.14.2`. 999- The formatter now inserts underscores into larger `Int`s and the larger 1000 integer parts of `Float`s. 1001- Added support for top level TypeScript file inclusion in builds. 1002- The build tool will now favour using rebar3 over Mix for packages that support 1003 both. This fixes an issue where some packages could not be compiled without 1004 Elixir installed even though it is not strictly required. 1005 1006## v0.25.1 - 2022-12-11 1007 1008- New Gleam projects are now configured to explicitly install rebar3 using 1009 GitHub actions erlef/setup-beam. 1010- A better error message is now shown when attempting to use a function within a 1011 constant expression. 1012- Changed float size limit in bit string expressions to 16, 32 or 64, when static. 1013 Also allowed dynamic size. 1014- New Gleam projects are created using GitHub actions erlef/setup-beam@v1.15.0. 1015- Fixed a bug where returning an anonymous function from a pipeline and calling 1016 it immediately without assigning it to a variable would produce invalid Erlang 1017 code. 1018- Fixed a bug where the formatter would remove the braces from negating boolean 1019 expressions. 1020 1021## v0.25.0 - 2022-11-24 1022 1023[Release blog post](https://gleam.run/news/v0.25-introducing-use-expressions/) 1024 1025## v0.25.0-rc2 - 2022-11-23 1026 1027- Fixed a bug where Gleam dependency packages with a `priv` directory could fail 1028 to build. 1029- Fixed a regression where Elixir and Erlang Markdown code blocks in generated 1030 documentation would not be highlighted. 1031 1032## v0.25.0-rc1 - 2022-11-19 1033 1034- Generated HTML documentation now includes the `theme-color` HTML meta tag. 1035- The `use` expression has been introduced. This is a new syntactic sugar that 1036 permits callback using code to be written without indentation. 1037- Nightly builds are now also published as OCI container images hosted on 1038 GitHub. 1039- Fixed a bug where the build tool would not hook up stdin for Gleam programs it 1040 starts. 1041- Fixed a bug where using a record constructor as a value could generate a 1042 warning in Erlang. 1043- Fixed a bug where the build tool would use precompiled code from Hex packages 1044 rather than the latest version, which could result in incorrect external 1045 function usage in some cases. 1046- Fixed a bug where the warning for `todo` would not print the type of the code 1047 to complete. 1048- Fixed a bug where `try` expressions inside blocks could generate incorrect 1049 JavaScript. 1050- Generated HTML documentation now includes all static assets (but the web 1051 fonts), so that it can be accessed offline or in far future once CDNs would 404. 1052- New Gleam projects are created using GitHub actions erlef/setup-beam@v1.14.0 1053- The `javascript.typescript_declarations` field in `gleam.toml` now applies to 1054 the entire project rather than just the top level package. 1055- The formatter now adds a `0` to floats ending with `.` (ie `1.` => `1.0`). 1056- New projects require `gleam_stdlib` v0.25. 1057 1058## 0.24.0 - 2022-10-25 1059 1060[Release blog post](https://gleam.run/news/gleam-v0.24-released/) 1061 1062## 0.24.0-rc4 - 2022-10-23 1063 1064- Fixed a bug where the string concatenate operator could produce invalid Erlang 1065 code when working with pipe expressions. 1066 1067## 0.24.0-rc3 - 2022-10-20 1068 1069- Fixed a bug where the OOP method call error hint would be shown on too many 1070 errors. 1071- Fixed a bug where the string concatenate operator could produce invalid Erlang 1072 code when working with constant values. 1073 1074## 0.24.0-rc2 - 2022-10-18 1075 1076- Fixed a bug where imported and qualified record constructors used in constant 1077 expressions could fail to resolve. 1078 1079## 0.24.0-rc1 - 2022-10-15 1080 1081- Gleam can now compile Elixir files within a project's `src` directory. 1082- The `<>` operator can now be used for string concatenation and for string 1083 prefix pattern matching. 1084- Fixed a bug where TypeScript definitions may have incorrect type parameters. 1085- New projects depend on `gleam_stdlib` v0.24. 1086- New projects' GitHub Actions config specifies Erlang/OTP 25.1 and suggest 1087 Elixir 1.14.1. 1088- If you attempt to use the method call syntax (`thing.method()`) on a value 1089 without that field the error message will now include a hint explaining that 1090 Gleam is not object oriented and does not have methods. 1091- Fixed a bug in the formatter where multiple line documentation comments for 1092 custom type constructor fields could be formatted incorrectly. 1093- Fixed a bug where tail call optimisation could be incorrectly applied when 1094 compiling to JavaScript in some situations. 1095- Fixed a bug where the remainder operator would return NaN results when the 1096 right hand side was zero when compiling to JavaScript. 1097- Fixed a bug where Elixir dependencies would fail to compile on Windows. 1098- Fixed a bug where images added to HTML documentation via documentation 1099 comments would not have a max width. 1100 1101## v0.23.0 - 2022-09-15 1102 1103[Release Blog Post](https://gleam.run/news/gleam-v0.23-released/) 1104 1105## v0.23.0-rc2 - 2022-09-15 1106 1107- New Gleam projects are created using GitHub actions erlef/setup-beam@v1.13.0 1108 and actions/checkout@v3.0.0. 1109- New Gleam projects are created using version v0.23.0 of the stdlib. 1110- Fixed a bug where LSP hovering would fail to locate the expression. 1111 1112## v0.23.0-rc1 - 2022-09-01 1113 1114- Gleam can now build dependency packages that are managed using Mix. 1115- Compiler performance has been improved by buffering disc writing and by lazily 1116 loading TLS certs. In testing this doubles performance when compiling the 1117 standard library. 1118- The `gleam publish` command now adds the `priv` directory and any `NOTICE` 1119 file to the tarball. 1120- The `gleam update` command can now be used to update dependency packages to 1121 their latest versions. 1122- Module functions with empty bodies are no longer syntax errors. 1123- The format used by the formatter has been improved. 1124- OpenSSL swapped out for RustTLS. 1125- Generated HTML documentation now includes a search bar. 1126- The LSP will now provide autocompletion for imports. 1127- A helpful error message is now returned when assignments are missing either a 1128 keyword or a value. 1129- Qualifiers are now used when multiple types have the same name in an error 1130 message. 1131- In JavaScript, if an object has defined an `equals` method in its prototype, 1132 Gleam will now use this method when checking for equality. 1133- Functions can now be defined and referenced in constant expressions. 1134- An error is now raised if the record update syntax is used with a custom type 1135 that has multiple constructors. 1136- An error is now raised if a module is imported multiple times. 1137- Fixed a bug where defining a type named `CustomeType` would product invalid 1138 JavaScript. 1139- Fixed a bug where defining a variable with the same name as an unqualified 1140 import would produce invalid JavaScript. 1141- Fixed a bug where piping to `todo` would generate invalid Erlang code. 1142- Fixed a bug where inspecting a JavaScript object with a null prototype would 1143 crash. 1144- Fixed a bug where the formatter could crash if source code contained 3 or more 1145 empty lines in a row. 1146- Fixed a bug where the formatter would remove braces from blocks used as the 1147 subject of a case expression. 1148- Fixed a bug alternative patterns with a clause containing a pipe with a pipe 1149 after the case expression could render incorrect Erlang. 1150- Fixed a bug where formatter would strip curly braces around case guards even 1151 when they are required to specify boolean precedence. 1152- Fixed a bug where `gleam new` would in some situations not validate the 1153 target directory correctly. 1154- Fixed a bug where pipes inside record update subjects could generate invalid 1155 Erlang. 1156- Fixed a bug where pipes inside record access could generate invalid Erlang. 1157 1158## v0.22.1 - 2022-06-27 1159 1160- The `gleam publish` confirmation prompt now accepts both "Y" and "y". 1161- Fixed a bug where `todo` would not emit the correct line number to the LSP while. 1162 1163## v0.22.0 - 2022-06-12 1164 1165[Release Blog Post](https://gleam.run/news/gleam-v0.22-released/) 1166 1167- New projects are created with `gleam_stdlib` v0.22. 1168 1169## v0.22.0-rc1 - 2022-06-12 1170 1171- Fixed a bug where doc comments would dissociate from their statements when 1172 generating html documentation. 1173- You are now allowed to use named accessors on types with multiple constructors if the 1174 accessor's name, position and type match (among the constructors) (#1610). 1175- Added the ability to replace a release up to one hour after it is published 1176 using `gleam publish --replace`. 1177- `gleam publish`, `gleam docs publish`, `gleam docs remove`, `gleam hex retire`, 1178 and `gleam hex unretire` now have access to environment variables for 1179 username (default key `HEXPM_USER`) and password (default key `HEXPM_PASS`) 1180- The `gleam publish` command gains the `-y/--yes` flag to disable the "are you 1181 sure" prompt. 1182- Clear outdated files from the build directory after compilation. 1183- Fixed a bug where immediately calling the value that a case expression 1184 evaluates to could generate invalid JavaScript. 1185- Fixed a bug where the default project target is set to JavaScript, 1186 but the project would run on target Erlang instead. 1187- The compiler is now able to generate TypeScript declaration files on target 1188 JavaScript (#1563). To enable this edit `gleam.toml` like so: 1189 1190 ```toml 1191 [javascript] 1192 typescript_declarations = true 1193 ``` 1194 1195- Fixed a bug where argument labels were allowed for anonymous functions. 1196- Fixed a bug where JavaScript code could be invalid if a variable is defined 1197 inside an anonymous function with a parameter with the same name as the 1198 variable. 1199- Fixed a bug where importing a JavaScript function named "then" could produce 1200 invalid code. 1201- Fixed a bug where constants that reference locally defined custom types could 1202 render invalid JavaScript. 1203- The project generator will no longer permit use of the reserved `gleam_` 1204 prefix. 1205- Generated HTML docs easter egg updated. 1206- `gleam export erlang-shipment` can be used to create a directory of compiled 1207 Erlang bytecode that can be used as a deployment artefact to get your 1208 application live. 1209- `gleam format` will now preserve (up to one) empty lines between consecutive 1210 comments, as well as between comments and any following expression 1211- The deprecated rebar3 integration has been removed. 1212- Fixed a bug where `gleam format` would output an unwanted newline at the top 1213 of documents that only contain simple `//` comments. 1214- No longer add `dev_dependencies` to generated `.app` Erlang files unless 1215 we're compiling the root project (#1569). 1216- Fixed a bug where the formatter could render a syntax error with lists on long 1217 unbreakable lines. 1218- Fixed a bug where JavaScript variable names could be incorrectly reused. 1219- Fixed a bug where `gleam format` would remove the braces around a tuple index 1220 access when accessing a field of the returned element. 1221- Fixed a bug case clause guards could render incorrect JavaScript if a variable 1222 name was rebinded in the clause body. 1223- The `gleam compile-package` command no longer generates a `.app` file. This 1224 should now be done by the build tool that calls this command as it is 1225 responsible for handling dependencies. 1226- Fixed a bug where piping a list tail would create invalid Erlang code (#1656). 1227 1228## v0.21.0 - 2022-04-24 1229 1230[Release Blog Post](https://gleam.run/news/v0.21-introducing-the-gleam-language-server/) 1231 1232- New projects are created with `gleam_stdlib` v0.21. 1233 1234## v0.21.0-rc2 - 2022-04-20 1235 1236- Added the ability to replace a release up to one hour after it is published 1237 using `gleam publish --replace`. 1238- The language server will now enter a degraded mode that only performs 1239 formatting if running in a directory that is not a Gleam project with a 1240 `gleam.toml`. 1241 1242## v0.21.0-rc1 - 2022-04-16 1243 1244- The Gleam language server is here! This will provide IDE like features for 1245 code editors that support LSP, including but not limited to VSCode, Neovim, 1246 Emacs, Eclipse, Visual Studio, and Atom. This first version includes these 1247 features: 1248 - Project compilation. 1249 - Inline errors and warnings. 1250 - Type information on hover. 1251 - Go-to definition. 1252 - Code formatting. 1253- Fixed a bug in generated JavaScript code where functions named `then` would 1254 cause errors when dynamically imported. 1255- Initialize `git` repo when creating a new project. 1256- Log messages controlled with `GLEAM_LOG` now print to standard error. 1257- Log message colours can be disabled by setting the `GLEAM_LOG_NOCOLOUR` 1258 environment variable. 1259- You can now specify multiple packages when using `gleam add`. 1260- Bools can now be negated with the `!` unary operator. 1261- If the compiler version changes we now rebuild the project from scratch on 1262 next build command to avoid issues arising from reading metadata in an old 1263 format (#1547). 1264- Updated the "Unknown label" error message to match other error messages 1265 (#1548). 1266- Type holes are now permitted in function arguments and return annotations 1267 (#1519). 1268- Unused module imports now emit a warning (#1553). 1269- The error message for failing to parse a multiline clauses without curly 1270 braces has been improved with a hint on how to fix the issue (#1555). 1271- The error messages for when rebar3 or Erlang are missing from the machine has 1272 been improved with a tip on how to install them (#1567). 1273- Corrected the hint given with certain int and float binary operator type 1274 errors. 1275- Add support for `int` and `float` bit string type when compiling to JavaScript. 1276- Add support for specifying size of integers in a bit string. Supports only exact binaries, 1277 i.e. length is a multiple of 8. 1278- Fixed compilation of rebar3 based dependencies on Windows. 1279 1280## v0.20.1 - 2022-02-24 1281 1282- The type checker has been improved to enable use of the record access syntax 1283 (`record.field`) in anonymous functions passed into higher order functions 1284 without additional annotations. 1285 1286## v0.20.0 - 2022-02-23 1287 1288[Release Blog Post](https://gleam.run/news/gleam-v0.20-released/) 1289 1290- New projects are created with `gleam_stdlib` v0.20. 1291 1292## v0.20.0-rc1 - 2022-02-20 1293 1294- Type unification errors involving user annotated types now refer to the names 1295 specified by the user instead of internal rigid-type ids. 1296- The build tool now validates that listed licenses are valid SPDX expressions. 1297- A WebAssembly version of the compile is now available for use in JavaScript 1298 and other WebAssembly environments. 1299- New projects include Hex badges and a link to Hexdocs. 1300- Enhance type mismatch errors in the presence of try. 1301- Enhance type mismatch error for an inconsistent try. 1302- Enhance type mismatch error for pipe expressions to show the whole pipeline 1303 and not only its first line. 1304- Fixed a bug where sometimes type variable could be reused result in incorrect 1305 non-deterministic type errors. 1306- Built in support for the Mix build tool has been removed. The `mix_gleam` 1307 plugin is to be used instead. 1308- Introduce a limited form of exhaustiveness checking for pattern matching 1309 of custom types, which only checks that all constructor tags are covered 1310 at the top level of patterns. 1311- The `ebin` directory is now copied to the build directory for rebar3 managed 1312 dependencies if present before compilation. 1313- The format used by the formatter has been improved. 1314- Package names in `gleam.toml` are validated when the config is read. 1315- The `priv` directory is linked into the build directory for Gleam projects 1316 managed by the build tool. 1317- Fixed a bug where type errors from pipes could show incorrect information. 1318- Fixed a bug where types could not be imported if they had the same name as a 1319 value in the prelude. 1320 1321## v0.19.0 - 2022-01-12 1322 1323Dedicated to the memory of Muhammad Shaheer, a good and caring man. 1324 1325[Release Blog Post](https://gleam.run/news/gleam-v0.19-released/) 1326 1327## v0.19.0-rc4 - 2022-01-10 1328 1329- New projects are created with `gleam_stdlib` v0.19 and `gleeunit` v0.6. 1330- Fixed a bug where external functions could be specified with the wrong module 1331 name in generated Erlang when imported from a nested module in another 1332 package. 1333- Fixed a bug where warnings wouldn't get printed. 1334 1335## v0.19.0-rc3 - 2022-01-07 1336 1337- Fixed a bug where precompiled packages would fail to compile due to Erlang 1338 files being compiled twice concurrently. 1339 1340## v0.19.0-rc2 - 2022-01-06 1341 1342- Erlang modules are now compiled in a multi-core fashion. 1343- New projects are created with `erlef/setup-beam` v1.9.0 instead of 1344 `gleam-lang/setup-erlang` and `gleam-lang/setup-gleam`. 1345- Fixed a bug where tail call optimisation could generate incorrect code when 1346 the function has argument names that are JavaScript keywords. 1347- Fixed a bug where the build would continue when dependency packages failed to 1348 compile. 1349- Fixed a bug where `include` directories would not be accessible by the Erlang 1350 compiler during Gleam compilation. 1351 1352## v0.19.0-rc1 - 2022-01-03 1353 1354- The build tool now supports the JavaScript target. The target can be specified 1355 in either `gleam.toml` or using the `--target` flag. 1356- The `gleam check` command has been introduced for rapidly verifying the types 1357 of Gleam code without performing codegen. 1358- `true` and `false` can no longer be used as pattern matching variables, to 1359 avoid accidental uses of incorrect syntax that is popular in other languages. 1360 An error will hint about using Gleam's `True` and `False` values instead. 1361- You can now remove build artefacts using the new `gleam clean` command. 1362- The `compile-package` can now generate `package.app` files and compile source 1363 modules to `.beam` bytecode files. 1364- The flags that `compile-package` accepts have changed. 1365- Published Hex packages now include precompiled Erlang files. 1366- Erlang record headers are now written to the `include` directory within the 1367 package build directory. 1368- The format used by the formatter has been improved. 1369- Fixed a bug where tail recursion could sometimes generated incorrect 1370 JavaScript code. 1371- Performance of code generators has been slightly improved. 1372- Allow the record in a record expansion to be an expression that returns a 1373 record. 1374- Fixed a bug where external function module names would not be escaped 1375 correctly if they contained special characters and were assigned to a 1376 variable. 1377- A helpful error message is shown if Erlang is not installed. 1378 1379## v0.18.2 - 2021-12-12 1380 1381- Erlang applications are now automatically started when the VM is started by 1382 `gleam run` and `gleam test`. 1383 1384## v0.18.1 - 2021-12-12 1385 1386- Fixed a bug where pipe expressions in record updates and operator expressions 1387 could generate incorrect Erlang code. 1388- The `priv` directory is now copied to the output directory for rebar3 packages 1389 prior to compilation. This is required for some packages to compile. 1390- Fixed a bug where deps that fail to compile would be skipped when compilation 1391 would next be attempted, resulting the project being in an invalid state. 1392 1393## v0.18.0 - 2021-12-06 1394 1395[Release Blog Post](https://gleam.run/news/gleam-v0.18-released/) 1396 1397- New projects now include `gleeunit`. 1398 1399## v0.18.0-rc3 - 2021-12-05 1400 1401- URL format in gleam.toml is now validated. 1402- The `gleam deps list` command has been added. 1403- Fixed a bug where changing requirements in `gleam.toml` would not cause deps 1404 to be re-resolved. 1405- Fixed a bug where locked deps would cause incompatible package requirements to 1406 be discarded. 1407- Development dependencies are now included in the applications listed in the 1408 generated OTP `.app` file. 1409- `gleam.toml` now includes an `erlang.extra_applications` key to specify extra 1410 OTP applications that need to be started. 1411 1412## v0.18.0-rc2 - 2021-11-26 1413 1414- Fixed a bug where OTP .app files would be generated with invalid syntax. 1415- Removed extra whitespace from newly generated projects. 1416 1417## v0.18.0-rc1 - 2021-11-25 1418 1419- Gleam can now compile Gleam projects. 1420- Gleam can now run tests with the `gleam eunit` command. 1421- Gleam can now run programs with the `gleam run` command. 1422- Gleam can now run an Erlang shell with the `gleam shell` command. 1423- Gleam can now resolve package versions for a Gleam project's dependency tree. 1424- Gleam can now download Hex packages. 1425- Gleam can now build dependency packages that are managed using Gleam or 1426 rebar3. 1427- Gleam is now the default build tool for new projects. 1428- The template names for `gleam new` have been changed. 1429- Fixed a bug where the error message for a record update with an unknown field 1430 would point to all the fields rather than the unknown one. 1431- Improved styling for inline code in generated documentation. 1432- New projects use v0.18 of the stdlib. 1433 1434## v0.17.0 - 2021-09-20 1435 1436[Release Blog Post](https://gleam.run/news/gleam-v0.17-released/) 1437 1438- Functions now get special handling when being printed from JavaScript. 1439 1440## v0.17.0-rc2 - 2021-09-19 1441 1442- Errors thrown when no case clause or assignment pattern matches the subject 1443 value now include more debugging information when targeting JavaScript. 1444- New projects are generated using `gleam_stdlib` v0.17.1. 1445 1446## v0.17.0-rc1 - 2021-09-11 1447 1448- Redesigned the Gleam prelude to be a module of core classes when compiling to 1449 JavaScript. This improves the resulting generated code and makes debugging and 1450 interop easier. 1451- Projects without rebar3 can be generated using the `gleam-lib` template. 1452- JavaScript modules are imported using a camel case variable name to avoid name 1453 collisions with variables. 1454- Pipelines now use assignments in the generated code in order to preserve the 1455 order of any side effects. 1456- Fixed a bug where the compiler would crash rather than raise an error if a 1457 project contained a single module and attempted to import another. 1458- Special variable naming has been made more consistent in rendered Erlang and 1459 JavaScript. 1460- Conditional compilation can now be used to have different code within a module 1461 when compiling to a specific target. 1462- Fixed a bug where `todo` caused values not to be returned in JavaScript. 1463- Fixed a bug where multiple discarded function arguments generated invalid 1464 JavaScript. 1465- Fixed a bug where using JavaScript reserved words as function argument names 1466 caused generated invalid JavaScript. 1467- Fixed a bug where a case expression of just a catch-all pattern generated 1468 invalid JavaScript. 1469- Fixed a bug where the formatter would incorrectly render extra newlines below 1470 try expressions. 1471- Fixed a bug where tail recursive functions with arguments with the same name 1472 as JavaScript reserved words generated the wrong JavaScript. 1473- Fixed a bug where list equality would be incorrectly reported in JavaScript. 1474- Multiple subjects are now supported for case expressions in JavaScript. 1475- Fixed a bug where matching using a Bool or Nil literal as the subject for a 1476 case expression would produce invalid code when compiling to JavaScript. 1477- Unsupported feature error messages now include file path and line numbers for 1478 debugging. 1479- Bit string literals with no segment options or just the `bit_string`, `utf8` 1480 or `utf8_codepoint` options can be constructed when compiling to JavaScript. 1481- The format of generated JavaScript has been improved. 1482- Fixed a bug where rendered JavaScript incorrectly incremented variables when 1483 reassigned in patterns. 1484- Added `eval` and `arguments` to JavaScript reserved words. 1485- Support for the deprecated `tuple(x, y, ...)` syntax has been removed in favor 1486 of the more concise (`#(x, y, ...)`). Use `gleam format` with the previous 1487 version of the compiler to auto-migrate. 1488- New OTP projects are generated using `gleam_otp` v0.1.6. 1489- Fixed a bug where the equality operators could return the incorrect value for 1490 records when compiling to JavaScript. 1491- Fixed a bug where `todo` could sometimes render invalid JavaScript when used 1492 as an expression in the generated code. 1493- An error is now emitted if the list spread syntax is used with no prepended 1494 elements `[..xs]`. 1495- Fixed a bug where type errors inside piped expressions would be incorrectly be 1496 reported as being an incorrect usage of the pipe operator. 1497- Gleam modules with no public exports no longer render private members in 1498 Erlang. 1499- Fixed a bug where discard variables used in assert assignments would generate 1500 invalid Erlang code. 1501- Fixed a bug where some expressions as case subjects would generate invalid 1502 JavaScript code. 1503- Fixed a bug where some assignments as the final expression in a function would 1504 not return the correct value in JavaScript. 1505- Gleam packages imported in JavaScript now have the path prefix 1506 `gleam-packages`. This can be served from your web server or aliased in your 1507 `package.json` for NodeJS projects. 1508- Fixed a bug where the type checker would fail to generalise some type 1509 variables, causing module metadata writing to fail. 1510- Fixed a bug where tail call optimisation when compiling to JavaScript could 1511 result in incorrect code. 1512- Fixed a bug where variable names could be rendered incorrectly in closures. 1513- An error is now emitted if alternative patterns fail to define all the 1514 variables defined by the first pattern. 1515- New projects are generated using `gleam_stdlib` v0.17.0. 1516- New projects are generated using `gleam_otp` v0.2.0. 1517 1518## v0.16.1 - 2021-06-21 1519 1520- Values which are being imported more than once in an unqualified fashion now 1521 cause an error to be reported. 1522- Argument docs for custom type constructors are now rendered in the HTML 1523 documentation. 1524- Patterns can be used with `try` expressions when compiling to JavaScript. 1525- Types and record constructors can now be aliased with an uppercase name when 1526 imported. Aliasing them with a lowercase name is no longer permitted. 1527- Fixed a bug where nested import paths could be rendered incorrectly in 1528 JavaScript. 1529 1530## v0.16.0 - 2021-06-17 1531 1532[Release Blog Post](https://gleam.run/news/gleam-v0.16-released/) 1533 1534## v0.16.0-rc4 - 2021-06-17 1535 1536- Fixed a bug where if a JavaScript global function was imported as an external 1537 function with the same name the generated code would diverge. 1538 1539## v0.16.0-rc3 - 2021-06-17 1540 1541- New projects are generated using `gleam_stdlib` v0.16.0. 1542 1543## v0.16.0-rc2 - 2021-06-08 1544 1545- Gleam now supports alternative patterns in case expressions for the JavaScript target. 1546- The `gleam` prelude module can now be imported when compiling to JavaScript. 1547- Fixed a bug where the prelude module could not be imported when using the old 1548 build compiler API. 1549- Fixed a bug where if a JavaScript global function was imported as an external 1550 function with the same name the generated code would diverge. 1551- Type error messages coming from pipe usage have been improved. 1552 1553## v0.16.0-rc1 - 2021-06-04 1554 1555- Gleam can now compile to JavaScript! Specify the `--target javascript` flag to 1556 `gleam compile-package` to use it today. 1557- A compile time error is now raised when multiple module level constants with 1558 the same name are defined. 1559- Fixed a bug where declaring a type constructor using reserved erlang keyword 1560 in its fields results in invalid erlang code being generated. 1561- Fixed a bug where calling a function with discarded labelled arguments 1562 incorrectly results in a compile error. 1563- Fixed a bug where assert statements return the wrong value. 1564- The `gleam new` command requires a root folder param, project name is 1565 optional and if not provided the project name will be inferred from 1566 the folder name. 1567- Generated Erlang record header files now contain Erlang type information. 1568- New OTP application projects depend on `gleam_otp` v0.1.5. 1569- The output of the formatter has been improved. 1570 1571## v0.15.1 - 2021-05-07 1572 1573- Fixed a bug where blocks that contained try expressions could be formatted 1574 incorrectly. 1575 1576## v0.15.0 - 2021-05-06 1577 1578[Release Blog Post](https://gleam.run/news/gleam-v0.15-released/) 1579 1580## v0.15.0-rc1 - 2021-05-05 1581 1582- Syntax highlighting of Gleam code in generated HTML documentation has been 1583 improved. 1584- Fixed a bug where markdown tables in rendered HTML documentation would have 1585 the incorrect background colour on every other row. 1586- Tuples now have a new, concise syntax variant: `#(x, y, ...)`. Existing code 1587 can be auto-migrated to the new syntax by running `gleam format`. 1588- Fixed a bug where customt type constructors with Erlang keywords as names 1589 would generate invalid Erlang code. 1590- Gleam now supports `\e` string escapes. 1591- Values and types from the prelude can now be used in a qualified fashion by 1592 importing the `gleam` module. 1593- Empty lists can now be used in constants. 1594- Compiler performance has been improved when working with lists. 1595- Compiler performance has been improved when working with sequences of 1596 expressions. 1597- Assignments using `let` and `assert` are now expressions and no longer require 1598 a following expression in their containing block. They are now themselves 1599 expressions. 1600- Fixed a bug where tuple indexing could incorrectly claim a tuple is not of 1601 type tuple in some circumstances. 1602- Glean `new` command now checks if target folder exists, if so it returns 1603 an error. 1604- A compile time error is now raised if a module is defined with the name `gleam`. 1605- A compile time error is now raised if a module is defined with the a keyword 1606 in the name. 1607- New projects are generated using `gleam_stdlib` v0.15.0. 1608- New projects are generated at v0.1.0. 1609 1610## v0.14.4 - 2021-03-27 1611 1612- The Gleam compiler has been updated to compile with the new Rust v1.51.0. 1613- New project's `gleam.toml` has a comment that shows how to add a 1614 `repository` field. 1615- New projects no longer include a licence field in `src/$APP.app.src` by 1616 default. 1617 1618## v0.14.3 - 2021-03-20 1619 1620- Added an error hint when joining string using the `+` or `+.` operator. 1621- New projects are created with `setup-erlang` v1.1.2 and Erlang/OTP v23.2. 1622- Fixed a bug where the compiler would be unable to locate an imported module 1623 if a value from a nested module is used in a qualified fashion. 1624 1625## v0.14.2 - 2021-03-02 1626 1627- Project names can now contain numbers. 1628 1629## v0.14.1 - 2021-02-27 1630 1631- The error message for binary operators has been given more detail and 1632 hints. 1633- Fixed a bug where alternative patterns would incorrectly report unused 1634 variables. 1635- Fixed a bug where private types shadowed shadowed by values would 1636 incorrectly report unused variables. 1637 1638## v0.14.0 - 2021-02-18 1639 1640[Release Blog Post](https://gleam.run/news/gleam-v0.14-released/) 1641 1642## v0.14.0-rc2 - 2021-02-18 1643 1644- New projects are created with `gleam_stdlib` v0.14.0. 1645 1646## v0.14.0-rc1 - 2021-02-14 1647 1648- Gleam now generates Erlang typespecs. 1649- New projects no longer include a licence file by default. 1650- New projects can be created using the new `escript` template to generate a 1651 command line tool style program. 1652- A warning is emitted when a literal value is constructed but not used. 1653- Automatically generate a link to repository in docs if available. 1654- Code in HTML documentation is has highlighted syntax. 1655- Gleam now only supports `\r`, `\n`, `\t`, `\"`, and `\\` string escapes. 1656- A set of OCI container images are built automatically for each release. 1657- New compile time checks for invalid bit string literals and patterns have 1658 been added. 1659- The error messages for syntax errors in names have been improved. 1660- Fixed a bug where the repo URL would render incorrectly in HTML docs. 1661- Fixed a bug where piping a block can render invalid Erlang. 1662- New compile time warnings on unused types, functions and variables. 1663- The runtime error emitted by the `todo` keyword now carries additional 1664 information. 1665- The runtime error emitted by the `assert` keyword now carries additional 1666 information. 1667- Fixed a bug where bit string patterns would not correctly unify with the 1668 subject being pattern matches on. 1669- Documentation dark mode. 1670- Fixed a bug where some app.src properties were incorrectly named. 1671- `--warnings-as-errors` flag added to `gleam build` command. 1672 1673## v0.13.2 - 2021-01-14 1674 1675- `ring` dep upgraded to enable compilation on Apple M1 ARM processors. 1676 1677## v0.13.1 - 2021-01-13 1678 1679- Fix off-by-one error in message messages. 1680 1681## v0.13.0 - 2021-01-13 1682 1683[Release Blog Post](https://gleam.run/news/gleam-v0.13-released/) 1684 1685- New Gleam projects use stdlib v0.13.0. 1686 1687## v0.13.0-rc2 - 2021-01-12 1688 1689- The `version` property in `gleam.toml` is now optional again. 1690 1691## v0.13.0-rc1 - 2021-01-09 1692 1693- Variable names now only have 1st letter capitalized when converted to erlang. 1694- Records defined in other modules can now be used in module constants. 1695- Documentation can link from functions, types & constants to their source 1696 code definitions on popular project hosting sites. 1697- Documentation hosted on HexDocs now has a version selector. 1698- Fixed a bug where the `app` project template rendered invalid code. 1699- Newly generated projects use stdlib v0.12.0. 1700- Named subexpressions in patterns now render correct Erlang. 1701- The anonymous function syntax now successfully parses with whitespace 1702 between `fn` and `(`. 1703- Fixed a bug where the formatter would incorrectly remove blocks around some 1704 binary operators. 1705- Constants can now be defined after they are used in functions 1706- The parser has been rewritten from scratch, dramatically improving error 1707 messages and compilation times. 1708- `1-1` and `a-1` are now parsed as `1 - 1` and `a - 1` 1709- Further information has been added to the error messages when a function 1710 returns the wrong type. 1711- Further information has been added to the error messages when case clauses 1712 return different types. 1713- Fixed a bug where imported record constructors without labels used as an 1714 anonymous function generates incorrect Erlang. 1715 1716## v0.12.1 - 2020-11-15 1717 1718- The compiler can now discriminate between record access and module access 1719 for shadowed names 1720- The `new` command will no longer permit projects to be made with names that 1721 clash with Erlang standard library modules. 1722- The formatter now correctly treats lines of only whitespace as empty. 1723- The styling of tables in rendered HTML documentation has been improved. 1724- Rendered HTML documentation has regained its max-width styling. 1725 1726## v0.12.0 - 2020-10-31 1727 1728[Release Blog Post](https://gleam.run/news/gleam-v0.12-and-gleam-otp-v0.1-released/) 1729 1730## v0.12.0-rc4 - 2020-10-31 1731 1732- The rendered module documentation sidebar can now scroll independently to 1733 the page. 1734- Application projects now have the correct `mod` value in the generated 1735 `.app.src`. 1736- Records without fields can now be used in module constants. 1737- New application projects are now created used Gleam's type safe OTP pulled 1738 from Hex. 1739 1740## v0.12.0-rc3 - 2020-10-24 1741 1742## v0.12.0-rc2 - 2020-10-24 1743 1744## v0.12.0-rc1 - 2020-10-24 1745 1746- The utf8, utf16, and utf32 type specifiers are now only available in bit 1747 string construction, matching must be done with the codepoint versions. 1748- Functions may now be called before they are defined in a module. This 1749 enabled mutually recursive functions! 1750- Discarded variable names may now include numbers. 1751- Fixed a bug where discarded variables might generate incorrect Erlang. 1752- Added support tuple access in clause guards. 1753- New projects are created with version 1.0.2 of the setup-gleam GitHub 1754 action. 1755- New application projects are now created used Gleam's type safe OTP. 1756- Comments are now correctly handled on platforms that use \r\n line endings, 1757 such as Windows. 1758 1759## v0.11.2 - 2020-09-01 1760 1761- Fixed a bug where an imported constructor would emit an unused constructor 1762 warning when only used in pattern matching. 1763 1764## v0.11.1 - 2020-08-31 1765 1766- The formatter style has been improved to render function type arguments on 1767 a single line when possible, even if the return type will not fit on a 1768 single line. 1769- The format for printed types in error messages has been improved. 1770- Fixed a bug where the formatter would strip a constructor pattern spread 1771 when no fields are given. 1772- Fixed a bug where assigning the result of a block to a variable would 1773 generate incorrect Erlang. 1774- The formatter style has been improved for function calls that take a single 1775 block as an argument. 1776- Reserved words are no longer incorrectly permitted as project names. 1777 1778## v0.11.0 - 2020-08-28 1779 1780[Release Blog Post](https://lpil.uk/blog/gleam-v0.11-released/) 1781 1782## v0.11.0-rc3 - 2020-08-27 1783 1784- Bit strings now support non-literal strings as segment values. 1785- Fixed a bug where Erlang variables could be generated with incorrect names 1786 when defining an anonymous function. 1787 1788## v0.11.0-rc2 - 2020-08-24 1789 1790- The formatter style has been improved to render some single argument calls 1791 in a more compact style. 1792 1793## v0.11.0-rc1 - 2020-08-22 1794 1795- Field access now works before the custom type is defined. 1796- The error message returned by the compiler when the user tries to use unknown 1797 labelled arguments now handles multiple labels at once, and does not suggest 1798 labels they have already supplied. 1799- The formatter style has been improved to use a trailing comma on imports 1800 broken over multiple lines. 1801- The formatter style has been improved to wrap lists and bit strings over as 1802 few lines as possible if the elements are Ints, Floats, or Strings. 1803- The formatter style has been improved to preserve comments on labelled 1804 call arguments. 1805- The formatter style has been improved to preserve empty lines in assignments. 1806- The performance of the formatter has been improved. 1807- Records can be updated using the spread syntax. A warning is emitted if no 1808 fields are updated when using this syntax. 1809- Fixed a bug where type parameters can leak between different type 1810 definitions in a module. 1811- Markdown tables, footnotes, strikethroughs, and tasklists are now supported 1812 in documentation. 1813- Fixed a bug where generic types may be incorrectly unified. 1814- Ints and floats can now be written with underscores for clarity. 1815- The warning for a `todo` now includes the required type of the 1816 not-yet-implemented expression. 1817- Holes can be used in type annotations to specify part of a type, leaving the 1818 rest for inference. 1819- The incorrect arity error now prints any missing labelled arguments. 1820- Fixed a bug where Erlang variables could be generated with incorrect names 1821 when directly calling an anonymous function. 1822- A warning is emitted when a type is imported or created but not used. 1823- Fixed a bug where Erlang variables names could clash when rebinding 1824 variables while similarly named variables ending in a number are in scope. 1825- Fixed a bug in the pretty printer which prevented the formatter from 1826 rendering sub-expressions in a single line when later code would not fit on 1827 the same line. 1828- The formatter style has been improved to render some single argument calls 1829 in a more compact style. 1830- Gleam now supports hex, octal, and binary literals. 1831- Rebar3 hex packages now include `gleam.toml` and `gen`. 1832- Newly generated projects use stdlib v0.11.0. 1833 1834## v0.10.1 - 2020-07-15 1835 1836- Fixed a bug where the compiler failed to return an error when type checking 1837 a tuple with the wrong arity in a pattern. 1838- The error message for a duplicate module member now shows the location of 1839 both definitions. 1840- Fix compiler bug where labelled arguments were being reordered incorrectly. 1841 1842## v0.10.0 - 2020-07-01 1843 1844[Release Blog Post](https://lpil.uk/blog/gleam-v0.10-released/) 1845 1846- Newly generated projects use stdlib v0.10.1. 1847- Fixed a bug where discards inside bit string patterns generated invalid 1848 code. 1849 1850## v0.10.0-rc2 - 2020-06-30 1851 1852- Fixed a bug where variables names would be incorrectly generated when using 1853 alternative patterns. 1854 1855## v0.10.0-rc1 - 2020-06-29 1856 1857- Single letter module names are now permitted. 1858- Added support for bit string syntax. 1859- Support for the deprecated list prepend syntax has been removed. 1860- Added module level constants that are inlined at compile time. 1861- Public module level constants generate documentation. 1862- The formatter style has been improved to wrap and sort imports. 1863- The formatter now permits comments at the end of module function bodies. 1864- The formatter now skips files that match patterns defined in ignore files 1865 such as .gitignore and .ignore. 1866- Error message diagnostic code previews for type errors when using the the 1867 pipe operator have been made more accurate. 1868- Added support for list literals in clause guards. 1869- Fixed bug when reassigning a variable inside a case clause with alternative 1870 patterns. 1871- Todos can now take an optional label. 1872 1873## v0.9.1 - 2020-06-12 1874 1875- Fixed a bug where binary operators may lose required `{ }`s when formatted. 1876 1877## v0.9.0 - 2020-06-01 1878 1879[Release Blog Post](https://lpil.uk/blog/gleam-v0.9-released/) 1880 1881- Newly generated projects use stdlib v0.9.0. 1882- Additional information is printed to the console when generating HTML 1883 documentation from Gleam code. 1884- Fixed a bug where blocks on either side of a binary operator would be 1885 rendered without `{ }`. 1886 1887## v0.9.0-rc1 - 2020-05-26 1888 1889- The formatter style has been improved. 1890- Numbers are now permitted in module names. 1891- Emitted Erlang code correctly adds parentheses around binary subexpressions 1892 to preserve precedence. 1893- Record names and fields are now escaped in `.hrl` files if they conflict 1894 with Erlang reserved words 1895- Annotations are now supported on `let` and `assert` expressions 1896- Formatter now accepts comments for the fields of a custom type's constructors 1897- Added opaque custom types, which have constructors that cannot be accessed 1898 from outside their own modules. 1899- Additional (arbitrary) markdown documentation pages can now be added and 1900 built with `docs build`. 1901- Fix code generation when calling functions returned through either record 1902 or tuple access 1903- Add lookup for Gleam source code in Mix's `deps` directory. 1904- Newly generated Gleam projects use the GitHub action 1905 `gleam-lang/setup-erlang` v1.1.0. 1906- Added support for custom type record literals in guards. 1907- Type variables are now correctly preserved within nested scopes. 1908 1909## v0.8.1 - 2020-05-19 1910 1911- The formatter now correctly handles unicode comments. 1912 1913## v0.8.0 - 2020-05-07 1914 1915[Release Blog Post](https://lpil.uk/blog/gleam-v0.8-released/) 1916 1917- The `docs build`, `docs publish`, and `docs remove` commands can be used to 1918 compile HTML documentation locally, publish them to HexDocs, and remove them 1919 from HexDocs respectively. 1920- Type error reporting has been improved when using the pipe operator. 1921- Newly generated projects use stdlib v0.8.0. 1922- The compiler can now emit warnings. Currently there are warnings for using 1923 the old '|' syntax in lists and for todos. 1924- Will give a clearer error when a function given as an argument to another 1925 function doesn't match the type of the parameter. 1926- Fixed bug where imported type constructors had the incorrect arity. 1927- Fixed bug where a doing an unqualified import of a type constructor and 1928 giving it an alias would use the wrong name if it contained any values. 1929- Fixed a bug trying to access an imported constructor which contained values. 1930- Fixed a compiler crash that occurred when trying to unify a tuple with something 1931 other than another tuple or a variable. 1932- Added support for tuple literals in guards. 1933 1934## v0.8.0-rc1 - 2020-04-28 1935 1936- Strings are now encoded as utf8 binaries in the generated Erlang. 1937- HTML documentation can now be generated from Gleam code by running `gleam build --doc`. 1938- Gleam code can be formatted using the `gleam format` command. 1939- The pipe operator `|>` will now attempt to insert the left hand side as the 1940 first argument to the right hand side if the right hand side is a call, 1941 removing the need for function capture boilerplate. 1942- A `record.label` syntax can now be used to access the fields of a custom 1943 type that have a single record variant. 1944- Anonymous functions can now have return type annotations. 1945- There is a `todo` keyword for type checking functions that have not yet been 1946 implemented. 1947- Tuples can be indexed into using the `var.1` syntax. 1948- `>`, `>=`, `<`, and `<=` operators are now supported in case clause guards 1949 and can be used to check the ordering of integers. 1950- `>.`, `>=.`, `<.`, and `<=.` operators are now supported in case clause 1951 guards and can be used to check the ordering of floats. 1952- The list prepend syntax is now `[x, ..y]`. The old `[x | y]` syntax is 1953 deprecated but will continue to work for now. The formatter will rewrite the 1954 old syntax to the new. 1955- Add new assert syntax for binding variables `assert Ok(x) = result`. In the 1956 future this will allow you to use a pattern that does not match all values. 1957- Added support for int and float literals in guards. 1958- Color codes are now only emitted in error output for interactive terminal 1959 sessions. 1960- Added a new `..` syntax for discarding the remaining fields of a record. 1961- Using the same variable name multiple times in the same pattern will now 1962 raise an error. 1963- Discard can now be omitted in list tails in patterns, ie `[x, ..]` is the 1964 same as `[x, .._]`. The former is the preferred version and is emitted by the 1965 formatter. 1966 1967## v0.7.1 - 2020-03-03 1968 1969- Projects generated with `gleam new` use `stdlib` version 0.7.0. 1970 1971## v0.7.0 - 2020-03-01 1972 1973[Release Blog Post](https://lpil.uk/blog/gleam-v0.7-released/) 1974 1975## v0.7.0-rc1 - 2020-02-28 1976 1977- Type aliases can be defined to give concise names to frequently used types. 1978- Case expression clauses may have guards which can be used to require 1979 equality between specified variables in order for the clause to match. 1980- Case expression clauses may have alternative patterns, enabling one clause 1981 to match for multiple different possible patterns. 1982- Types may now be used before they are defined within their defining module. 1983- Fixed a bug where import paths would not be correctly resolved on Windows. 1984- Added job to create precompiled binary for 64-bit Windows when releasing. 1985- `gleam new` now creates a project that uses `actions/checkout@v2.0.0` in its 1986 GitHub actions workflow. 1987- Labelled argument in functions may now be discarded by prefixing the name 1988 with an underscore, like unlabelled arguments. 1989- Sub-patterns can have names assigned to them within a pattern using the `as` 1990 keyword. 1991- The format of compiler error messages printed to the console has been 1992 improved by upgrading to a newer version of the codespan-reporting library. 1993- Type variables in the given and expected types will now be printed with the 1994 same name in type error messages if they are equivalent. 1995- A friendly error message is rendered when a case expression clause has the 1996 incorrect number of patterns for the subjects. 1997- A friendly error message is rendered when a .gleam file cannot be read. 1998- A friendly error message is rendered when the `gleam new` command fails to 1999 write the new project to the file system. 2000- A friendly error message is rendered when there is a cycle formed by module 2001 imports. 2002- Top level types are now printed in error messages for type parameter mismatches. 2003- The `gen` directory is now deleted before each compilation. 2004- `gleam new` now includes installation instructions for Hex packages in the 2005 generated README. 2006- `gleam new` now accepts a `--description` flag for including a description of 2007 the project in the README and `.app.src` file. 2008- Fixed a bug where variable names would be incorrectly generated in some 2009 situations when variable names are reused during and after a case 2010 expression. 2011- Performance of the Erlang code generator has been improved by removing some 2012 vector allocations. 2013- An error is emitted when multiple types with the same name are defined in or 2014 imported into a module. 2015 2016## v0.6.0 - 2019-12-25 🎄 2017 2018[Release Blog Post](https://lpil.uk/blog/gleam-v0.6-released/) 2019 2020- Function capture syntax now supports labelled arguments. 2021 2022## v0.6.0-rc1 - 2019-12-23 2023 2024- Syntax for defining structs and enums have been unified into a singular 2025 custom type definition statement. Instances of these custom types are called 2026 records. 2027- Anonymous structs have been renamed tuples. 2028- Values and types can be given a new name when imported in the unqualified 2029 fashion using the `import mod.{value as name}` syntax. 2030- An error will be emitted if multiple values constructors are defined with 2031 the same name in a module. 2032 2033## v0.5.1 - 2019-12-23 2034 2035- Fixed a bug where invalid Erlang would be generated when using a local 2036 private function as a value. 2037 2038## v0.5.0 - 2019-12-16 2039 2040[Release Blog Post](https://lpil.uk/blog/gleam-v0.5-released/) 2041 2042- Enum constructor arguments can now be labelled, allowing arguments to be 2043 given by name at the call site. 2044- An Erlang header file with a record definition is generated for each Gleam 2045 struct defined. 2046- `gleam new` creates a project at v1.0.0. 2047- Function calls are now properly escaped when the function name conflicts 2048 with an Erlang keyword. 2049- References to unqualified imported functions now generate correct Erlang 2050 code. 2051- Fixed a bug where variable rebinding would generate incorrect code in some 2052 case expressions. 2053- Fixed a bug where variable rebinding of function arguments would generate 2054 incorrect code. 2055 2056## v0.5.0-rc1 - 2019-11-26 2057 2058- Function arguments can be labelled, allowing arguments to be given by name 2059 at the call site. 2060- `case` expressions now accept multiple subjects, enabling pattern matching 2061 on multiple values simultaneously. 2062- Values and types can be imported from modules and references in an 2063 unqualified fashion. 2064- Named structs now have their name as the first element in the generated 2065 Erlang code. This enabled easier use from Erlang by defining records for 2066 them, as well as slightly clearer printf debugging. 2067- Anonymous structs have been introduced, serving as a quick and generic 2068 alternative to declared structs and as a format for interop with Erlang 2069 tuples. 2070- `gleam new` now accepts a `--template` flag to generate different styles of 2071 project. An OTP application template has been added alongside the existing 2072 OTP library template. 2073- `gleam new` now creates configuration for GitHub Actions, making Gleam 2074 projects ready for continuous integration out of the box. 2075- The syntax for defining enums, case expressions, and blocks has been changed 2076 to a syntax closer to that found in the C family of languages. 2077- The source code preview for functions that return a type incompatible with 2078 the functions annotations has been improved to be more precise. 2079- A helpful error message is rendered if an enum field contains a generic type 2080 that has not been declared. 2081- A bug has been fixed in which type mismatch errors originating from pattern 2082 matching would sometimes display the incorrect expected type. 2083 2084## v0.4.2 - 2019-10-22 2085 2086- Fixed a crash when an incorrect number of labelled struct arguments are 2087 given. 2088- Fixed a struct labelled argument being incorrect reported as already given. 2089 2090## v0.4.1 - 2019-09-29 2091 2092- Struct types with parameterised fields are now registered with the correct 2093 number of type parameters. 2094 2095## v0.4.0 - 2019-09-19 2096 2097[Release Blog Post](https://lpil.uk/blog/gleam-v0.4-released/) 2098 2099- The struct data type has be introduced. Structs are pre-declared user 2100 defined data types with named fields and constant access time. 2101- The map and tuple data types has been removed, replaced by the struct data 2102 type. 2103- The generated code no longer contains export statements if no functions are 2104 exported from a module. 2105- Comparison operators have been specialised to operate only on Ints. 2106- The `>.` `>=.` `<.` and `<=.` comparison operators have been added for 2107 comparing Floats. 2108- It is now an error to export an enum which has a constructor that takes a 2109 private type as an argument. 2110- The error messages for defining multiple modules with the same name and for 2111 importing test modules into application code have been improved. 2112- Numbers are now permitted in type names and constructors. 2113- The `Nil` constructor will no longer erroneously be of type `Int`. 2114 2115## v0.3.0 - 2019-08-08 2116 2117[Release Blog Post](https://lpil.uk/blog/gleam-v0.3-released/) 2118 2119- New project structure can be generated with the `gleam new` command. 2120- Functions can be annotated with their argument and return types. This may be 2121 used to restrict the function to a less general type than inferred by the 2122 compiler, or purely for documentation purposes. 2123- External function names and their target functions are now escaped in the 2124 generated code if they collide with Erlang keywords such as `catch` or `or`. 2125- Type error arising from the arguments of function calls have more accurate 2126 error diagnostics. 2127- Precompiled Gleam binaries are now available on the GitHub release page. 2128- Precompiled Docker images containing the Gleam binary are now available on 2129 DockerHub. 2130- The formatting of the Erlang code rendered by the compiler has been altered 2131 to improve legibility. 2132- A helpful error message is now rendered if the shorthand anonymous function 2133 syntax is used with too many underscores. 2134- A helpful error message is now rendered when attempting to import an unknown 2135 module. 2136 2137## v0.2.0 - 2019-06-25 2138 2139- Modules can now live within namespaces such as `my_app/user/profile`. 2140- The name of the variable created can be specified when importing a module 2141 using the `import my_mod as name` syntax. 2142- Function names and atoms are now escaped in the generated code if they 2143 collide with Erlang keywords such as `catch` or `or`. 2144- There is a shorthand syntax for prepending multiple elements to a list. 2145 `[1, 2, 3 | my_list]` 2146 2147## v0.1.2 - 2019-05-12 2148 2149- Types containing more than 26 type variables will no longer render with 2150 invalid type variable names. 2151- Types in error messages no longer have extra indentation that increases as 2152 the type gets larger. 2153- There is a new type `Nil` which is occupied by a single value (`Nil`). This 2154 type is used to represent the absence of a value and is commonly used with 2155 `Result` to model a value that is either present (`Ok(value)`) or absent 2156 (`Error(Nil)`). 2157- Zero arity enum constructors now generate the correct Erlang when used in 2158 modules other than the one they are defined in. 2159 2160## v0.1.1 - 2019-04-28 2161 2162- Error messages now display the path of the file containing the problem. 2163- Maps and modules with erroneous extra fields now have a custom error 2164 message. 2165- Rows with tails that are unbound type variables are now correctly unified in 2166 the type system. This fixes a bug in which maps and modules may sometimes 2167 fail to type check when there is no error. 2168 2169## v0.1.0 - 2019-04-15 2170 2171[Release Blog Post](https://lpil.uk/blog/hello-gleam/) 2172 2173- Initial release!