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
queryis now aURLSearchParaminstance (same asurl.searchParams) - Added
cacheControlto simplify cache-control response headers.
Renamed Adaptors🇬🇧 to Adapters🇺🇸
- Renamed to adapt
er for consistency. (No offense 🇬🇧, we still love ya) - The adapt
or 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
adaptorsdirectory toadapters, and update the scripts inpackage.jsonthat 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
ssgconfig 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
dangerouslySetInnerHTMLby @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