entel-me / entel

A platform to share your needs
https://entel.me
GNU General Public License v2.0
8 stars 4 forks source link

Upgrade blitz: 0.33.1 → 0.34.3 (major) #100

Closed depfu[bot] closed 3 years ago

depfu[bot] commented 3 years ago

Welcome to Depfu 👋

This is one of the first three pull requests with dependency updates we've sent your way. We tried to start with a few easy patch-level updates. Hopefully your tests will pass and you can merge this pull request without too much risk. This should give you an idea how Depfu works in general.

After you merge your first pull request, we'll send you a few more. We'll never open more than seven PRs at the same time so you're not getting overwhelmed with updates.

Let us know if you have any questions. Thanks so much for giving Depfu a try!


Here is everything you need to know about this upgrade. Please take a good look at what changed and the test results before merging this pull request.

What changed?

✳️ blitz (0.33.1 → 0.34.3) · Repo

Release Notes

0.34.3

🐞 Patches

  • Throw an error if using a query with useMutation or a mutation with useQuery: #2223
  • Fix npm/yarn version auditing: #2247
  • Remove beta warning from CLI because it makes people get the wrong impression: #2250
  • Fix useQuery infinite loop after logout: #2249
  • Fix blitz console circular dependency issues: #2251
  • Fix blitz console queries & mutations not loading: #2252
  • Fix blitz generate generating pages with bad links: #2245

Internal Meta Changes

Credits

Huge thanks to @Mokshit06 and @malkomalko for helping!

0.34.1

🐞 Patches

  • Fix Routes manifest type error. Change to string to string | number: #2228
  • Fix type issues with Routes manifest: #2238
  • Export BlitzApiHandler type: #2239

Internal Meta Changes

Credits

Huge thanks to @JuanM04 for helping!

0.34.0

💥 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

🐞 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 to global.d.ts: #2205
  • Add .editorconfig and .vscode extension recomendations: #2142
  • Upgrade dependencies: #2176
  • Fix husky scripts to use npx for binaries instead of npm run: #2213

Internal Meta Changes

Credits

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

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.


Depfu Status

Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.

All Depfu comment commands
@​depfu rebase
Rebases against your default branch and redoes this update
@​depfu recreate
Recreates this PR, overwriting any edits that you've made to it
@​depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@​depfu close
Closes this PR and deletes the branch
@​depfu reopen
Restores the branch and reopens this PR (if it's closed)
@​depfu pause
Ignores all future updates for this dependency and closes this PR
@​depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@​depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)