Lamdera Alpha12 is now available!
https://dashboard.lamdera.app/docs/download
Note: You will need to run lamdera reset
to clear all Elm & Lamdera related caches, this is a major release!
Here's what's new:
File
type in Frontend messageselm-format
all the things!The Lamdera Wire feature is now completely Bytes
based, meaning it's faster (no conversions to/from base64 + json).
It's also smaller. For example, this custom type value:
Lamdera.sendToBackend RenewSession
Has evolved in wire like so:
FkxvZ1BhZ2VWaWV3CkFkbWlu
24B value + 21B wrapper (not shown) = 45 BytesAgA=
4B value + 21B wrapper (not shown) = 25 BytesȂ
: 1B value + 2B wrapper = 3 Bytes!Lamdera's wire encoding is now likely as small as it theoretically can be (short of bitwise encoding, which would tradeoff decoder performance).
A bug was also fixed that caused decode failures when record types had their field ordering changed but without any type changes.
Local development on Lamdera was already fast, and now it should feel noticeably even faster!
lamdera live
now intelligently recompiles your project in memory and serves from cache to all windows.
lamdera live
will now try to detect when you are making a Backend HTTP request, and automatically proxy it through the new inbuilt CORS proxy. This makes the out-of-the-box lamdera live
experience even closer to production behavior.
There are still some situations where this detection might fail (in particular Task.andThen
chains), so don't throw away your CORS browser plugin just yet!
See the CORS note for more details.
File
type in Frontend messagesLamdera enforces Wire-compatible types in all core types, which prevents usage of types which cannot be both serialized and deserialized.
One such type was File
, which is backed by the File Web API, which disallows construction for security reasons (it would be bad if one could construct a File refrence to any file on a user's actual system!).
File
is now supported in wire, but in FrontendMsg
types only. This means the key elm/file
file
function;
file : List String -> (File -> msg) -> Cmd msg
can now be used. This allows you to then use toBytes
to convert to Bytes
if you wish to use those file contents in a sendToBackend
.
Evergreen migrations will also automatically work if a user happens to be selecting a file just as a frontend migration is in progress.
elm-format
all the things!Lamdera will now try to detect if you've got elm-format
installed, and if you do, apply it to all Lamdera generated code.
If you haven't checked out elm-format
yet, you really should!
lamdera check
would fail, and spitefully mess up some of your imports on the way out. No more!lamdera live
, sometimes there would be locking errors on hot reload as they all tried to recompile together. They now all use the new caching system.src/Evergreen
and not running lamdera check
. This will now get caught in the deploy stage with a less confusing error.lamdera
in a non-git folder, these are now kinder.lamdera --version
output is now adjusted to play nicely with elm-review
.lamdera check
time.As always, feedback and questions are welcome in our friendly Discord community!