Yash Sonalia
Yash Sonalia

Reputation: 398

I want to extend React-Query support on old browsers without manually testing my Next application on the said old browsers

I found this quote on the installation page but I don't understand the approach they want me to take:

"Depending on your environment, you might need to add polyfills. If you want to support older browsers, you need to transpile the library from node_modules yourselves."

You can check it here

I compared the default suppoted browers listed here vs. the release dates of those versions and would like to extend my application's support for browsers, ideally 5 and upto 10 years old.

Default React query browser support:

Chrome >= 73
Firefox >= 78
Edge >= 79
Safari >= 12.0
iOS >= 12.0
opera >= 53

I am currently using

So far I have tried following the SWC documentation for browser support: docs

Upvotes: 1

Views: 1179

Answers (2)

Omar Khorshid
Omar Khorshid

Reputation: 1

From my simple understanding, this shouldn't be an issue, as it all depends on your environment/bundler (webpack in this case). so it's as good as your webpack configuration.

Upvotes: 0

Yousria
Yousria

Reputation: 1

I was running into the same issue but with different versions :

  • TanStack Query v5
  • Next.js v14 (SWC)

you can use this config in next.config.js :

transpilePackages: ['@tanstack/query-core', ...any other package that is breaking on old browsers]

this will transpile and bundle the dependencies you provide from local packages according to Nextjs documentation

Hope it helps!

Upvotes: 0

Related Questions