💥 Breaking Changes
- Upgrade to React Query v3: #2101
In _app.tsx
// _app.tsx
ErrorFallbackProps,
+ useQueryErrorResetBoundary,
} from "blitz"
-import {queryCache} from "react-query"
...
- onReset={() => {
- // This ensures the Blitz useQuery hooks will automatically refetch
- // data any time you reset the error boundary
- queryCache.resetErrorBoundaries()
- }}
+ onReset={useQueryErrorResetBoundary().reset}
Uses of useInfiniteQuery
- const [groupedProducts, {isFetching, isFetchingMore, fetchMore, canFetchMore}] = useInfiniteQuery(
+ const [groupedProducts, {isFetching, isFetchingNextPage, fetchNextPage, hasNextPage}] = useInfiniteQuery(
getProducts,
(page = {take: 3, skip: 0}) => page,
{
- getFetchMore: (lastGroup) => lastGroup.nextPage,
+ getNextPageParam: (lastGroup) => lastGroup.nextPage,
},
)
In test/utils.tsx
-import {RouterContext, BlitzRouter} from "blitz"
+import {RouterContext, BlitzRouter, BlitzProvider} from "blitz"
...
export function render(/*...*/) {
+<BlitzProvider>
<RouterContext.Provider value={{...mockRouter, ...router}}>{children}</RouterContext.Provider>
+</BlitzProvider>
...
export function renderHook(/*...*/) {
+<BlitzProvider>
<RouterContext.Provider value={{...mockRouter, ...router}}>{children}</RouterContext.Provider>
+</BlitzProvider>
If you were previously importing and using queryCache
from react-query
directly:
-import {queryCache} from "react-query"
+import {queryClient} from "blitz"
-queryCache.clear()
+queryClient.clear()
🚀 New Features
- 🎉 Add autogenerated
Routes
manifest for use with<Link>
components: #2042
// You can import `Routes`
import { Link, Routes } from "blitz"
// And then use it for robust, fully typed links
<Link href={Routes.SignupPage()} />
<Link href={Routes.ProductsPage({ productId: 123 })} />
- Upgrade our nextjs fork to 10.1.3: #2186
- Ability to prefetch queries on the server
- Read the docs
- This API is not elegant, but we'll improve it
🐞 Patches
- Fix query string spaces with
useRouterQuery()
: #2174 - Fix shallow routing: #2173
- Change Blitz to use our nextjs fork (no internal changes besides using our own build): #2122
- Fix "Failed to load config in getConfig" log message: #2220
- Fix crash when using Blitz inside iframes: #2219
- Send anonymous analytics to to blitz collector instead of nextjs: #2224
⚡️ Changes to the New App Template
- Rename
types.d.ts
toglobal.d.ts
: #2205 - Add
.editorconfig
and.vscode
extension recomendations: #2142 - Upgrade dependencies: #2176
- Fix husky scripts to use
npx
for binaries instead ofnpm run
: #2213
Internal Meta Changes
- added @andrearizzello as contributor: cc7c72d
- Update findModuleExportsExpressions installer transform utility: #2155
- Update Emotion recipe to better leverage the installer package: #2156
- Switch to using @blitz/installer helper functions …: #2164
- fix ultra scripts so they work on Windows: #2154
- updated @konradkalemba contributions: 1d4695a
- updated @tundera contributions: 563720b
- updated @tundera contributions: af53933
- add userTrack as seedling sponsor: a3737af
- added @jahredhope as contributor: 3c3f10b
- Add new integration test harness: #2189
- Add first blitz integration test for useQuery: #2193
- Add integration test for invalidateQuery: #2194
- added @simonelnahas as contributor: 5fc813a
- added @Cristy94 as contributor: e1276f9
- Fix integration test types and fix nextjs pnpm test: #2212
- added @peterpalau as contributor: 8de8202
- added @sean-brydon as contributor: a8b3794
- Retire a number of maintainers that haven't been active in long time: f861dd6
- added @Dieman89 as contributor: 2136ab7
- added @laubonghaudoi as contributor: 03ebcb9
- updated @sakulstra contributions: 61d11e4
Credits
Huge thanks to @tundera, @Skn0tt, @JuanM04, @sakulstra, @mtford90, @peterpalau, @Roesh, @MrLeebo, @wKovacs64, and @kevinlangleyjr for helping!