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