changelog/v1.1.md
@internal annotation wouldn't be displayed.debugger, which
is a JavaScript keyword, were not being renamed, leading to runtime errors.@internal attribute can now be used to annotate definitions.
This will hide those definitions from the generated documentation,
autocompletions and the exported module interface.[x, ..xs] syntax) has been optimised.[..rest, last]).tuple.0.1) now parses successfully.') to define a string\u{...}).case clause's guard, would be used
before they were defined, leading to a runtime error when evaluating the
case expression.BitArray caused unknown variable exception.BitArray segment sizes.panic on the JavaScript target: it now
correctly identifies the error variant as a panic instead of a todo.[ , ], causing them
to wrongly have a length of one (the array has a single undefined element).\n are now handled by the formatter, preserving
blank lines and converting them to \n.gleam run --target javascript --runtime bun"rebar" using the rebar3
compiler..gleam file with a path that would be
invalid as a module name.~> x.y version constraint syntax has been dropped in favour of
> x.y.z and <= xx.0.0 syntax in gleam add and gleam new, for clarity.actions/checkout v4 action.FORCE_COLOR environment
variable to any non-empty value.webpki-roots are now used for TLS verification.--location runtime flag.gleam publish command now asks for confirmation if the package
repository URL doesn't return a successful status code.gleam publish can now optionally use a Hex API key to authorise publishing
and retiring packages, set via the environment variable HEXPM_API_KEY.gleam publish will now refuse to publish placeholder packages, to prevent
name squatting which is against the Hex terms of service.export package interface command would always
recompile the project ignoring the cache.Compiling Gleam message is no longer emitted each time code is compiled.
This is to reduce noise in editors that show this message prominently such as
Neovim.todo expression then the build tool will now refuse
to publish it to Hex.gleam export now takes a package-interface option to export a json file
containing metadata about the root package.gleam docs build now creates a json file containing metadata about the root
package.manifest.toml is now in alphabetical order.gleam run -m to run a dependency module even if
that dependency uses a compile target that your project does not support.functionname(_name) would incorrectly parse as a function
capture instead of a syntax error.@deprecated attribute can now be used to annotate module constants.
This will cause a warning to be emitted when the constant is used.gleam run would fail when the current directory is not
the root of the project and using the JavaScript target.View on HexDocs link on function hover.gleam new command now accepts any existing path, as long as there are
no conflicts with already existing files. Examples: gleam new ., gleam new .., gleam new ~/projects/test.gleam new has been altered.gleam.toml created by gleam new now has a link to the full reference
for its available options.gleam binary is now statically linked on Windows.repository section now supports additional VCS types in the form of
codeberg, forgejo and gitea allowing a user, repo and additionally a
host url.gleam commands now look in parent directories for a gleam.toml file.gleam add would not update manifest.toml correctly.fn() { Nil }() could generate invalid JavaScript code.gleam new would generate a gitignore with build rather
than /build.Utf8Codepoint has been renamed to UtfCodepoint in prelude.d.mts.gleam deps list would look in filesystem root instead of
the current directory.isEqual function in prelude.js where RegExps were
being incorrectly structurally compared and being falsely reported as being
equal.prelude.d.mts in gleam.d.mts to fix the error:
"Type 'Result' is not generic".binary and bit_string have been removed.BitString type has been removed.inspect functions and BitString type has been removed from
the JavaScript prelude.\e string escape sequence has been removed. Use \u{001b} instead.\u string escape sequence would not work with
on Erlang on the right hand side of a string concatenation.gleam format now ignores the Gleam build directory by default, even when not
in a git repository.! operator can now be used in clause guards.auto, delegate, derive, else, implement, macro, and
test are now reserved for future use. If used they will emit a warning. In
a future version this may be upgraded to an error.\u{...} syntax can be used in strings to specify unicode codepoints via a
hexadecimal number with 1 to 6 digits.todo as and panic as syntaxes now accept an expression that evaluates
to a string rather than just a string literal.gleam run and gleam test commands gain the -t flag, which is an
alias of the --target flag.gleam build, gleam check, gleam run and gleam test commands now
also accept js and erl as values for the --target flag.gleam new command now creates packages at version 1.0.0.gleam publish command now asks for confirmation if the package being
published is not yet version 1.0.0.gleam publish command now asks for confirmation if the package name is
one that implies the package is maintained by the Gleam core team./. operator no longer generates a warning
for the upcoming negative zero float change in Erlang OTP 27. as name from string prefix
patterns.let assert would generate
incorrect JavaScript.target property of gleam.toml being ignored for local path
dependencies by gleam run -m module/name_.gleam format coming last in
the GitHub Actions workflow. This is so that feedback from tests is presented
even if formatting is incorrect.gleam export erlang-shipment command.gleam_stdlib v0.32 and gleeunit v1.0.gleam fix would not produce correct results for code that
shadowed a prelude name with an import of the same name but a different kind.gleam fix would not produce correct results for code that
shadowed a prelude name with an import of the same name but a different kind.gleam fix multiple times could produce incorrect
results.gleam fix would fail to update the deprecated type import
syntax for aliased unqualified types.import module.{TypeName} to import a type has been deprecated,
replaced by import module.{type TypeName}. In a future version of Gleam the
old syntax will only import the value of the same name. Run gleam fix to
update your code.BitString type has been renamed to BitArray. Run gleam fix to update
your code.binary and bit_string bit array modifier have been deprecated in favour
of bytes and bits.__gleam_prelude_variant__ property has been removed from the classes
defined in the JavaScript prelude.todo("...") syntax has been removed.@deprecated attribute can now be used with type definitions.use on
hover.gleam check command supports the target flag.gleam fix command updates code to use BitArray rather than BitString.gleam fix command updates code to use the new import type syntax.gleam fix sets the gleam version constraint in gleam.toml to >= 0.32.0.gleam version constraint field in gleam.toml now disregards pre and
build components when checking for compatibility.gleam compile-package API you now need to give a path to the
prelude using the --javascript-prelude flag.gleam export javascript-prelude and gleam export typescript-prelude
commands have been added to export a copy of the prelude. This command may be
useful for build tools that use the compiler via the gleam compile-package
API.mix and rebar3 are now built
with mix if it exists on the system, and with rebar3 if it doesn't.gleam run no longer traps exits on Erlang.+0.0 to silence warnings in
Erlang/OTP 27.gleam_stdlib v0.31, actions/checkout
v3.*, and erlef/setup-beam v1.*.@deprecated("...") attribute can be used to mark a function as
deprecated. This will cause a warning to be emitted when the function is used.manifest.toml could contain absolute paths for path
dependencies.as keyword can now be used to assign the literal prefix to a variable
when pattern matching on a string.if conditional compilation, external fn, and external type syntaxes
have been removed.description flag for the gleam new command has been removed.BitString class
constructor and passes in the incorrect argument type.import type for importing types from typescript declarations..d.mts extension for typescript declarations to match .mjs.node:fs would be rejected.gleam_stdlib v0.30, Erlang OTP v26.0.2,
Elixir v1.15.4, actions/checkout v3.5.1, and erlef/setup-beam v1.16.0.gleam fix would fail to parse command line flags.gleam fix would merge external functions of the same name
but incompatible types.@target(erlang) and @target(javascript) attribute syntax has been
added for conditional compilation. The existing if conditional compilation
syntax has been deprecated. Run gleam fix to update your code.type TypeName syntax syntax replaces the external type TypeName
syntax. The existing external type syntax has been deprecated. Run gleam format
to update your code.panic with panic as "...".todo is now todo as "...".let assert is now tagged let_assert.Dynamic are now called dynamic_ in Erlang to avoid a clash
with the new Erlang dynamic type introduced in OTP26.packagename = { path = "..." } syntax in gleam.toml.javascript.deno.unstable field in gleam.toml can now be used to
enable Deno's unstable APIs when targeting JavaScript.gleam property can be set in gleam.toml can be set to a version
requirement to specify the version of Gleam required to build the project.<> and |> would clash.gleam docs build would print an incorrect path upon
completion.list.length to check for the empty list,
which is slow compared to checking for equality or pattern matching (#2180).gleam remove <package_name> can be used to remove dependencies
from a Gleam project.panic.gleam docs build command gains the --open flag to open the docs after
they are generated (#2188).gleam_stdlib v0.29.gleam lsp command is no longer hidden from the help output...) to discard
unwanted arguments would not type check correctly when the record had no
labelled fields.--) and bools
(!!) as this does nothing but return the original value.erlef/[email protected] in their GitHub
actions CI configuration.gleam.toml.src or test directories.actions/[email protected] and
erlef/[email protected] in their GitHub actions CI configuration.use expression would be formatted
incorrectly.gleam_stdlib v0.28.- unary operator.try expression has been removed.assert ... = ... syntax has been removed.--warnings-as-errors flag is now supported by gleam build.{ ... } from bit
string segment value expressions.gleam run --module command.panic could generate incorrect JavaScript code.gleam_stdlib v0.27.panic keyword can be used to crash the program. This may be useful
for situations in which a program has got into an unrecoverable invalid state.try expressions are now deprecated and will be removed in a future version.gleam fix command can be used to automatically convert try
expressions to use expressions.let assert ... = ... is now the syntax for assertion assignments. The
assert ... = ... syntax is deprecated and will be removed in a future
version. Run gleam format to automatically update your code.gleam export hex-tarball can be used to create a tarball suitable for
uploading to a Hex compatible package repository.--runtime now accepts nodejs as the name for that runtime.
The previous name node is still accepted.use expressions.| patterns in case clauses over multiple lines.gleeunit v0.10.build directory.let does not match all possible values has
been improved.assert expressions can generate invalid Erlang.
warning.gleam_stdlib v0.26 and gleeunit v0.9.gleam new will skip git init if the new project directory is
already part of a git work tree.internal_modules in gleam.toml. The default value for this
list is ["$package_name/internal", "$package_name/internal/*"].gleam new command gains the --skip-git flag to skip creation of
.git/*, .gitignore and .github/* files.gleam new command gains the --skip-github flag to skip creation of
.github/* files.src module imported a
test module.use expressions could be formatted incorrectly.int and float formatting in consts and patterns.actions/checkout from actions/[email protected] to @v3.2.0 for
projects created via gleam new.gleam new would set a Rebar3 version to 25.1
instead of the latest stable 3.gleam new: Erlang/OTP
to 25.2, and Elixir to 1.14.2.Ints and the larger
integer parts of Floats.priv directory could fail
to build.theme-color HTML meta tag.use expression has been introduced. This is a new syntactic sugar that
permits callback using code to be written without indentation.todo would not print the type of the code
to complete.try expressions inside blocks could generate incorrect
JavaScript.javascript.typescript_declarations field in gleam.toml now applies to
the entire project rather than just the top level package.0 to floats ending with . (ie 1. => 1.0).gleam_stdlib v0.25.src directory.<> operator can now be used for string concatenation and for string
prefix pattern matching.gleam_stdlib v0.24.thing.method()) on a value
without that field the error message will now include a hint explaining that
Gleam is not object oriented and does not have methods.gleam publish command now adds the priv directory and any NOTICE
file to the tarball.gleam update command can now be used to update dependency packages to
their latest versions.equals method in its prototype,
Gleam will now use this method when checking for equality.CustomeType would product invalid
JavaScript.todo would generate invalid Erlang code.gleam new would in some situations not validate the
target directory correctly.gleam publish confirmation prompt now accepts both "Y" and "y".todo would not emit the correct line number to the LSP while.gleam_stdlib v0.22.Fixed a bug where doc comments would dissociate from their statements when generating html documentation.
You are now allowed to use named accessors on types with multiple constructors if the accessor's name, position and type match (among the constructors) (#1610).
Added the ability to replace a release up to one hour after it is published
using gleam publish --replace.
gleam publish, gleam docs publish, gleam docs remove, gleam hex retire,
and gleam hex unretire now have access to environment variables for
username (default key HEXPM_USER) and password (default key HEXPM_PASS)
The gleam publish command gains the -y/--yes flag to disable the "are you
sure" prompt.
Clear outdated files from the build directory after compilation.
Fixed a bug where immediately calling the value that a case expression evaluates to could generate invalid JavaScript.
Fixed a bug where the default project target is set to JavaScript, but the project would run on target Erlang instead.
The compiler is now able to generate TypeScript declaration files on target
JavaScript (#1563). To enable this edit gleam.toml like so:
[javascript]
typescript_declarations = true
Fixed a bug where argument labels were allowed for anonymous functions.
Fixed a bug where JavaScript code could be invalid if a variable is defined inside an anonymous function with a parameter with the same name as the variable.
Fixed a bug where importing a JavaScript function named "then" could produce invalid code.
Fixed a bug where constants that reference locally defined custom types could render invalid JavaScript.
The project generator will no longer permit use of the reserved gleam_
prefix.
Generated HTML docs easter egg updated.
gleam export erlang-shipment can be used to create a directory of compiled
Erlang bytecode that can be used as a deployment artefact to get your
application live.
gleam format will now preserve (up to one) empty lines between consecutive
comments, as well as between comments and any following expression
The deprecated rebar3 integration has been removed.
Fixed a bug where gleam format would output an unwanted newline at the top
of documents that only contain simple // comments.
No longer add dev_dependencies to generated .app Erlang files unless
we're compiling the root project (#1569).
Fixed a bug where the formatter could render a syntax error with lists on long unbreakable lines.
Fixed a bug where JavaScript variable names could be incorrectly reused.
Fixed a bug where gleam format would remove the braces around a tuple index
access when accessing a field of the returned element.
Fixed a bug case clause guards could render incorrect JavaScript if a variable name was rebinded in the clause body.
The gleam compile-package command no longer generates a .app file. This
should now be done by the build tool that calls this command as it is
responsible for handling dependencies.
Fixed a bug where piping a list tail would create invalid Erlang code (#1656).
gleam_stdlib v0.21.gleam publish --replace.gleam.toml.then would
cause errors when dynamically imported.git repo when creating a new project.GLEAM_LOG now print to standard error.GLEAM_LOG_NOCOLOUR
environment variable.gleam add.! unary operator.int and float bit string type when compiling to JavaScript.record.field) in anonymous functions passed into higher order functions
without additional annotations.gleam_stdlib v0.20.mix_gleam
plugin is to be used instead.ebin directory is now copied to the build directory for rebar3 managed
dependencies if present before compilation.gleam.toml are validated when the config is read.priv directory is linked into the build directory for Gleam projects
managed by the build tool.Dedicated to the memory of Muhammad Shaheer, a good and caring man.
gleam_stdlib v0.19 and gleeunit v0.6.erlef/setup-beam v1.9.0 instead of
gleam-lang/setup-erlang and gleam-lang/setup-gleam.include directories would not be accessible by the Erlang
compiler during Gleam compilation.gleam.toml or using the --target flag.gleam check command has been introduced for rapidly verifying the types
of Gleam code without performing codegen.true and false can no longer be used as pattern matching variables, to
avoid accidental uses of incorrect syntax that is popular in other languages.
An error will hint about using Gleam's True and False values instead.gleam clean command.compile-package can now generate package.app files and compile source
modules to .beam bytecode files.compile-package accepts have changed.include directory within the
package build directory.gleam run and gleam test.priv directory is now copied to the output directory for rebar3 packages
prior to compilation. This is required for some packages to compile.gleeunit.gleam deps list command has been added.gleam.toml would not cause deps
to be re-resolved..app file.gleam.toml now includes an erlang.extra_applications key to specify extra
OTP applications that need to be started.gleam eunit command.gleam run command.gleam shell command.gleam new have been changed.gleam_stdlib v0.17.1.gleam-lib template.todo caused values not to be returned in JavaScript.bit_string, utf8
or utf8_codepoint options can be constructed when compiling to JavaScript.eval and arguments to JavaScript reserved words.tuple(x, y, ...) syntax has been removed in favor
of the more concise (#(x, y, ...)). Use gleam format with the previous
version of the compiler to auto-migrate.gleam_otp v0.1.6.todo could sometimes render invalid JavaScript when used
as an expression in the generated code.[..xs].gleam-packages. This can be served from your web server or aliased in your
package.json for NodeJS projects.gleam_stdlib v0.17.0.gleam_otp v0.2.0.try expressions when compiling to JavaScript.gleam_stdlib v0.16.0.gleam prelude module can now be imported when compiling to JavaScript.--target javascript flag to
gleam compile-package to use it today.gleam new command requires a root folder param, project name is
optional and if not provided the project name will be inferred from
the folder name.gleam_otp v0.1.5.#(x, y, ...). Existing code
can be auto-migrated to the new syntax by running gleam format.\e string escapes.gleam module.let and assert are now expressions and no longer require
a following expression in their containing block. They are now themselves
expressions.new command now checks if target folder exists, if so it returns
an error.gleam.gleam_stdlib v0.15.0.gleam.toml has a comment that shows how to add a
repository field.src/$APP.app.src by
default.+ or +. operator.setup-erlang v1.1.2 and Erlang/OTP v23.2.gleam_stdlib v0.14.0.escript template to generate a
command line tool style program.\r, \n, \t, \", and \\ string escapes.todo keyword now carries additional
information.assert keyword now carries additional
information.--warnings-as-errors flag added to gleam build command.ring dep upgraded to enable compilation on Apple M1 ARM processors.version property in gleam.toml is now optional again.app project template rendered invalid code.fn and (.1-1 and a-1 are now parsed as 1 - 1 and a - 1new command will no longer permit projects to be made with names that
clash with Erlang standard library modules.mod value in the generated
.app.src.todo now includes the required type of the
not-yet-implemented expression.gleam.toml and gen.{ }s when formatted.{ }..hrl files if they conflict
with Erlang reserved wordslet and assert expressionsdocs build.deps directory.gleam-lang/setup-erlang v1.1.0.docs build, docs publish, and docs remove commands can be used to
compile HTML documentation locally, publish them to HexDocs, and remove them
from HexDocs respectively.gleam build --doc.gleam format command.|> will now attempt to insert the left hand side as the
first argument to the right hand side if the right hand side is a call,
removing the need for function capture boilerplate.record.label syntax can now be used to access the fields of a custom
type that have a single record variant.todo keyword for type checking functions that have not yet been
implemented.var.1 syntax.>, >=, <, and <= operators are now supported in case clause guards
and can be used to check the ordering of integers.>., >=., <., and <=. operators are now supported in case clause
guards and can be used to check the ordering of floats.[x, ..y]. The old [x | y] syntax is
deprecated but will continue to work for now. The formatter will rewrite the
old syntax to the new.assert Ok(x) = result. In the
future this will allow you to use a pattern that does not match all values... syntax for discarding the remaining fields of a record.[x, ..] is the
same as [x, .._]. The former is the preferred version and is emitted by the
formatter.gleam new use stdlib version 0.7.0.gleam new now creates a project that uses actions/[email protected] in its
GitHub actions workflow.as
keyword.gleam new command fails to
write the new project to the file system.gen directory is now deleted before each compilation.gleam new now includes installation instructions for Hex packages in the
generated README.gleam new now accepts a --description flag for including a description of
the project in the README and .app.src file.import mod.{value as name} syntax.gleam new creates a project at v1.0.0.case expressions now accept multiple subjects, enabling pattern matching
on multiple values simultaneously.gleam new now accepts a --template flag to generate different styles of
project. An OTP application template has been added alongside the existing
OTP library template.gleam new now creates configuration for GitHub Actions, making Gleam
projects ready for continuous integration out of the box.>. >=. <. and <=. comparison operators have been added for
comparing Floats.Nil constructor will no longer erroneously be of type Int.gleam new command.catch or or.my_app/user/profile.import my_mod as name syntax.catch or or.[1, 2, 3 | my_list]Nil which is occupied by a single value (Nil). This
type is used to represent the absence of a value and is commonly used with
Result to model a value that is either present (Ok(value)) or absent
(Error(Nil)).