github blitz-js/blitz v0.34.0-canary.0

latest releases: blitz@2.0.0-alpha.26, @blitzjs/rpc@2.0.0-alpha.26, @blitzjs/next@2.0.0-alpha.26...
pre-release13 months ago

💥 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

  • Ability to prefetch queries on the server

🐞 Patches

  • Fix query string spaces with useRouterQuery(): #2174
  • Fix shallow routing: #2173

⚡️ Changes to the New App Template

  • Add .editorconfig and .vscode extension recomendations: #2142
  • Upgrade dependencies: #2176

👩‍🍳 Recipes

  • Fix quirrel install recipe: #2170
  • Remove prisma 2.19 version upgrade from GQL recipe: #2167

Internal Meta Changes

Credits

Huge thanks to @tundera, @JuanM04, @sakulstra, @Roesh, @MrLeebo, @wKovacs64, and @kevinlangleyjr for helping!

Don't miss a new blitz release

NewReleases is sending notifications on new releases.