From e6b80fde557f022f0d70899715bc585960eb88e8 Mon Sep 17 00:00:00 2001
From: ascandone
00bpa - @@ -36,23 +31,26 @@ Thank you to our sponsors! Gleam would not be possible without you. Adam Johnston - Adi Iyengar - Adi Salimgereyev - - Aiden Fox Ivey - + Adrian Mouat - Ajit Krishna - Alembic - + Alex Houseago - Alex Manning - + Alex Viscreanu - Alexander Koutmos - Alexander Stensrud - Alexandre Del Vecchio - - Alyx - Ameen Radwan - AndreHogberg - + andrew - + András B Nagy - Andy Aylward - Anthony Khong - Anthony Maxwell - Anthony Scotti - Arnaud Berthomier - Arthur Weagel - - Austin Daily - + Austin Daily - Barry Moore - Bartek Górny - Ben Martin - @@ -67,12 +65,12 @@ Thank you to our sponsors! Gleam would not be possible without you. Brian Glusman - Bruno Michel - bucsi - + Carlo Gilmar - Carlo Munguia - Carlos Saltos - Chad Selph - Charlie Govea - Chaz Watkins - - Chetan Bhasin - Chew Choon Keat - Chris Donnelly - Chris King - @@ -88,8 +86,7 @@ Thank you to our sponsors! Gleam would not be possible without you. Cole Lawrence - Colin - Comamoca - - Constantine Manakov - - Cristine Guadelupe - + Daigo Shitara - Damir Vandic - Dan Dresselhaus - Daniel - @@ -106,6 +103,7 @@ Thank you to our sponsors! Gleam would not be possible without you. Dima Utkin - Dmitry Poroh - ds2600 - + ducdetronquito - Edon Gashi - Eileen Noonan - eli - @@ -116,20 +114,23 @@ Thank you to our sponsors! Gleam would not be possible without you. erikareads - ErikML - Ernesto Malave - - F. A. Sánchez - + Evaldo Bratti - + Evan Johnson - Felix Mayer - Fernando Farias - Filip Figiel - Fionn Langhans - Florian Kraft - - fly.io - + G-J van Rooyen - Georg H. Ekeberg - Giacomo Cavalieri - Graeme Coupar - grotto - Guilherme de Maio - + Guillaume Hivert - Hammad Javed - Hampus Kraft - + Hannes Nevalainen - Hannes Schnaitter - Hayes Hundman - Hayleigh Thompson - @@ -140,8 +141,10 @@ Thank you to our sponsors! Gleam would not be possible without you. Hex - human154 - Humberto Piaia - + Iain H - Ian González - Ian M. Jones - + Igor Goryachev - Igor Montagner - Igor Rumiha - inoas - @@ -160,17 +163,19 @@ Thank you to our sponsors! Gleam would not be possible without you. Jeremy Jacob - jiangplus - Jimpjorps™ - - Jiri Luzny - Joey Kilpatrick - Johan Strand - John Björk - John Gallagher - John Pavlick - + John Thile - Jonas Hedman Engström - + Jorge Martí Marín - Josef Richter - Joshua Steele - + Julian Lukwata - Julian Schurhammer - - Justin Rassier - + Justin Lubin - Kero van Gelder - Kevin Schweikert - Kieran Gill - @@ -183,11 +188,13 @@ Thank you to our sponsors! Gleam would not be possible without you. Leonardo Donelli - lidashuang - LighghtEeloo - + Lily Rose - Loïc Tosser - Lucas Pellegrinelli - Lucian Petic - Luna - Manuel Rubio - + Maor Kadosh - Marcus André - Marcøs - Mariano Uvalle - @@ -195,8 +202,10 @@ Thank you to our sponsors! Gleam would not be possible without you. Mark Holmes - Mark Markaryan - Mark Spink - + Markéta Lisová - Martin Janiczek - Martin Rechsteiner - + martonkaufmann - Matt Champagne - Matt Savoia - Matt Van Horn - @@ -207,11 +216,15 @@ Thank you to our sponsors! Gleam would not be possible without you. Michael Jones - Michael Kieran O'Reilly - Michael Kumm - + Michael Mazurczak - + Michał Hodur - Mike - + Mike Nyola - Mike Roach - Mikey J - MoeDev - MzRyuKa - + Måns Östman - n8n - Workflow Automation - Natanael Sirqueira - Nathaniel Knight - @@ -219,11 +232,13 @@ Thank you to our sponsors! Gleam would not be possible without you. Nick Chapman - Nick Reynolds - Nicklas Sindlev Andersen - + Ninaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - NineFX - Nomio - - Ocean Armstrong Lewis - + Ocean - OldhamMade - optizio - + Osman Cea - Patrick Wheeler - Patrik Kühl - Paul Gideon Dann - @@ -231,12 +246,14 @@ Thank you to our sponsors! Gleam would not be possible without you. Pawel Biernacki - Pete Jodo - Peter Rice - + Petri-Johan Last - Philip Giuliani - + Pierrot - Piotr Szlachciak - + Praveen Perera - qingliangcn - Race Williams - Rahul Butani - - Ratio PBC - Raúl Chouza - Redmar Kerkhoff - Reilly Tucker Siemens - @@ -244,18 +261,19 @@ Thank you to our sponsors! Gleam would not be possible without you. Richard Viney - Rico Leuthold - Ripta Pasay - + Rob - Robert Attard - Robert Ellen - Robert Malko - + Rodrigo Heinzen de Moraes - Ross Bratton - - Ross Cousens - Ruslan Ustitc - - Ryan Moore - Sam Aaron - - Sami Fouad - + sambit - Sammy Isseyegh - Samu Kumpulainen - Santi Lertsumran - + Savva - Saša Jurić - Scott Trinh - Scott Wey - @@ -267,8 +285,8 @@ Thank you to our sponsors! Gleam would not be possible without you. Shuqian Hon - Simone Vittori - Stephen Belanger - + Strandinator - syhner - - Szymon Wygnański - Sławomir Ehlert - Theo Harris - Thomas - @@ -293,6 +311,7 @@ Thank you to our sponsors! Gleam would not be possible without you. xhh - Yamen Sader - Yasuo Higano - + Zhomart Mukhamejanov - Zsombor Gasparin - ~1847917
\ No newline at end of file diff --git a/changelog/v1.3.md b/changelog/v1.3.md new file mode 100644 index 00000000000..e26d2feec91 --- /dev/null +++ b/changelog/v1.3.md @@ -0,0 +1,238 @@ +# Changelog + +## v1.3.0 - 2024-07-09 + +## v1.3.0-rc3 - 2024-07-08 + +- Fixed a bug where not all pure function calls in constant definitions would be + annotated as `@__PURE__` when compiling to JavaScript. + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) + +## v1.3.0-rc2 - 2024-07-06 + +### Formatter + +- Fixed a bug when multiple subjects in a case would be split even if not + necessary. + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) + +## v1.3.0-rc1 - 2024-06-30 + +### Build tool + +- `gleam remove` will now present an error if a package being removed does not + exist as a dependency in the project. + ([Changfeng Lou](https://github.com/hnlcf)) + +- `gleam add` now takes an optional package version specifier, + separated by a `@`, that resolves as follows: + + ```shell + gleam add lustre@1.2.3 # "1.2.3" + gleam add lustre@1.2 # ">= 1.2.0 and < 2.0.0" + gleam add lustre@1 # ">= 1.0.0 and < 2.0.0" + ``` + + ([Rahul D. Ghosal](https://github.com/rdghosal)) + +### Compiler + +- Added more an informative error message for when attempting to use the `..` + syntax to append to a list rather than prepend. + + ``` + error: Syntax error + ┌─ /src/parse/error.gleam:4:14 + │ + 4 │ [..rest, last] -> 1 + │ ^^^^^^ I wasn't expecting elements after this + + Lists are immutable and singly-linked, so to match on the end + of a list would require the whole list to be traversed. This + would be slow, so there is no built-in syntax for it. Pattern + match on the start of the list instead. + ``` + + ([Antonio Iaccarino](https://github.com/eingin)) + +- The compiler now emits a warning for redundant function captures in a + pipeline: + + ``` + warning: Redundant function capture + ┌─ /src/warning/wrn.gleam:5:17 + │ + 5 │ 1 |> wibble(_, 2) |> wibble(2) + │ ^ You can safely remove this + + This function capture is redundant since the value is already piped as the + first argument of this call. + + See: https://tour.gleam.run/functions/pipelines/ + ``` + + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) + +- The syntax `[a..b]` is now deprecated in favour of the `[a, ..b]` syntax. + This was to avoid it being mistaken for a range syntax, which Gleam does + not have. + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) + +- Functions etc named `maybe` are now escaped in generated Erlang as it is now a + reserved word in Erlang/OTP 27. + ([Jake Barszcz](https://github.com/barszcz)) + +- Functions, types and constructors named `maybe` and `else` are now + escaped in generated Erlang to avoid clashing with Erlang's keywords. + ([Jake Barszcz](https://github.com/barszcz)) and + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) + +- Non byte aligned arrays that use literals for size are now marked as an + Unsupported feature for Javascript since they would already cause + a runtime error on Javascript. + + This means if you compile specifically for Javascript you will now recieve + this error: + + ``` + error: Unsupported feature for compilation target + ┌─ /src/test/gleam_test.gleam:6:5 + │ + 6 │ <<1:size(5)>> + │ ^^^^^^^^^ + + Non byte aligned array is not supported for JavaScript compilation. + ``` + + Else any functions which rely on this will not be compiled into Javascript. + ([Pi-Cla](https://github.com/Pi-Cla)) + +- Compilation fault tolerance is now at a statement level instead of a function + level. This means that the compiler will attempt to infer the rest of the + statements in a function when there is an error in a previous one. + ([Ameen Radwan](https://github.com/Acepie)) + +- The JavaScript prelude is no-longer rewritten each time a project is compiled + to JavaScript. + ([Ofek Doitch](https://github.com/ofekd)) + +- Compiler now supports arithmetic operations in guards. + ([Danielle Maywood](https://github.com/DanielleMaywood)) + +- Import cycles now show the location where the import occur. + ([Ameen Radwan](https://github.com/Acepie)) + +- Error messages resulting from unexpected tokens now include information on + the found token's type. This updated message explains how the lexer handled + the token, so as to guide the user towards providing correct syntax. + + Following is an example, where the error message indicates that the name of + the provided field conflicts with a keyword: + + ``` + 3 │ A(type: String) + │ ^^^^ I was not expecting this + + Found the keyword `type`, expected one of: + - `)` + - a constructor argument name + ``` + + ([Rahul D. Ghosal](https://github.com/rdghosal)) + +- When compiling to JavaScript constants will now be annotated as `@__PURE__`. + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) + +### Formatter + +### Language Server + +- The language server will now suggest the "Remove redundant tuple" action even + if the case expression contains some catch all patterns: + + ``` + case #(a, b) { + #(1, 2) -> todo + _ -> todo + } + ``` + + Becomes: + + ``` + case a, b { + 1, 2 -> todo + _, _ -> todo + } + ``` + + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) + +- LSP can now suggest completions for values and types from importable modules + and adds the import to the top of the file. + ([Ameen Radwan](https://github.com/Acepie)) + +- Diagnostics with extra labels now show the diagnostic in all locations + including across multiple files. + ([Ameen Radwan](https://github.com/Acepie)) + +- LSP completions now use the "text_edit" language server API resulting in + better/more accurate insertions. + ([Ameen Radwan](https://github.com/Acepie)) + +- Completions are no longer provided inside comments. + ([Nicky Lim](https://github.com/nicklimmm)) + +- The language server will now show all the ignored fields when hovering over + `..` in a record pattern. + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) + +### Bug Fixes + +- Fixed a bug where the compiler would output a confusing error message when + trying to use the spread syntax to append to a list. + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) + +- Fixed a bug where the formatter would strip empty lines out of the body of an + anonymous function passed as an argument. + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) + +- Fixed a bug where the compiler would crash when a type was defined with + the same name as an imported type. + ([Gears](https://github.com/gearsdatapacks)) + +- Fixed a bug where a horizontal scrollbar would appear on code blocks in built + documentation when they contained lines 79 or 80 characters long. + ([Richard Viney](https://github.com/richard-viney)) + +- Fixed a bug where importing a record constructor in an unqualified fashion and + aliasing it and then using it in a constant expression would generate invalid + JavaScript. + ([Louis Pilfold](https://github.com/lpil)) + +- Fixed a bug where the compiler would crash because types weren't registered if + they referenced a non-existent type. + ([Gears](https://github.com/gearsdatapacks)) + +- Fixed a bug where the compiler would generate invalid Erlang when pattern + matching on strings with an `as` pattern. + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) + +- Fixed a bug where the compiler would warn that a module alias was unused when + it was only used in case patterns. + ([Michael Jones](https://github.com/michaeljones)) + +## v1.2.1 - 2024-05-30 + +### Bug Fixes + +- Fixed a bug where the compiler could fail to detect modules that would clash + with Erlang modules. + ([Louis Pilfold](https://github.com/lpil)) + +- Fixed a bug where dependency version resolution could crash for certain + release candidate versions. + ([Marshall Bowers](https://github.com/maxdeviant)) + +- Fixed a bug where trailing comments would be moved out of a bit array. + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) diff --git a/compiler-cli/Cargo.toml b/compiler-cli/Cargo.toml index c4741bec3fe..aeba0f65227 100644 --- a/compiler-cli/Cargo.toml +++ b/compiler-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "gleam" -version = "1.2.1" +version = "1.4.0-rc1" authors = ["Louis Pilfold