Server Loaders and Actions
- Previous iterations of loading data recommended using request handlers directly.
- The server loaders/action updates simplifies the connection between fetching data, rendering data, and submitting an update with an action.
- See the docs for more information.
Request Handlers
- Added
html()
json()
text()
andsend()
for simple HTTP response body content. - Added
getWritableStream()
to the Request event for low-level access to HTTP response streaming. - Request event’s
query
is now aURLSearchParam
instance (same asurl.searchParams
) - Added
cacheControl
to simplify cache-control response headers.
Renamed Adaptors🇬🇧
to Adapters🇺🇸
- Renamed to adapt
e
r for consistency. (No offense 🇬🇧, we still love ya) - The adapt
o
r name is deprecated and will continue to be provided until v1 is released. - This includes the package names, function names, and types.
- Rename your root
adaptors
directory toadapters
, and update the scripts inpackage.json
that call the Vite configs, such asbuild.server
.
"scripts": {
"build.server": "vite build -c adapters/static/vite.config.ts"
}
Static Site Generation (SSG) and SSR Adapters
- When building sites with server-side rendering (SSR), such as deploying a site to Netlify or Cloudflare, we also automatically generated pages that could be static. This was problematic and caused unpredictable behavior at times.
- Instead of auto-generating SSG pages, there’s a new
ssg
config for each adapter where you can optionally include (and exclude) pathnames and patterns which urls should always be static generated. - Static Site Generation from SSR Adapters is now opt-in, but starters will come preset with the homepage
/
included to be SSG’d.
// example adapter plugin
netifyEdgeAdapter({
ssg: {
include: ["/"],
},
})
What's Changed
- fix: package.json type field setting error by @cunzaizhuyi in #2824
- Added new site to showcase room by @adnanebrahimi in #2833
- docs: pnpm link --global by @cunzaizhuyi in #2832
- fix: misc loaders fixes by @manucorporat in #2840
- fix: misc loader fixes by @manucorporat in #2842
- fix: reactivity of store keys by @manucorporat in #2843
- fix: optimize prop shorthand by @manucorporat in #2844
- fix: dev-server menu.md rendering by @adamdbradley in #2847
- fix: spa context serialization by @manucorporat in #2845
- 0.17.5 by @manucorporat in #2846
- Suppress error of service worker at http connections. by @genki in #2853
- docs: add
<RenderOnce>
by @zanettin in #2848 - fix: docs invalid code by @manucorporat in #2858
- feat: global platform interface by @manucorporat in #2856
- refactor: rename adaptors to adapters by @adamdbradley in #2851
- chore: fix deploy env var by @adamdbradley in #2861
- docs: server functions by @manucorporat in #2722
- docs: add
<RenderOnce>
REVERT by @zanettin in #2863 - docs: add
dangerouslySetInnerHTML
by @zanettin in #2452 - 🔋 by @manucorporat in #2866
- fix(azure-swa): azure SWA request handling and generation of function.json by @derkoe in #2868
New Contributors
- @adnanebrahimi made their first contribution in #2833
- @genki made their first contribution in #2853
Full Changelog: v0.17.4...v0.17.5