Skip to content

Releases: roc-lang/basic-webserver

0.13.0

05 Sep 11:47
6ce8f7b

Choose a tag to compare

docs

examples

Roc syntax to use this platform:

app [Model, init!, respond!] { web: platform "https://github.com/roc-lang/basic-webserver/releases/download/0.13.0/fSNqJj3-twTrb0jJKHreMimVWD7mebDOj0mnslMm2GM.tar.br" }

🆕 Additions

💥 Breaking Changes

  • Cmd API overhaul (see upgrade guide below) #145
  • Http.send! now returns a Result
  • Changed Env.VarNotFound to Env.VarNotFound(Str) #146
  • Renamed FieldNotFound to NoSuchField in SqlDecordeErr
  • Tcp.ConnectErr now takes a type variable parameter to allow for error accumulation #131

✨ Imrovements

🐛 Fixes

  • Fix undefined symbols for functions with missing implementations #125
  • Url.append fix #128
  • Fixed Sqlite segmentation fault #110

Other Notable Changes

  • Update rust dependencies #101 #121
  • CI check to verify if common files are in sync with basic-cli #139

Full Changelog: 0.12.0...0.13.0

Contributors ❤️

In alphabetical order:

Cmd Upgrade Guide

Cmd.status! was commonly used when you just wanted to execute a Cmd without needing to process the output.
We now have the better named Cmd.exec_cmd! for this purpose.
The type of Cmd.status! also delivered the impression that it it could return non-zero exit codes like Ok(1), when this was not actually the case. I've regularly seen code where people checked if the exit code returned by status was 0, if you did, you can get rid if that now :) . If you actually want to take action based on the specific non-zero exit code (which is rarely needed), you can now use Cmd.exec_exit_code.

For all exec... functions, we now use Result in a more logical way, if the command had a 0 exit code, it will return with Ok(...). If not, you will get a specific error that will show useful info on Inspect.to_str. Perfect for error handling in hobby programs.

If you previously used Cmd.output!, you should most likely replace that with Cmd.exec_output!. Note the different output type, it should help simplify output and error handling.

0.12.0

28 Jan 16:16
18db32a

Choose a tag to compare

docs

examples

Roc syntax to use this platform:

app [Model, init!, respond!] { pf: platform "https://github.com/roc-lang/basic-webserver/releases/download/0.12.0/Q4h_In-sz1BqAvlpmCsBHhEJnn_YvfRRMiNACB_fBbk.tar.br" }

Breaking changes

Contributors ❤️

In alphabetical order:

Full Changelog: 0.11.0...0.12.0

0.11.0

28 Dec 16:41
0408266

Choose a tag to compare

examples

Roc syntax to use this platform:

app [Model, init!, respond!] { pf: platform "https://github.com/roc-lang/basic-webserver/releases/download/0.11.0/yWHkcVUt_WydE1VswxKFmKFM5Tlu9uMn6ctPVYaas7I.tar.br" }

Breaking Changes

  • Rename all functions to snake_case #84
  • Upgrade to purity inference #84

Full Changelog: 0.10.0...0.11.0

Migration guide

  • ! is now part of the function name of effectful functions (= all platform functions), it is no longer syntax sugar for Task.await.

  • I recommend taking a look at the changes in the hello-web example and copying them for your use case

  • All basic-webserver functions have changed to snake_case naming.

  • Task is no longer needed, you can switch to using Result, => is used in the type of a function if it is effectful. Change:

    • Task.ok to Ok
    • Task.err to Err
    • Task to Result
    • Task.loop to a recursive function
    • Example with => :
    rocVersionCheck : Task {} _
    rocVersionCheck =

    To:

    rocVersionCheck! : {} => Result {} _
    rocVersionCheck! = \{} ->
  • We recommend the use of the try keyword:

    • replace Stdout.line! "hello" with try Stdout.line! "hello"
    • use it instead of Task.await

Feel free to suggest additions to the migration guide!

0.10.0

28 Nov 19:03
d1de8c3

Choose a tag to compare

⚠️ This release requires a version of Roc released on November 29 2024 or later.

examples

Roc syntax to use this platform:

app [main] { pf: platform "https://github.com/roc-lang/basic-webserver/releases/download/0.10.0/BgDDIykwcg51W8HA58FE_BjdzgXVk--ucv6pVb_Adik.tar.br" }

Breaking Changes

  • Reordered the arguments of File.write, File.writeBytes and File.writeUtf8 #78
  • Added support for http extension methods #76
  • Roc Str.split and List.split updates #79

Other Changes

  • build.roc script now uses basic-cli 0.17.0 #79
  • Using the new Roc string interpolation syntax #75

New Contributors

Full Changelog: 0.9.0...0.10.0

0.9.0

31 Aug 13:33
0.9.0
b59126f

Choose a tag to compare

⚠️ This release requires a version of Roc released on August 31 2024 or later.

examples

Roc syntax to use this platform:

app [main] { pf: platform "https://github.com/roc-lang/basic-webserver/releases/download/0.9.0/taU2jQuBf-wB8EJb0hAkrYLYOGacUU5Y9reiHG45IY4.tar.br" }

What's Changed

  • Use builtin Task #58
  • added multipart/form-data parsing #70

Full Changelog: 0.8.0...0.9.0

Upgrade Notes

Task is now builtin in Roc, to upgrade to this release you probably just need to remove Task imports like this one:

import pf.Task exposing [Task]

0.8.0

23 Aug 15:56
0.8.0
63e3b7a

Choose a tag to compare

⚠️ This release requires a version of Roc released on August 23 and August 31 2024.

examples

Roc syntax to use this platform:

app [Model, server] {
     pf: platform "https://github.com/roc-lang/basic-webserver/releases/download/0.8.0/jz2EfGAtz_y06nN7f8tU9AvmzhKK-jnluXQQGa9rZoQ.tar.br"
}

What's Changed

  • Replaced deprecated backpassing #69

Full Changelog: 0.7.0...0.8.0

0.7.0

12 Aug 17:18
0.7.0
e84f792

Choose a tag to compare

What's Changed

  • Refactor host files into crates in #54
  • Change platform API to include init and respond #64

Full Changelog: 0.6.0...0.7.0

0.6.0

27 Jul 18:52
0.6.0
ed8ba5f

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 0.5.0...0.6.0

0.5.0

07 May 11:48
8b2a4cc

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 0.4.0...0.5.0

0.4.0

15 Apr 10:13
39b3999

Choose a tag to compare

⚠️ This release requires a version of Roc released on April 15 2024 or later.

⚠️ On linux, it's now necessary to use --linker=legacy when using this platform. For example: roc webApp.roc --linker=legacy. See roc-lang/roc#3609 for more info.

Breaking changes

  • New record decoding signature (#45)

Misc changes

  • flake lock update (#44)

Full Changelog: 0.3.0...0.4.0