Mini migration guide: 0.8.4 #73
pilcrowonpaper
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Make sure to use v0.8.5!
Since 0.8.4 introduces a lot of breaking changes, I thought I might write a mini-migration guide as well as some context behind the changes.
Hooks
Hooks no longer handle tokens and play a (super) vital role in Lucia, so it's now renamed to handleHooks. I also thought it's more natural to call a function than just reference it.
Load functions
This is where a lot of the changes happened.
Root layout server load function
Load functions
No more waiting for
parent()
! ...kinda. On a server context,getSession()
waits for the parent load function (similar as before) but in a browser context, it now won't, allowing you to run load functions in parallel in certain context! You can still callawait parent()
inside it as well, it's just a normal load function with added params.Supports multiple load functions too (same for the server version):
Server load functions
Server load functions are similar to normal load functions, except that
getSession()
will not wait for the parent load function.Set cookies
With the recent changes to SvelteKit, cookies can only be set with
cookies
instead ofsetHeaders
in actions.Client
No more wrapper component!
Silent refresh
Only needed in the root layout component (no
onMount()
needed!).Get session store
Unlike before,
getSession()
doesn't have to called inside the wrapper component.Other small changes are listed in the changelog.
Beta Was this translation helpful? Give feedback.
All reactions