diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index 25dcf326824..76655626ffd 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -54,11 +54,12 @@ jobs:
target: aarch64-unknown-linux-musl
use-cross: true
run-integration-tests: false # Cannot run aarch64 binaries on x86_64
- - os: macos-12 # intel
+ # macos>=14 runs exclusively on aarch64 and will thus fail to execute properly for x64
+ - os: macos-13 # intel
target: x86_64-apple-darwin
use-cross: false
run-integration-tests: true
- - os: macos-14 # aarch64
+ - os: macos-latest # aarch64
toolchain: stable
target: aarch64-apple-darwin
use-cross: false
@@ -194,6 +195,13 @@ jobs:
cd lib_project
gleam run
gleam test
+
+ # Test adding of deps
+ gleam add exception # No specifier
+ gleam add gleam_http@3 # Version specifier
+ gleam test
+
+ # Test documentation generation
gleam docs build
# Assert that module metadata has been written
@@ -265,14 +273,20 @@ jobs:
- run: cargo fmt --all -- --check
- validate-deps:
- name: validate-deps
+ validate:
+ name: validate
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@v4
+ - name: Ensure no merge commits
+ uses: NexusPHP/no-merge-commits@v2.1.0
+ if: github.event_name == 'pull_request'
+ with:
+ token: ${{ secrets.GITHUB_TOKEN }}
+
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
@@ -333,7 +347,7 @@ jobs:
deno-version: v1.x
- name: Install Bun
- uses: oven-sh/setup-bun@v1
+ uses: oven-sh/setup-bun@v2
- name: Install Erlang
uses: erlef/setup-beam@v1
diff --git a/.github/workflows/release-containers.yaml b/.github/workflows/release-containers.yaml
index 2b3b7e6b599..1b3d5f8da83 100644
--- a/.github/workflows/release-containers.yaml
+++ b/.github/workflows/release-containers.yaml
@@ -77,7 +77,7 @@ jobs:
mv gleam gleam-arm64
- name: Build and push
- uses: docker/build-push-action@v5
+ uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
diff --git a/.github/workflows/release-nightly.yaml b/.github/workflows/release-nightly.yaml
index 5251c486908..e291f11a113 100644
--- a/.github/workflows/release-nightly.yaml
+++ b/.github/workflows/release-nightly.yaml
@@ -66,10 +66,11 @@ jobs:
- os: ubuntu-latest
target: aarch64-unknown-linux-musl
use-cross: true
- - os: macos-latest
+ # macos>=14 runs exclusively on aarch64 and will thus fail to execute properly for x64
+ - os: macos-13
target: x86_64-apple-darwin
use-cross: false
- - os: macos-11
+ - os: macos-latest
target: aarch64-apple-darwin
use-cross: false
- os: windows-latest
@@ -212,7 +213,7 @@ jobs:
uses: docker/setup-buildx-action@v3
- name: Build and push
- uses: docker/build-push-action@v5
+ uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index 00b41830c3b..d19d0db2c1e 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -28,10 +28,11 @@ jobs:
- os: ubuntu-latest
target: aarch64-unknown-linux-musl
use-cross: true
- - os: macos-latest
+ # macos>=14 runs exclusively on aarch64 and will thus fail to execute properly for x64
+ - os: macos-13
target: x86_64-apple-darwin
use-cross: false
- - os: macos-11
+ - os: macos-latest
target: aarch64-apple-darwin
use-cross: false
- os: windows-latest
diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile
deleted file mode 100644
index f8e49f26747..00000000000
--- a/.gitpod.Dockerfile
+++ /dev/null
@@ -1,7 +0,0 @@
-FROM gitpod/workspace-full
-
-# Install custom tools, runtimes, etc.
-# For example "bastet", a command-line tetris clone:
-# RUN brew install bastet
-#
-# More information: https://www.gitpod.io/docs/config-docker/
diff --git a/.gitpod.yml b/.gitpod.yml
deleted file mode 100644
index e6e608af3c2..00000000000
--- a/.gitpod.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-image:
- file: .gitpod.Dockerfile
-
-# See: https://www.gitpod.io/docs/config-start-tasks/
-tasks:
- - init: cargo build && make
- command: cargo watch -x run
-
-# See: https://www.gitpod.io/docs/prebuilds/#configure-the-github-app
-github:
- prebuilds:
- master: false
- pullRequests: false
- pullRequestsFromForks: false
- addCheck: false
diff --git a/CHANGELOG.md b/CHANGELOG.md
index cfc2edcae18..f9468f50832 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,174 +1,349 @@
# Changelog
-## v1.3.0 - Unreleased
+## v1.4.0-rc2 - Unreleased
+
+### Bug Fixes
+
+- Fixed a bug where pipe function arity errors could have an incorrect error
+ message.
+ ([sobolevn](https://github.com/sobolevn))
+
+- Fixed a bug where the case of type parameters would not be checked.
+ ([Surya Rose](https://github.com/gearsdatapacks))
+
+## v1.4.0-rc1 - 2024-07-29
### 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 docs build` now takes an optional `--target` flag to specify the target
+ platform for the generated documentation.
+ ([Jiangda Wang](https://github.com/frank-iii))
+
+- Warnings are now emitted each time the project is built, even if the module
+ the warnings originated from were loaded from the cache rather than
+ recompiling.
+ ([Louis Pilfold](https://github.com/lpil))
### Compiler
-- Added more an informative error message for when attempting to use the `..`
- syntax to append to a list rather than prepend.
+- Labelled arguments can now use the label shorthand syntax.
+ This means that when you're passing a variable as a labelled argument and it
+ happens to have the same name as the label, you can omit the variable name:
- ```
- error: Syntax error
- ┌─ /src/parse/error.gleam:4:14
- │
- 4 │ [..rest, last] -> 1
- │ ^^^^^^ I wasn't expecting elements after this
+ ```gleam
+ pub fn date(day day: Int, month month: Month, year year: Year) -> Date {
+ todo
+ }
- I was expecting the end of the list.
- A spread can only be used to match on the entire end of a list.
- It is not possible to extract items from the end of a list using pattern
- matching because that would require walking through the entire list.
+ pub fn main() {
+ let day = 11
+ let month = October
+ let year = 1998
- 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.
+ date(year:, month:, day:)
+ // This is the same as writing
+ // date(year: year, month: month, day: day)
+ }
```
- ([Antonio Iaccarino])[https://github.com/eingin]
+ ([Giacomo Cavalieri](https://github.com/giacomocavalieri))
-- The compiler now emits a warning for redundant function captures in a
- pipeline:
+- Labelled pattern variables can now use the label shorthand syntax.
+ This means that when you're pattern matching on a record constructor and
+ binding its labelled fields to variables that happen to have the same name,
+ you can omit the variable name:
- ```
- warning: Redundant function capture
- ┌─ /src/warning/wrn.gleam:5:17
- │
- 5 │ 1 |> wibble(_, 2) |> wibble(2)
- │ ^ You can safely remove this
+ ```gleam
+ pub type Date
+ Date(day: Int, month: Month, year: Year)
+ }
- This function capture is redundant since the value is already piped as the
- first argument of this call.
+ pub fn main() {
+ case Date(11, October, 1998) {
+ Date(year:, month:, day:) -> todo
+ // This is the same as writing
+ // Date(year: year, month: month, day: day) -> todo
+ }
- 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.
+- The warning for the deprecated `[..]` pattern has been improved.
([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))
+- Record accessors are now fault tolerant. This means an invalid label can be
+ properly detected and won't invalidate the rest of the expression.
+ ([Ameen Radwan](https://github.com/Acepie))
-- 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))
+- Erlang type spec generation has been improved to avoid new warnings emitted in
+ OTP27.
+ ([Damir Vandic](https://github.com/dvic))
-- 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.
+- Error messages for invalid record constructors now contain a restructured
+ example of what the user likely intended. This is especially helpful for
+ users coming from other languages, like Rust or Go.
- This means if you compile specifically for Javascript you will now recieve
- this error:
+ For example, provided a User type:
+ ```gleam
+ pub type User {
+ name: String
+ }
```
- error: Unsupported feature for compilation target
- ┌─ /src/test/gleam_test.gleam:6:5
+
+ The compiler errors with the following message:
+
+ ```
+ error: Syntax error
+ ┌─ /src/parse/error.gleam:3:5
│
- 6 │ <<1:size(5)>>
- │ ^^^^^^^^^
+ 3 │ name: String,
+ │ ^^^^ I was not expecting this
- Non byte aligned array is not supported for JavaScript compilation.
+ Each custom type variant must have a constructor:
+
+ pub type User {
+ User(
+ name: String,
+ )
+ }
```
- Else any functions which rely on this will not be compiled into Javascript.
- ([Pi-Cla](https://github.com/Pi-Cla))
+ ([Rahul D. Ghosal](https://github.com/rdghosal))
+
+- The `<>` string concatenation operator can now be used in constant
+ expressions.
+ ([Thomas](https://github.com/DeviousStoat))
-- 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.
+- Function calls are now fault tolerant. This means that errors in the function
+ call arguments won't stop the rest of the call from being analysed.
([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))
+- The error message presented when a function is called in a guard has been
+ improved.
+ ([Thomas](https://github.com/DeviousStoat))
+
+- Case expressions are now fault tolerant. This means an subject, pattern,
+ guard, or then body can be properly detected and won't invalidate the rest
+ of the expression.
+ ([Ameen Radwan](https://github.com/Acepie))
+
+- Documentation comments that come before a regular comment are no longer
+ clumped together with the documentation of the following definition.
+ Now commenting out a definition won't result in its documentation merging with
+ the following one's.
+
+ ```gleam
+ /// This doc comment will be ignored!
+ // a commented definition
+ // fn wibble() {}
+
+ /// Wibble's documentation.
+ fn wibble() { todo }
+ ```
+
+ ([Giacomo Cavalieri](https://github.com/giacomocavalieri))
+
+- The `little` and `big` endianness options, the `signed` and `unsigned` integer
+ options, and sized floats (32-bit and 64-bit), can now be used in bit array
+ expressions and patterns on the JavaScript target.
+ ([Richard Viney](https://github.com/richard-viney))
+
+- The `utf8` option can now be used with constant strings in bit array patterns
+ on the JavaScript target.
+ ([Richard Viney](https://github.com/richard-viney))
### Formatter
-### Language Server
+- The formatter will no longer move a documentation comment below a regular
+ comment following it. This snippet of code is left as it is by the formatter:
-- The language server will now suggest the "Remove redundant tuple" action even
- if the case expression contains some catch all patterns:
+ ```gleam
+ /// This doc comment will be ignored!
+ // a commented definition
+ // fn wibble() {}
+ /// Wibble's documentation.
+ fn wibble() {
+ todo
+ }
```
- case #(a, b) {
- #(1, 2) -> todo
- _ -> todo
+
+ While previously all documentation comments would be merged together into one,
+ ignoring the regular comment separating them:
+
+ ```gleam
+ // a commented definition
+ // fn wibble() {}
+
+ /// This doc comment will be ignored!
+ /// Wibble's documentation.
+ fn wibble() {
+ todo
}
```
+ ([Giacomo Cavalieri](https://github.com/giacomocavalieri))
+
+### Language Server
+
+- The language server can now show completions for fields if a record access is
+ being attempted.
+ ([Ameen Radwan](https://github.com/Acepie))
+
+- The language server will now insert a blank line before the first statement
+ when inserting a new import and there are no other imports at the top of the
+ module.
+ ([Zhomart Mukhamejanov](https://github.com/Zhomart))
+
+- The language server now suggests a code a action to rename variables, types
+ and functions when they don't match the Gleam naming requirements:
+
+ ```gleam
+ let myNumber = 10
+ ```
+
Becomes:
+ ```gleam
+ let my_number = 10
```
- case a, b {
- 1, 2 -> todo
- _, _ -> todo
+
+ ([Surya Rose](https://github.com/gearsdatapacks))
+
+- The language server can now suggest a code action to convert `let assert` into
+ a case expression:
+
+ ```gleam
+ let assert Ok(value) = get_result()
+ ```
+
+ Becomes:
+
+ ```gleam
+ let value = case get_result() {
+ Ok(value) -> value
+ _ -> panic
}
```
+ ([Surya Rose](https://github.com/gearsdatapacks))
+
+- The language server can now show signature help when writing functions.
([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)
+- The language server now supports listing document symbols, such as functions
+ and constants, for the current Gleam file.
+ ([PgBiel](https://github.com/PgBiel))
-- LSP completions now use the "text_edit" language server API resulting in
- better/more accurate insertions.
- ([Ameen Radwan](https://github.com/Acepie)
+- The language server can now suggest a code action to automatically use
+ shorthand labels where possible:
-### Bug Fixes
+ ```gleam
+ case date {
+ Day(day: day, month: month, year: year) -> todo
+ }
+ ```
+
+ Becomes:
+
+ ```gleam
+ case date {
+ Day(day:, month:, year:) -> todo
+ }
+ ```
+
+ ([Giacomo Cavalieri](https://github.com/giacomocavalieri))
+
+- The language server can now show completions for labels when writing a
+ function call or record construction.
+ ([Ameen Radwan](https://github.com/Acepie))
+
+- The language server can now suggest a code action to fill in the labels of a
+ function call:
+
+ ```gleam
+ pub type Date {
+ Date(year: Int, month: Int, day: Int)
+ }
+
+ pub fn main() {
+ Date()
+ }
+ ```
+
+ Becomes:
+
+ ```gleam
+ pub type Date {
+ Date(year: Int, month: Int, day: Int)
+ }
+
+ pub fn main() {
+ Date(year: todo, month: todo, day: todo)
+ }
+ ```
-- 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.
+- Completions are now sorted by priority based on why the completion is in the
+ list. This means that more specific completions like labels and local
+ definitions will be shown before more broad completions like functions from a
+ not yet imported module.
+ ([Ameen Radwan](https://github.com/Acepie))
+
+### Bug Fixes
+
+- Functions, types and constructors named `module_info` are now escaped
+ in generated Erlang code to avoid conflicts with the builtin
+ `module_info/0` and `module_info/1` functions.
+ ([Juraj Petráš](https://github.com/Hackder))
+
+- Fixed formatting of comments at the start of a case branch.
([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 private type could be leaked from an internal module.
+ ([Ameen Radwan](https://github.com/Acepie))
-- 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 certain binops would not wrap their arguments properly
+ thus generating invalid JavaScript.
+ ([Ameen Radwan](https://github.com/Acepie))
+
+- Fixed formatting of function definitions marked as `@internal`
+ ([Giacomo Cavalieri](https://github.com/giacomocavalieri))
- 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))
+ aliasing it and then using it in a case guard expression would generate
+ invalid JavaScript.
+ ([PgBiel](https://github.com/PgBiel))
-- 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))
+## v1.3.2 - 2024-07-11
-- 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))
+### Language Server
-## v1.2.1 - 2024-05-30
+- The language server no longer shows completions when inside a literal string.
+ ([Giacomo Cavalieri](https://github.com/giacomocavalieri))
### Bug Fixes
-- Fixed a bug where the compiler could fail to detect modules that would clash
- with Erlang modules.
+- Fixed a bug where the compiler would report errors for duplicate `@external`
+ attributes with inconsistent spans between Erlang and JavaScript.
+ ([Connor Szczepaniak](https://github.com/cszczepaniak))
+
+- Fixed a bug where `gleam add` would fail to parse version specifiers
+ correctly.
([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 single clause case expressions could generate JavaScript
+ code with incorrectly rewritten JavaScript variable names.
+ ([Louis Pilfold](https://github.com/lpil))
-- Fixed a bug where trailing comments would be moved out of a bit array.
- ([Giacomo Cavalieri](https://github.com/giacomocavalieri))
+## v1.3.1 - 2024-07-10
+
+### Bug Fixes
+
+- Fixes a bug with import cycle detection when there is more than 2 imports in
+ the cycle.
+ ([Ameen Radwan](https://github.com/Acepie))
diff --git a/Cargo.lock b/Cargo.lock
index 975da3d9136..47321a75ceb 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4,9 +4,9 @@ version = 3
[[package]]
name = "addr2line"
-version = "0.21.0"
+version = "0.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb"
+checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678"
dependencies = [
"gimli",
]
@@ -28,47 +28,48 @@ dependencies = [
[[package]]
name = "anstream"
-version = "0.6.13"
+version = "0.6.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb"
+checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b"
dependencies = [
"anstyle",
"anstyle-parse",
"anstyle-query",
"anstyle-wincon",
"colorchoice",
+ "is_terminal_polyfill",
"utf8parse",
]
[[package]]
name = "anstyle"
-version = "1.0.6"
+version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc"
+checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b"
[[package]]
name = "anstyle-parse"
-version = "0.2.3"
+version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c"
+checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4"
dependencies = [
"utf8parse",
]
[[package]]
name = "anstyle-query"
-version = "1.0.2"
+version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648"
+checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391"
dependencies = [
"windows-sys 0.52.0",
]
[[package]]
name = "anstyle-wincon"
-version = "3.0.2"
+version = "3.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7"
+checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19"
dependencies = [
"anstyle",
"windows-sys 0.52.0",
@@ -76,9 +77,9 @@ dependencies = [
[[package]]
name = "anyhow"
-version = "1.0.82"
+version = "1.0.86"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519"
+checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da"
[[package]]
name = "askama"
@@ -165,9 +166,9 @@ dependencies = [
[[package]]
name = "async-trait"
-version = "0.1.80"
+version = "0.1.81"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca"
+checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107"
dependencies = [
"proc-macro2",
"quote",
@@ -176,15 +177,15 @@ dependencies = [
[[package]]
name = "autocfg"
-version = "1.2.0"
+version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80"
+checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0"
[[package]]
name = "backtrace"
-version = "0.3.71"
+version = "0.3.73"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d"
+checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a"
dependencies = [
"addr2line",
"cc",
@@ -280,15 +281,15 @@ checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa"
[[package]]
name = "bytes"
-version = "1.6.0"
+version = "1.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9"
+checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952"
[[package]]
name = "camino"
-version = "1.1.6"
+version = "1.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c"
+checksum = "e0ec6b951b160caa93cc0c7b209e5a3bff7aae9062213451ac99493cd844c239"
dependencies = [
"serde",
]
@@ -310,9 +311,9 @@ dependencies = [
[[package]]
name = "cc"
-version = "1.0.90"
+version = "1.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5"
+checksum = "2aba8f4e9906c7ce3c73463f62a7f0c65183ada1a2d47e397cc8810827f9694f"
[[package]]
name = "cfg-if"
@@ -328,9 +329,9 @@ checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e"
[[package]]
name = "clap"
-version = "4.5.4"
+version = "4.5.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0"
+checksum = "8f6b81fb3c84f5563d509c59b5a48d935f689e993afa90fe39047f05adef9142"
dependencies = [
"clap_builder",
"clap_derive",
@@ -338,9 +339,9 @@ dependencies = [
[[package]]
name = "clap_builder"
-version = "4.5.2"
+version = "4.5.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4"
+checksum = "5ca6706fd5224857d9ac5eb9355f6683563cc0541c7cd9d014043b57cbec78ac"
dependencies = [
"anstream",
"anstyle",
@@ -350,11 +351,11 @@ dependencies = [
[[package]]
name = "clap_derive"
-version = "4.5.4"
+version = "4.5.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64"
+checksum = "2bac35c6dafb060fd4d275d9a4ffae97917c13a6327903a8be2153cd964f7085"
dependencies = [
- "heck 0.5.0",
+ "heck",
"proc-macro2",
"quote",
"syn 2.0.58",
@@ -382,16 +383,6 @@ version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7"
-[[package]]
-name = "combine"
-version = "4.6.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4"
-dependencies = [
- "bytes",
- "memchr",
-]
-
[[package]]
name = "console"
version = "0.15.8"
@@ -796,13 +787,13 @@ dependencies = [
[[package]]
name = "gimli"
-version = "0.28.1"
+version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253"
+checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd"
[[package]]
name = "gleam"
-version = "1.2.1"
+version = "1.4.0-rc1"
dependencies = [
"async-trait",
"base16",
@@ -849,7 +840,7 @@ dependencies = [
[[package]]
name = "gleam-core"
-version = "1.2.1"
+version = "1.4.0-rc1"
dependencies = [
"askama",
"async-trait",
@@ -866,7 +857,7 @@ dependencies = [
"flate2",
"futures",
"globset",
- "heck 0.5.0",
+ "heck",
"hexpm",
"http",
"id-arena",
@@ -900,7 +891,7 @@ dependencies = [
[[package]]
name = "gleam-wasm"
-version = "1.2.1"
+version = "1.4.0-rc1"
dependencies = [
"camino",
"console_error_panic_hook",
@@ -944,12 +935,6 @@ version = "0.14.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604"
-[[package]]
-name = "heck"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
-
[[package]]
name = "heck"
version = "0.5.0"
@@ -1085,9 +1070,9 @@ dependencies = [
[[package]]
name = "hyper-rustls"
-version = "0.26.0"
+version = "0.27.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a0bea761b46ae2b24eb4aef630d8d1c398157b6fc29e6350ecf090a0b70c952c"
+checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155"
dependencies = [
"futures-util",
"http",
@@ -1098,6 +1083,7 @@ dependencies = [
"tokio",
"tokio-rustls",
"tower-service",
+ "webpki-roots",
]
[[package]]
@@ -1204,11 +1190,17 @@ version = "2.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3"
+[[package]]
+name = "is_terminal_polyfill"
+version = "1.70.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800"
+
[[package]]
name = "itertools"
-version = "0.10.5"
+version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473"
+checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186"
dependencies = [
"either",
]
@@ -1228,15 +1220,6 @@ dependencies = [
"wasm-bindgen",
]
-[[package]]
-name = "kstring"
-version = "1.0.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8b310ccceade8121d7d77fee406160e457c2f4e7c7982d589da3499bc7ea4526"
-dependencies = [
- "serde",
-]
-
[[package]]
name = "lazy_static"
version = "1.4.0"
@@ -1245,9 +1228,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]]
name = "libc"
-version = "0.2.153"
+version = "0.2.155"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd"
+checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c"
[[package]]
name = "libdbus-sys"
@@ -1289,9 +1272,9 @@ checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c"
[[package]]
name = "log"
-version = "0.4.21"
+version = "0.4.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c"
+checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
[[package]]
name = "lsp-server"
@@ -1366,13 +1349,14 @@ dependencies = [
[[package]]
name = "mio"
-version = "0.8.11"
+version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c"
+checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4"
dependencies = [
+ "hermit-abi",
"libc",
"wasi",
- "windows-sys 0.48.0",
+ "windows-sys 0.52.0",
]
[[package]]
@@ -1451,21 +1435,11 @@ dependencies = [
"autocfg",
]
-[[package]]
-name = "num_cpus"
-version = "1.16.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43"
-dependencies = [
- "hermit-abi",
- "libc",
-]
-
[[package]]
name = "object"
-version = "0.32.2"
+version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441"
+checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce"
dependencies = [
"memchr",
]
@@ -1520,9 +1494,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
[[package]]
name = "petgraph"
-version = "0.6.4"
+version = "0.6.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9"
+checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db"
dependencies = [
"fixedbitset",
"indexmap 2.2.6",
@@ -1660,9 +1634,9 @@ dependencies = [
[[package]]
name = "pulldown-cmark"
-version = "0.10.3"
+version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "76979bea66e7875e7509c4ec5300112b316af87fa7a252ca91c448b32dfe3993"
+checksum = "8746739f11d39ce5ad5c2520a9b75285310dbfe78c541ccf832d38615765aec0"
dependencies = [
"bitflags 2.5.0",
"memchr",
@@ -1672,9 +1646,55 @@ dependencies = [
[[package]]
name = "pulldown-cmark-escape"
-version = "0.10.0"
+version = "0.11.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "007d8adb5ddab6f8e3f491ac63566a7d5002cc7ed73901f72057943fa71ae1ae"
+
+[[package]]
+name = "quinn"
+version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d5d8f9aa0e3cbcfaf8bf00300004ee3b72f74770f9cbac93f6928771f613276b"
+checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad"
+dependencies = [
+ "bytes",
+ "pin-project-lite",
+ "quinn-proto",
+ "quinn-udp",
+ "rustc-hash",
+ "rustls",
+ "thiserror",
+ "tokio",
+ "tracing",
+]
+
+[[package]]
+name = "quinn-proto"
+version = "0.11.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe"
+dependencies = [
+ "bytes",
+ "rand",
+ "ring",
+ "rustc-hash",
+ "rustls",
+ "slab",
+ "thiserror",
+ "tinyvec",
+ "tracing",
+]
+
+[[package]]
+name = "quinn-udp"
+version = "0.5.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285"
+dependencies = [
+ "libc",
+ "once_cell",
+ "socket2",
+ "windows-sys 0.52.0",
+]
[[package]]
name = "quote"
@@ -1746,9 +1766,9 @@ dependencies = [
[[package]]
name = "regex"
-version = "1.10.4"
+version = "1.10.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c"
+checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f"
dependencies = [
"aho-corasick",
"memchr",
@@ -1790,9 +1810,9 @@ checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56"
[[package]]
name = "reqwest"
-version = "0.12.4"
+version = "0.12.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10"
+checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37"
dependencies = [
"base64 0.22.0",
"bytes",
@@ -1811,6 +1831,7 @@ dependencies = [
"once_cell",
"percent-encoding",
"pin-project-lite",
+ "quinn",
"rustls",
"rustls-pemfile",
"rustls-pki-types",
@@ -1867,9 +1888,9 @@ dependencies = [
[[package]]
name = "rustc-demangle"
-version = "0.1.23"
+version = "0.1.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76"
+checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f"
[[package]]
name = "rustc-hash"
@@ -1901,11 +1922,11 @@ dependencies = [
[[package]]
name = "rustls"
-version = "0.22.4"
+version = "0.23.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432"
+checksum = "ebbbdb961df0ad3f2652da8f3fdc4b36122f568f968f45ad3316f26c025c677b"
dependencies = [
- "log",
+ "once_cell",
"ring",
"rustls-pki-types",
"rustls-webpki",
@@ -1969,9 +1990,9 @@ checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294"
[[package]]
name = "serde"
-version = "1.0.199"
+version = "1.0.204"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0c9f6e76df036c77cd94996771fb40db98187f096dd0b9af39c6c6e452ba966a"
+checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12"
dependencies = [
"serde_derive",
]
@@ -1989,9 +2010,9 @@ dependencies = [
[[package]]
name = "serde_derive"
-version = "1.0.199"
+version = "1.0.204"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "11bd257a6541e141e42ca6d24ae26f7714887b47e89aa739099104c7e4d3b7fc"
+checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222"
dependencies = [
"proc-macro2",
"quote",
@@ -2128,20 +2149,20 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
[[package]]
name = "strum"
-version = "0.26.2"
+version = "0.26.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29"
+checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06"
dependencies = [
"strum_macros",
]
[[package]]
name = "strum_macros"
-version = "0.26.2"
+version = "0.26.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946"
+checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be"
dependencies = [
- "heck 0.4.1",
+ "heck",
"proc-macro2",
"quote",
"rustversion",
@@ -2178,9 +2199,9 @@ dependencies = [
[[package]]
name = "sync_wrapper"
-version = "0.1.2"
+version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160"
+checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394"
[[package]]
name = "synstructure"
@@ -2238,7 +2259,7 @@ dependencies = [
[[package]]
name = "test-package-compiler"
-version = "1.2.1"
+version = "1.4.0-rc1"
dependencies = [
"camino",
"gleam-core",
@@ -2294,9 +2315,9 @@ dependencies = [
[[package]]
name = "time"
-version = "0.3.34"
+version = "0.3.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749"
+checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885"
dependencies = [
"deranged",
"itoa",
@@ -2315,9 +2336,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3"
[[package]]
name = "time-macros"
-version = "0.2.17"
+version = "0.2.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774"
+checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf"
dependencies = [
"num-conv",
"time-core",
@@ -2340,25 +2361,24 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "tokio"
-version = "1.37.0"
+version = "1.39.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787"
+checksum = "d040ac2b29ab03b09d4129c2f5bbd012a3ac2f79d38ff506a4bf8dd34b0eac8a"
dependencies = [
"backtrace",
"bytes",
"libc",
"mio",
- "num_cpus",
"pin-project-lite",
"socket2",
- "windows-sys 0.48.0",
+ "windows-sys 0.52.0",
]
[[package]]
name = "tokio-rustls"
-version = "0.25.0"
+version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f"
+checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4"
dependencies = [
"rustls",
"rustls-pki-types",
@@ -2374,16 +2394,21 @@ dependencies = [
"serde",
]
+[[package]]
+name = "toml_datetime"
+version = "0.6.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf"
+
[[package]]
name = "toml_edit"
-version = "0.9.1"
+version = "0.22.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6b26d63d75583ce572323a963b850d2121cf47a03b1f6c5fc96d641d3b0412b3"
+checksum = "278f3d518e152219c994ce877758516bca5e118eaed6996192a774fb9fbf0788"
dependencies = [
- "combine",
- "indexmap 1.9.3",
- "itertools",
- "kstring",
+ "indexmap 2.2.6",
+ "toml_datetime",
+ "winnow",
]
[[package]]
@@ -2920,6 +2945,15 @@ version = "0.52.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8"
+[[package]]
+name = "winnow"
+version = "0.6.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1"
+dependencies = [
+ "memchr",
+]
+
[[package]]
name = "winreg"
version = "0.52.0"
@@ -2960,9 +2994,9 @@ dependencies = [
[[package]]
name = "xxhash-rust"
-version = "0.8.10"
+version = "0.8.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "927da81e25be1e1a2901d59b81b37dd2efd1fc9c9345a55007f09bf5a2d3ee03"
+checksum = "63658493314859b4dfdf3fb8c1defd61587839def09582db50b8a4e93afca6bb"
[[package]]
name = "yansi"
diff --git a/Cargo.toml b/Cargo.toml
index 7d934a6a47d..1d6a3a01dad 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -18,7 +18,7 @@ regex = "1"
# Colours in terminal
termcolor = "1"
# Data (de)serialisation
-serde = { version = "1", features = ["derive"] }
+serde = { version = "1", features = ["derive", "rc"] }
serde_json = "1"
# toml config file parsing
toml = "0"
@@ -60,4 +60,4 @@ pretty_assertions = "1"
insta = "1"
# A transitive dependency needed to compile into wasm32-unknown-unknown
# See https://docs.rs/getrandom/latest/getrandom/index.html#webassembly-support
-getrandom = { version = "0", features = ["js"] }
\ No newline at end of file
+getrandom = { version = "0", features = ["js"] }
diff --git a/README.md b/README.md
index 365ff32a258..bc60e3854f3 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,6 @@
-
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