|
1 | 1 | # Changelog
|
2 | 2 |
|
3 |
| -## v1.4.0-rc2 - Unreleased |
4 |
| - |
5 |
| -### Bug Fixes |
6 |
| - |
7 |
| -- Fixed a bug where pipe function arity errors could have an incorrect error |
8 |
| - message. |
9 |
| - ([sobolevn](https://github.com/sobolevn)) |
10 |
| - |
11 |
| -- Fixed a bug where the case of type parameters would not be checked. |
12 |
| - ([Surya Rose](https://github.com/gearsdatapacks)) |
13 |
| - |
14 |
| -## v1.4.0-rc1 - 2024-07-29 |
15 |
| - |
16 |
| -### Build tool |
17 |
| - |
18 |
| -- `gleam docs build` now takes an optional `--target` flag to specify the target |
19 |
| - platform for the generated documentation. |
20 |
| - ([Jiangda Wang](https://github.com/frank-iii)) |
21 |
| - |
22 |
| -- Warnings are now emitted each time the project is built, even if the module |
23 |
| - the warnings originated from were loaded from the cache rather than |
24 |
| - recompiling. |
25 |
| - ([Louis Pilfold](https://github.com/lpil)) |
| 3 | +## Unreleased |
26 | 4 |
|
27 | 5 | ### Compiler
|
28 | 6 |
|
29 |
| -- Labelled arguments can now use the label shorthand syntax. |
30 |
| - This means that when you're passing a variable as a labelled argument and it |
31 |
| - happens to have the same name as the label, you can omit the variable name: |
32 |
| - |
33 |
| - ```gleam |
34 |
| - pub fn date(day day: Int, month month: Month, year year: Year) -> Date { |
35 |
| - todo |
36 |
| - } |
37 |
| -
|
38 |
| - pub fn main() { |
39 |
| - let day = 11 |
40 |
| - let month = October |
41 |
| - let year = 1998 |
42 |
| -
|
43 |
| - date(year:, month:, day:) |
44 |
| - // This is the same as writing |
45 |
| - // date(year: year, month: month, day: day) |
46 |
| - } |
47 |
| - ``` |
48 |
| - |
49 |
| - ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) |
50 |
| - |
51 |
| -- Labelled pattern variables can now use the label shorthand syntax. |
52 |
| - This means that when you're pattern matching on a record constructor and |
53 |
| - binding its labelled fields to variables that happen to have the same name, |
54 |
| - you can omit the variable name: |
55 |
| - |
56 |
| - ```gleam |
57 |
| - pub type Date |
58 |
| - Date(day: Int, month: Month, year: Year) |
59 |
| - } |
60 |
| -
|
61 |
| - pub fn main() { |
62 |
| - case Date(11, October, 1998) { |
63 |
| - Date(year:, month:, day:) -> todo |
64 |
| - // This is the same as writing |
65 |
| - // Date(year: year, month: month, day: day) -> todo |
66 |
| - } |
67 |
| -
|
68 |
| - } |
69 |
| - ``` |
70 |
| - |
71 |
| - ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) |
72 |
| - |
73 |
| -- The warning for the deprecated `[..]` pattern has been improved. |
74 |
| - ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) |
75 |
| - |
76 |
| -- Record accessors are now fault tolerant. This means an invalid label can be |
77 |
| - properly detected and won't invalidate the rest of the expression. |
78 |
| - ([Ameen Radwan](https://github.com/Acepie)) |
79 |
| - |
80 |
| -- Erlang type spec generation has been improved to avoid new warnings emitted in |
81 |
| - OTP27. |
82 |
| - ([Damir Vandic](https://github.com/dvic)) |
83 |
| - |
84 |
| -- Error messages for invalid record constructors now contain a restructured |
85 |
| - example of what the user likely intended. This is especially helpful for |
86 |
| - users coming from other languages, like Rust or Go. |
87 |
| - |
88 |
| - For example, provided a User type: |
89 |
| - |
90 |
| - ```gleam |
91 |
| - pub type User { |
92 |
| - name: String |
93 |
| - } |
94 |
| - ``` |
| 7 | +- Generated Erlang `.app` files now include external modules written in Elixir |
| 8 | + and Erlang. |
| 9 | + ([LostKobrakai](https://github.com/lostkobrakai)) |
95 | 10 |
|
96 |
| - The compiler errors with the following message: |
| 11 | +- HexDocs documentation of Gleam packages now uses the ExDocs search data model, |
| 12 | + allowing for global indexing of Gleam packages in HexDocs, and |
| 13 | + making Gleam packages discoverable through global search of HexDocs. |
| 14 | + ([Diemo Gebhardt](https://github.com/diemogebhardt)) |
97 | 15 |
|
98 |
| - ``` |
99 |
| - error: Syntax error |
100 |
| - ┌─ /src/parse/error.gleam:3:5 |
101 |
| - │ |
102 |
| - 3 │ name: String, |
103 |
| - │ ^^^^ I was not expecting this |
| 16 | +- Allow users to set the `GLEAM_CACERTS_PATH` environment variable to specify a |
| 17 | + path to a directory containing CA certificates to install Hex packages. |
| 18 | + ([winstxnhdw](https://github.com/winstxnhdw)) |
104 | 19 |
|
105 |
| - Each custom type variant must have a constructor: |
106 |
| -
|
107 |
| - pub type User { |
108 |
| - User( |
109 |
| - name: String, |
110 |
| - ) |
111 |
| - } |
112 |
| - ``` |
113 |
| - |
114 |
| - ([Rahul D. Ghosal](https://github.com/rdghosal)) |
115 |
| - |
116 |
| -- The `<>` string concatenation operator can now be used in constant |
117 |
| - expressions. |
118 |
| - ([Thomas](https://github.com/DeviousStoat)) |
119 |
| - |
120 |
| -- Function calls are now fault tolerant. This means that errors in the function |
121 |
| - call arguments won't stop the rest of the call from being analysed. |
122 |
| - ([Ameen Radwan](https://github.com/Acepie)) |
123 |
| - |
124 |
| -- The error message presented when a function is called in a guard has been |
125 |
| - improved. |
126 |
| - ([Thomas](https://github.com/DeviousStoat)) |
127 |
| - |
128 |
| -- Case expressions are now fault tolerant. This means an subject, pattern, |
129 |
| - guard, or then body can be properly detected and won't invalidate the rest |
130 |
| - of the expression. |
131 |
| - ([Ameen Radwan](https://github.com/Acepie)) |
132 |
| - |
133 |
| -- Documentation comments that come before a regular comment are no longer |
134 |
| - clumped together with the documentation of the following definition. |
135 |
| - Now commenting out a definition won't result in its documentation merging with |
136 |
| - the following one's. |
137 |
| - |
138 |
| - ```gleam |
139 |
| - /// This doc comment will be ignored! |
140 |
| - // a commented definition |
141 |
| - // fn wibble() {} |
142 |
| -
|
143 |
| - /// Wibble's documentation. |
144 |
| - fn wibble() { todo } |
145 |
| - ``` |
146 |
| - |
147 |
| - ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) |
148 |
| - |
149 |
| -- The `little` and `big` endianness options, the `signed` and `unsigned` integer |
150 |
| - options, and sized floats (32-bit and 64-bit), can now be used in bit array |
151 |
| - expressions and patterns on the JavaScript target. |
152 |
| - ([Richard Viney](https://github.com/richard-viney)) |
153 |
| - |
154 |
| -- The `utf8` option can now be used with constant strings in bit array patterns |
155 |
| - on the JavaScript target. |
156 |
| - ([Richard Viney](https://github.com/richard-viney)) |
| 20 | +### Language server |
157 | 21 |
|
158 | 22 | ### Formatter
|
159 | 23 |
|
160 |
| -- The formatter will no longer move a documentation comment below a regular |
161 |
| - comment following it. This snippet of code is left as it is by the formatter: |
162 |
| - |
163 |
| - ```gleam |
164 |
| - /// This doc comment will be ignored! |
165 |
| - // a commented definition |
166 |
| - // fn wibble() {} |
167 |
| -
|
168 |
| - /// Wibble's documentation. |
169 |
| - fn wibble() { |
170 |
| - todo |
171 |
| - } |
172 |
| - ``` |
173 |
| - |
174 |
| - While previously all documentation comments would be merged together into one, |
175 |
| - ignoring the regular comment separating them: |
176 |
| - |
177 |
| - ```gleam |
178 |
| - // a commented definition |
179 |
| - // fn wibble() {} |
180 |
| -
|
181 |
| - /// This doc comment will be ignored! |
182 |
| - /// Wibble's documentation. |
183 |
| - fn wibble() { |
184 |
| - todo |
185 |
| - } |
186 |
| - ``` |
187 |
| - |
188 |
| - ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) |
189 |
| - |
190 |
| -### Language Server |
191 |
| - |
192 |
| -- The language server can now show completions for fields if a record access is |
193 |
| - being attempted. |
194 |
| - ([Ameen Radwan](https://github.com/Acepie)) |
195 |
| - |
196 |
| -- The language server will now insert a blank line before the first statement |
197 |
| - when inserting a new import and there are no other imports at the top of the |
198 |
| - module. |
199 |
| - ([Zhomart Mukhamejanov](https://github.com/Zhomart)) |
200 |
| - |
201 |
| -- The language server now suggests a code a action to rename variables, types |
202 |
| - and functions when they don't match the Gleam naming requirements: |
203 |
| - |
204 |
| - ```gleam |
205 |
| - let myNumber = 10 |
206 |
| - ``` |
207 |
| - |
208 |
| - Becomes: |
209 |
| - |
210 |
| - ```gleam |
211 |
| - let my_number = 10 |
212 |
| - ``` |
213 |
| - |
214 |
| - ([Surya Rose](https://github.com/gearsdatapacks)) |
215 |
| - |
216 |
| -- The language server can now suggest a code action to convert `let assert` into |
217 |
| - a case expression: |
218 |
| - |
219 |
| - ```gleam |
220 |
| - let assert Ok(value) = get_result() |
221 |
| - ``` |
222 |
| - |
223 |
| - Becomes: |
224 |
| - |
225 |
| - ```gleam |
226 |
| - let value = case get_result() { |
227 |
| - Ok(value) -> value |
228 |
| - _ -> panic |
229 |
| - } |
230 |
| - ``` |
231 |
| - |
232 |
| - ([Surya Rose](https://github.com/gearsdatapacks)) |
233 |
| - |
234 |
| -- The language server can now show signature help when writing functions. |
235 |
| - ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) |
236 |
| - |
237 |
| -- The language server now supports listing document symbols, such as functions |
238 |
| - and constants, for the current Gleam file. |
239 |
| - ([PgBiel](https://github.com/PgBiel)) |
240 |
| - |
241 |
| -- The language server can now suggest a code action to automatically use |
242 |
| - shorthand labels where possible: |
243 |
| - |
244 |
| - ```gleam |
245 |
| - case date { |
246 |
| - Day(day: day, month: month, year: year) -> todo |
247 |
| - } |
248 |
| - ``` |
249 |
| - |
250 |
| - Becomes: |
251 |
| - |
252 |
| - ```gleam |
253 |
| - case date { |
254 |
| - Day(day:, month:, year:) -> todo |
255 |
| - } |
256 |
| - ``` |
257 |
| - |
258 |
| - ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) |
259 |
| - |
260 |
| -- The language server can now show completions for labels when writing a |
261 |
| - function call or record construction. |
262 |
| - ([Ameen Radwan](https://github.com/Acepie)) |
263 |
| - |
264 |
| -- The language server can now suggest a code action to fill in the labels of a |
265 |
| - function call: |
266 |
| - |
267 |
| - ```gleam |
268 |
| - pub type Date { |
269 |
| - Date(year: Int, month: Int, day: Int) |
270 |
| - } |
271 |
| -
|
272 |
| - pub fn main() { |
273 |
| - Date() |
274 |
| - } |
275 |
| - ``` |
276 |
| - |
277 |
| - Becomes: |
278 |
| - |
279 |
| - ```gleam |
280 |
| - pub type Date { |
281 |
| - Date(year: Int, month: Int, day: Int) |
282 |
| - } |
283 |
| -
|
284 |
| - pub fn main() { |
285 |
| - Date(year: todo, month: todo, day: todo) |
286 |
| - } |
287 |
| - ``` |
288 |
| - |
289 |
| - ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) |
290 |
| - |
291 |
| -- Completions are now sorted by priority based on why the completion is in the |
292 |
| - list. This means that more specific completions like labels and local |
293 |
| - definitions will be shown before more broad completions like functions from a |
294 |
| - not yet imported module. |
295 |
| - ([Ameen Radwan](https://github.com/Acepie)) |
296 |
| - |
297 |
| -### Bug Fixes |
298 |
| - |
299 |
| -- Functions, types and constructors named `module_info` are now escaped |
300 |
| - in generated Erlang code to avoid conflicts with the builtin |
301 |
| - `module_info/0` and `module_info/1` functions. |
302 |
| - ([Juraj Petráš](https://github.com/Hackder)) |
303 |
| - |
304 |
| -- Fixed formatting of comments at the start of a case branch. |
305 |
| - ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) |
306 |
| - |
307 |
| -- Fixed a bug where a private type could be leaked from an internal module. |
308 |
| - ([Ameen Radwan](https://github.com/Acepie)) |
309 |
| - |
310 |
| -- Fixed a bug where certain binops would not wrap their arguments properly |
311 |
| - thus generating invalid JavaScript. |
312 |
| - ([Ameen Radwan](https://github.com/Acepie)) |
313 |
| - |
314 |
| -- Fixed formatting of function definitions marked as `@internal` |
315 |
| - ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) |
316 |
| - |
317 |
| -- Fixed a bug where importing a record constructor in an unqualified fashion and |
318 |
| - aliasing it and then using it in a case guard expression would generate |
319 |
| - invalid JavaScript. |
320 |
| - ([PgBiel](https://github.com/PgBiel)) |
321 |
| - |
322 |
| -## v1.3.2 - 2024-07-11 |
323 |
| - |
324 |
| -### Language Server |
325 |
| - |
326 |
| -- The language server no longer shows completions when inside a literal string. |
327 |
| - ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) |
328 |
| - |
329 |
| -### Bug Fixes |
330 |
| - |
331 |
| -- Fixed a bug where the compiler would report errors for duplicate `@external` |
332 |
| - attributes with inconsistent spans between Erlang and JavaScript. |
333 |
| - ([Connor Szczepaniak](https://github.com/cszczepaniak)) |
334 |
| - |
335 |
| -- Fixed a bug where `gleam add` would fail to parse version specifiers |
336 |
| - correctly. |
337 |
| - ([Louis Pilfold](https://github.com/lpil)) |
338 |
| - |
339 |
| -- Fixed a bug where single clause case expressions could generate JavaScript |
340 |
| - code with incorrectly rewritten JavaScript variable names. |
341 |
| - ([Louis Pilfold](https://github.com/lpil)) |
342 |
| - |
343 |
| -## v1.3.1 - 2024-07-10 |
344 |
| - |
345 |
| -### Bug Fixes |
346 |
| - |
347 |
| -- Fixes a bug with import cycle detection when there is more than 2 imports in |
348 |
| - the cycle. |
349 |
| - ([Ameen Radwan](https://github.com/Acepie)) |
| 24 | +### Bug fixes |
0 commit comments