258 KiB
@refinedev/core
4.56.0
Minor Changes
-
#6445
4ff4335274d5689ec62127312695b76d692a125aThanks @alicanerdurmaz! - feat: added new prop calledmutationVariablesto<AuthPage />. #6431 From now on, you can pass additional parameters to theauthProvidermethods using themutationVariablesprop of the<AuthPage />component.import { AuthPage } from "@refinedev/antd"; // or "@refinedev/chakra-ui", "@refinedev/mantine", "@refinedev/mui" const MyLoginPage = () => { return ( <AuthPage type="login" // all other types are also supported. // highlight-start mutationVariables={{ foo: "bar", xyz: "abc", }} // highlight-end /> ); }; // all mutation methods are supported. const authProvider = { login: async ({ foo, xyz, ...otherProps }) => { console.log(foo); // bar console.log(xyz); // abc // ... }, register: async ({ foo, xyz, ...otherProps }) => { console.log(foo); // bar console.log(xyz); // abc // ... }, // ... }; -
#6445
4ff4335274d5689ec62127312695b76d692a125aThanks @alicanerdurmaz! - feat: exported useInvalidateAuthStore hook from auth hooksNow you can invalide the users identity state and force a react query refresh using this hook
Resolves #6341
-
#6445
4ff4335274d5689ec62127312695b76d692a125aThanks @alicanerdurmaz! - feat: AddedMetaContextto share data between components, providers, and hooks.🚨 Designed for internal use only.
Patch Changes
-
#6445
4ff4335274d5689ec62127312695b76d692a125aThanks @alicanerdurmaz! - fix: Added more flexibility to the<Link />component'sreftype by changing it fromHTMLAnchorElementtoElement. From now on, we can pass any type ofrefto the<Link />component.// Before fix - Only worked with HTMLAnchorElement const ref = useRef<HTMLAnchorElement>(null); // After fix - Works with any Element type const ref = useRef<HTMLDivElement>(null); const ref = useRef<HTMLSpanElement>(null);Resolves #6463
-
#6445
4ff4335274d5689ec62127312695b76d692a125aThanks @alicanerdurmaz! - fix: Priority logic betweentoandgoprops inLinkcomponent. From now on, thetoprop has priority over thegoprop. If both are passed, thetoprop will be used.// Before fix - go would override to <Link to="/posts" go={{ resource: "categories" }} /> // After fix - to overrides go <Link to="/posts" go={{ resource: "categories" }} />Resolves #6461
4.55.0
Minor Changes
-
#6330
5a81b35bc1eedbecb4b6c531a2fa5235dd0caf31Thanks @alicanerdurmaz! - feat: add<Link />component to navigate to a resource with a specific action. Under the hood, It usesuseGoto generate the URL.Usage
import { Link } from "@refinedev/core"; const MyComponent = () => { return ( <> {/* simple usage, navigates to `/posts` */} <Link to="/posts">Posts</Link> {/* complex usage with more control, navigates to `/posts` with query filters */} <Link go={{ query: { // `useTable` or `useDataGrid` automatically use this filters to fetch data if `syncWithLocation` is true. filters: [ { operator: "eq", value: "published", field: "status", }, ], }, to: { resource: "posts", action: "list", }, }} > Posts </Link> </> ); }; -
#6330
5a81b35bc1eedbecb4b6c531a2fa5235dd0caf31Thanks @alicanerdurmaz! - chore: From now on,useLinkreturns<Link />component instead of returningrouterProvider.Link.Since the
<Link />component usesrouterProvider.Linkunder the hood with leveraginguseGohook to generate the URL there is no breaking change. It's recommended to use the<Link />component from the@refinedev/corepackage instead ofuseLinkhook. This hook is used mostly for internal purposes and is only exposed for customization needs.
Patch Changes
-
#6327
c630b090539082b5166b508053f87274624c794eThanks @Anonymous961! - fix(core): added ability to returnundefinedto fallback to the default notification config when using the function form insuccessNotificationanderrorNotificationprops. -
#6353
a0f2d7bbef3093e11c3024bb7fa2a0ffc3ce9e10Thanks @alicanerdurmaz! - fix: Thelabelandroutefields inuseMenu().menuItemswere marked as deprecated, but they are not actually deprecated. This issue was caused bymenuItemsextending fromIResourceItem, however,menuItemspopulates these fields and handles deprecation of these fields internally. This change removes the deprecation warning for these fields.export const Sider = () => { const { menuItems } = useMenu(); menuItems.map((item) => { // these are safe to use console.log(item.label); console.log(item.route); item.children.map((child) => { // these are safe to use console.log(child.label); console.log(child.route); }); }); return <div>{/* ... */}</div>; }; -
#6386
bfe28f0316b3623aaef0b60ae39ebe24939dd0afThanks @hugorezende! - fix(core): wrapsetFiltersandsetSortersmethods withuseCallbackto prevent looping re-rendersWith this we can use the setFilters as dependencies inside useEffects without infinite loop since state changes in the hook won't cause the functions to be re-assigned
4.54.1
Patch Changes
-
#6260
05b944a75f3a907c0df7b30591a5c5fbbc3cc3f7Thanks @aliemir! - fix(core):useResourceParamsnot reflectingidprop changes immediatelyuseResourceParamshook was not reflecting the changes in theidprop immediately. This was due to theidstate being set in theuseEffecthook. This PR fixes the issue by setting theidstate properly during render rather than after the render is complete. -
#6222
ec24fe0f37aa9b92991bf105719f6f42bb68d63cThanks @Sergio16T! - feat: added support for meta.gqlVariables to hasura dataProvider. Updated GraphQLQueryOptions to include optional field gqlVariables
4.54.0
Minor Changes
-
#6180
292cebc5a70f19400793292b79d1400fec114591Thanks @alicanerdurmaz! - feat:useSelect'squeryResultanddefaultValueQueryResultis deprecated, usequeryanddefaultValueQueryinstead. #6179import { useSelect } from '@refinedev/core'; - const { queryResult, defaultValueQueryResult } = useSelect(); + const { query, defaultValueQuery } = useSelect();✨ You can use
@refinedev/codemodto automatically migrate your codebase. Simply run the following command in your project's root directory:npx @refinedev/codemod@latest rename-query-and-mutation-result -
#6116
7e71f12b81954fd3a59678d7fcccd7b557879a94Thanks @alicanerdurmaz! - feat: Mutation parameters should be given as a prop to theuseUpdatehook. #6102 From now on, you can pass mutation parameters to theuseUpdatehook as a prop.Old usage of
useUpdatehook:import { useUpdate } from "@refinedev/core"; const { mutate } = useUpdate(); mutate( { resource: "products", id: 1, mutationMode: "optimistic", successNotification: false, values: { name: "New Product", material: "Wood", }, }, { onSuccess: () => { /* do something after mutation success */ }, }, );New usage of
useUpdatehook:import { useUpdate } from "@refinedev/core"; const { mutate } = useUpdate({ resource: "products", successNotification: false, mutationMode: "optimistic", mutationOptions: { onSuccess: () => { /* do something after mutation success */ }, }, }); mutate({ // also you can override the parameters given to the hook id: 1, values: { name: "New Product", material: "Wood", }, });You can think of the parameters given to the
useUpdatehook as default values, while the parameters given to themutatefunction are the values used for that specific mutation or dynamic values.🚨 If you pass these parameters to the
mutatefunction, it will override the values given to the hook. -
#6116
7e71f12b81954fd3a59678d7fcccd7b557879a94Thanks @alicanerdurmaz! - feat: Mutation parameters should be given as a prop to theuseCreatehook. #6113 From now on, you can pass mutation parameters to theuseCreatehook as a prop.Old usage of
useCreatehook:import { useCreate } from "@refinedev/core"; const { mutate } = useCreate(); mutate( { resource: "products", values: { name: "New Product", material: "Wood", }, mutationMode: "optimistic", successNotification: false, }, { onSuccess: () => { /* do something after mutation success */ }, }, );New usage of
useCreatehook:import { useCreate } from "@refinedev/core"; const { mutate } = useCreate({ resource: "products", successNotification: false, mutationMode: "optimistic", mutationOptions: { onSuccess: () => { /* do something after mutation success */ }, }, }); mutate({ // also you can override the parameters given to the hook values: { name: "New Product", material: "Wood", }, });You can think of the parameters given to the
useCreatehook as default values, while the parameters given to themutatefunction are the values used for that specific mutation or dynamic values.🚨 If you pass these parameters to the
mutatefunction, it will override the values given to the hook. -
#6172
4967a51944c139d102fcfc04ada5a42c725ed7c2Thanks @alicanerdurmaz! - feat:useTable'stableQueryResultis deprecated, usetableQueryinstead. #6169import { useTable } from '@refinedev/core'; - const { tableQueryResult } = useTable(); + const { tableQuery } = useTable();✨ You can use
@refinedev/codemodto automatically migrate your codebase. Simply run the following command in your project's root directory:npx @refinedev/codemod@latest rename-query-and-mutation-result -
#6164
8ed027eec66c41c444f168f4f52e6b51057bc498Thanks @alicanerdurmaz! - feat:useForm'squeryResultis deprecated, usequeryinstead. #6163import { useForm } from '@refinedev/core'; - const { queryResult } = useForm(); + const { query } = useForm();✨ You can use
@refinedev/codemodto automatically migrate your codebase. Simply run the following command in your project's root directory:npx @refinedev/codemod@latest rename-query-and-mutation-result -
#6116
7e71f12b81954fd3a59678d7fcccd7b557879a94Thanks @alicanerdurmaz! - feat: Mutation parameters should be given as a prop to theuseCreateManyhook. #6114 From now on, you can pass mutation parameters to theuseCreateManyhook as a prop.Old usage of
useCreateManyhook:import { useCreateMany } from "@refinedev/core"; const { mutate } = useCreateMany(); mutate( { resource: "products", values: [ { name: "Product 1", material: "Wood", }, { name: "Product 2", material: "Metal", }, ], mutationMode: "optimistic", successNotification: false, }, { onSuccess: () => { /* do something after mutation success */ }, }, );New usage of
useCreateManyhook:import { useCreateMany } from "@refinedev/core"; const { mutate } = useCreateMany({ resource: "products", successNotification: false, mutationMode: "optimistic", mutationOptions: { onSuccess: () => { /* do something after mutation success */ }, }, }); mutate({ // also you can override the parameters given to the hook values: [ { name: "Product 1", material: "Wood", }, { name: "Product 2", material: "Metal", }, ], });You can think of the parameters given to the
useCreateManyhook as default values, while the parameters given to themutatefunction are the values used for that specific mutation or dynamic values.🚨 If you pass these parameters to the
mutatefunction, it will override the values given to the hook. -
#6174
2b73e40b0e18932f008842790065cdd386e9d270Thanks @alicanerdurmaz! - feat:useShow'squeryResultis deprecated, usequeryinstead. #6173import { useShow } from '@refinedev/core'; - const { queryResult } = useShow(); + const { query } = useShow();✨ You can use
@refinedev/codemodto automatically migrate your codebase. Simply run the following command in your project's root directory:npx @refinedev/codemod@latest rename-query-and-mutation-result -
#6164
8ed027eec66c41c444f168f4f52e6b51057bc498Thanks @alicanerdurmaz! - feat:useForm'smutationResultis deprecated, usemutationinstead. #6163import { useForm } from '@refinedev/core'; - const { mutationResult } = useForm(); + const { mutation } = useForm();✨ You can use
@refinedev/codemodto automatically migrate your codebase. Simply run the following command in your project's root directory:npx @refinedev/codemod@latest rename-query-and-mutation-result -
#6125
61aa3464df0d95c30839726f455ed43e6854730bThanks @Dominic-Preap! - fix: update debounce behavior ononSearchinuseSelectNow debounce behavior is working correctly on
onSearchinuseSelectwhen using insideControllerof react-hook-form.Resolves #6096
-
#6116
7e71f12b81954fd3a59678d7fcccd7b557879a94Thanks @alicanerdurmaz! - feat: Mutation parameters should be given as a prop to theuseUpdateManyhook. #6115 From now on, you can pass mutation parameters to theuseUpdateManyhook as a prop.Old usage of
useUpdateManyhook:import { useUpdateMany } from "@refinedev/core"; const { mutate } = useUpdateMany(); mutate( { resource: "products", values: { name: "New Product", material: "Wood", }, ids: [1, 2, 3], mutationMode: "optimistic", successNotification: false, }, { onSuccess: () => { /* do something after mutation success */ }, }, );New usage of
useUpdateManyhook:import { useUpdateMany } from "@refinedev/core"; const { mutate } = useUpdateMany({ resource: "products", successNotification: false, mutationMode: "optimistic", mutationOptions: { onSuccess: () => { /* do something after mutation success */ }, }, }); mutate({ ids: [1, 2, 3], values: { name: "New Product", material: "Wood", }, // also you can override the parameters given to the hook });You can think of the parameters given to the
useUpdateManyhook as default values, while the parameters given to themutatefunction are the values used for that specific mutation or dynamic values.🚨 If you pass these parameters to the
mutatefunction, it will override the values given to the hook.
Patch Changes
-
#6185
603c73eb7d376fc2357a577f5921f844a8f444e4Thanks @aliemir! - Bump@refinedev/devtools-internaldependency to reflect the latest changes in the Refine Devtools. -
#6224
81703b62bafeb01a75290b99b3869ef96d04bd94Thanks @WananiAdib! - fix(core): fixed type issue in useSelect. #6223Previously, the types would not allow functions to be passed as props. After this change, it will be possible.
-
#6184
1f7976bd32da311367945370efccd7d9c9b102a7Thanks @Sarfraz-droid! - AuthPage in Next.js generates code with i18n but the folder hooks is not created. imported useTranslate from @hooks to fix the issue -
#6116
7e71f12b81954fd3a59678d7fcccd7b557879a94Thanks @alicanerdurmaz! - fix:invalidatesprop ofuseUpdateManydoesn't work. #6209From now on, the
invalidatesprop of theuseUpdateManyhook will work as expected.const { mutate } = useUpdateMany({ resource: "posts", invalidates: ["all"], // invalidates all queries of the "posts" resource }); mutate({ ids: [1, 2, 3], values: { title: "new title" } }); -
#6154
fa2d7a4554da2d5fb2432a011941f9c157b59abaThanks @BatuhanW! - chore(devtools): bump internal devtools dependencyBump
@refinedev/devtools-internalversion. -
Updated dependencies [
ccddff6eba23286d4025a7301de3ebfc24b1b633,603c73eb7d376fc2357a577f5921f844a8f444e4]:- @refinedev/devtools-internal@1.1.14
4.53.0
Minor Changes
-
#6071
853bef97ed7baf59e74c98fc54c0ed11624fb491Thanks @Dominic-Preap! - feat: addselectedOptionsOrderinuseSelectNow with
selectedOptionsOrder, you can sortselectedOptionsat the top of list when useuseSelectwithdefaultValue.Resolves #6061
Patch Changes
-
#5989
b86648f42cd849a506e4c32d740de26b72681f72Thanks @lnikitadobrenkol! - chore(core): add missing types of data hooksAdded missing props and return types of data hooks.
-
#6070
4265ae2509f79af9dbca8d52daf5c2f1b4a50a51Thanks @FatimaSaleem21! - fix(core): add unexported types inindex.tsxThe
refinedev/corepackage has many unexported types that are not accessible for use outside the package. This change aims to address this limitation by exporting those missing types.Resolves #6041
-
#6064
b516c18b828ba8823561d0fefc4afe02b45ce332Thanks @aliemir! - fix(auto-save-indicator): replace reservedkeyprop withtranslationKeyin components<AutoSaveIndicator />components from UI libraries have been using a<Message />component internally that uses akeyprop. Sincekeyis a reserved prop in React, it was causing a warning in the console. This change replaces thekeyprop withtranslationKeyto avoid the warning.Resolves #6067
-
Updated dependencies []:
- @refinedev/devtools-internal@1.1.13
4.51.0
Minor Changes
-
6bd14228760d3e1e205ea9248e427f9afa2ec046Thanks @BatuhanW! - Added ina and nina CrudOperators. Added filtering by these operators to Supabase data provider #5902 -
6bd14228760d3e1e205ea9248e427f9afa2ec046Thanks @BatuhanW! - feat(core): ability to pass global app title and iconAdded ability to pass global app name and icon values through
<Refine />component'soptionsprop.Now
<Refine />component acceptsoptions.titleprop that can be used to set app icon and app name globally. By default these values will be accessible throughuseRefineOptionshook and will be used in<ThemedLayoutV2 />and<AuthPage />components of the UI packages.import { Refine } from "@refinedev/core"; const MyIcon = () => <svg>{/* ... */}</svg>; const App = () => { return ( <Refine options={{ title: { icon: <MyIcon />, text: "Refine App", }, }} > {/* ... */} </Refine> ); };
Patch Changes
-
6bd14228760d3e1e205ea9248e427f9afa2ec046Thanks @BatuhanW! - fix(core): update default titlesPreviously, default titles included lowercase "refine", which was not correct. This commit updates the default titles to include "Refine" instead.
-
6bd14228760d3e1e205ea9248e427f9afa2ec046Thanks @BatuhanW! - refactor: omittoparameter if at root when unauthenticatedIf user is not authenticated,
<Authenticated />redirects to the provided route and appends the current route to thetoparameter. With this change, if the current route is the root (/), thetoparameter will be omitted. -
6bd14228760d3e1e205ea9248e427f9afa2ec046Thanks @BatuhanW! - feat:<GitHubBanner />haspaddingLeft: 200pxby default to make space for the sidebar. This is not needed when the sidebar is not present.From on,
<GitHubBanner />style property can be overridden by passingcontainerStyleprop.<GitHubBanner containerStyle={{ paddingLeft: 0 }} /> -
6bd14228760d3e1e205ea9248e427f9afa2ec046Thanks @BatuhanW! - chore: addedtypequalifier to imports used as type only.- import { A } from "./example.ts"; + import type { A } from "./example.ts"; -
Updated dependencies [
6bd14228760d3e1e205ea9248e427f9afa2ec046,6bd14228760d3e1e205ea9248e427f9afa2ec046]:- @refinedev/devtools-internal@1.1.11
4.50.0
Minor Changes
-
#5945
a39f1952554120893ea83db904037917fc293dc6Thanks @aliemir! - Added ina and nina CrudOperators. Added filtering by these operators to Supabase data provider #5902 -
#5945
903ea231538b00ce02ddc9394c72848ec1e90772Thanks @aliemir! - feat(core): ability to pass global app title and iconAdded ability to pass global app name and icon values through
<Refine />component'soptionsprop.Now
<Refine />component acceptsoptions.titleprop that can be used to set app icon and app name globally. By default these values will be accessible throughuseRefineOptionshook and will be used in<ThemedLayoutV2 />and<AuthPage />components of the UI packages.import { Refine } from "@refinedev/core"; const MyIcon = () => <svg>{/* ... */}</svg>; const App = () => { return ( <Refine options={{ title: { icon: <MyIcon />, text: "Refine App", }, }} > {/* ... */} </Refine> ); };
Patch Changes
-
#5945
208f77177f9821ee1860ffe031e6b2a9645d1bb6Thanks @aliemir! - fix(core): update default titlesPreviously, default titles included lowercase "refine", which was not correct. This commit updates the default titles to include "Refine" instead.
-
#5945
84cac61b84ab872394424ebf358eeb380f40121dThanks @aliemir! - refactor: omittoparameter if at root when unauthenticatedIf user is not authenticated,
<Authenticated />redirects to the provided route and appends the current route to thetoparameter. With this change, if the current route is the root (/), thetoparameter will be omitted. -
#5945
4cc74478cbec8caa3023a50ce62f1d5b2f7158a5Thanks @aliemir! - feat:<GitHubBanner />haspaddingLeft: 200pxby default to make space for the sidebar. This is not needed when the sidebar is not present.From on,
<GitHubBanner />style property can be overridden by passingcontainerStyleprop.<GitHubBanner containerStyle={{ paddingLeft: 0 }} /> -
#5945
90930b381d8d369c63bc59beedf69c391875166dThanks @aliemir! - chore: addedtypequalifier to imports used as type only.- import { A } from "./example.ts"; + import type { A } from "./example.ts"; -
Updated dependencies [
a1e36e6e909a91bc6218478f136b49a8e82a7e32,90930b381d8d369c63bc59beedf69c391875166d]:- @refinedev/devtools-internal@1.1.10
4.49.2
Patch Changes
-
#5928
db9756e7908Thanks @aliemir! - fix: type errors on typescript <5Due to the changes in #5881, typescript users below version 5 are facing type errors. This PR fixes the type errors by updating the file extensions required by the
d.mtsdeclaration files to provide a compatible declarations for both typescript 4 and 5 users. -
Updated dependencies [
db9756e7908]:- @refinedev/devtools-internal@1.1.9
4.49.1
Patch Changes
-
#5875
1c9a95f22abThanks @aliemir! - refactor: add resource name to devtools xray callsAdded the resource name to the devtools xray calls to allow resource names to be displayed in the devtools even with custom query keys.
-
#5883
0a76576da0fThanks @aliemir! - fix: development errors being logged whenuseOnErroris called without an auth providerWhen there's no
authProviderset, theuseOnErrorhook will log"no mutationFn found"to the console in development because of missingonErrorproperty. This PR fixes the issue by providing a dummyonErrorfunction whenauthProvideris not set. -
#5851
8d2dd4376f6Thanks @aliemir! - refactor: prevented early accessingsignalfromuseQueryof@tanstack/react-queryIn query hooks,
signalwas accessed directly by destructuring which was causing issues in development mode with duplicated requests. This change accessesqueryContextinstead of destructuredsignalproperly to prevent@tanstack/react-queryfrom settingabortSignalConsumedflag unexpectedly.Resolves #5843
-
#5875
1c9a95f22abThanks @aliemir! - fix: exclude internal button hook calls from devtools traceRemoved internal button hook calls from devtools trace to avoid crowding the trace with unnecessary information.
-
#5881
ba719f6ea26Thanks @aliemir! - fix: declaration files in node10, node16 and nodenext module resolutions -
#5884
9a0c1c8414aThanks @aliemir! - fix(core):useMenuhideOnMissingParameterprop default value set totrueThere was an error in the
useMenuhook'shideOnMissingParameterprop. Its default value should betruebut it was missed when props are passed partially. This PR fixes the issue by setting the default value totrue. -
Updated dependencies [
1c9a95f22ab,1c9a95f22ab,ba719f6ea26]:- @refinedev/devtools-internal@1.1.8
4.49.0
Minor Changes
-
#5751
f32512b9042Thanks @aliemir! - AddeduseResourceParamshook. This hook initially works similarly touseResourcebut it correctly handles theidandactionparams per active route and explicit parameters. In@refinedev/coreand other Refine packages there was a common logic of handling theidsince its inference is dependent on the active resource and route. The same also applies to theactionparameter of forms. This hook handles these cases and provides a more consistent API to share the same logic without duplicating it.idandactionvalues returned fromuseResourceis deprecated in favor ofuseResourceParams.useFormhook is updated to useuseResourceParamsunder the hood.useShowhook is updated to useuseResourceParamsunder the hood.<CanAccess />component is updated to useuseResourceParamsunder the hood.
Patch Changes
-
#5737
4e8188a6652Thanks @aliemir! - chore: updated content ofREADME.mdto include installation, usage and scaffolding instructions. -
#5808
10ba9c34490Thanks @aliemir! - chore: improveduseMutationModehooks usage by accepting explicit values to be passed formutationModeandundoableTimeout, handling the precedence of the values inside the hook rather than outside to avoid repetition -
#5733
2b5ac6f5409Thanks @alicanerdurmaz! - feat: addeduseTranslationhook. It combinesuseTranslate,useSetLocaleanduseGetLocalehooks and returnstranslate,changeLocaleandgetLocalemethods from that hooks for better developer experience.It returns all
i18nProvidermethods in one hook. It can be used to translate texts, change the locale, and get the current locale in your own components.import { useTranslation } from "@refinedev/core"; export const MyComponent = () => { const { translate, getLocale, changeLocale } = useTranslation(); const currentLocale = getLocale(); return ( <div> <h1>{translate("languages")}</h1> <button onClick={() => changeLocale("en")} disabled={currentLocale === "en"} > English </button> <button onClick={() => changeLocale("de")} disabled={currentLocale === "de"} > German </button> </div> ); };Example of combining
useTranslationwithuseTranslate,useSetLocaleanduseGetLocalehooks.import { - useGetLocale, - useSetLocale, - useTranslate, + useTranslation, } from "@refinedev/core"; export const MyComponent = () => { - const changeLocale = useSetLocale(); - const getLocale = useGetLocale(); - const translate = useTranslate(); + const { translate, getLocale, changeLocale } = useTranslation(); return <div>{/* ... */}</div>; }; -
#5765
0c197d82393Thanks @aliemir! - refactor: package bundles and package.json configuration for exportsPreviously, Refine packages had exported ESM and CJS bundles with same
.jsextension and same types for both with.d.tsextensions. This was causing issues with bundlers and compilers to pick up the wrong files for the wrong environment. Now we're outputting ESM bundles with.mjsextension and CJS bundles with.cjsextension. Also types are now exported with both.d.mtsand.d.ctsextensions.In older versions ESM and CJS outputs of some packages were using wrong imports/requires to dependencies causing errors in some environments. This will be fixed since now we're also enforcing the module type with extensions.
Above mentioned changes also supported with changes in
package.jsonfiles of the packages to support the new extensions and types. All Refine packages now includeexportsfields in their configuration to make sure the correct bundle is picked up by the bundlers and compilers. -
#5765
0c197d82393Thanks @aliemir! - Fixed thelodash-esimports for ESM builds to access the exports properly. -
#5755
404b2ef5e1bThanks @BatuhanW! - feat: refactor TS typings.Type definitions in
src/interfacesfolder moved to their main consumer's folder undertypes.tsfiles. -
#5754
56ed144a0f5Thanks @alicanerdurmaz! - chore: TypeScript upgraded to v5.x.x. #5752 -
#5765
0c197d82393Thanks @aliemir! - Updatepapaparseimports to fix ESM exports to work properly -
#5808
10ba9c34490Thanks @aliemir! - feat: added headless button hooksWe've added a new set of hooks to make it easier to create and manage UI buttons of Refine. There's a hook for each type of button which previously had duplicated logic across the codebase between UI integrations of Refine. Now all these buttons will be powered by the same hooks maintained in the
@refinedev/corepackage to ensure consistency and reduce duplication.New Hooks:
useListButton: A navigation button that navigates to the list page of a resource.useCreateButton: A navigation button that navigates to the create page of a resource.useShowButton: A navigation button that navigates to the show page of a record.useEditButton: A navigation button that navigates to the edit page of a record.useCloneButton: A navigation button that navigates to the clone page of a record.useRefreshButton: A button that triggers an invalidation of the cache of a record.useDeleteButton: A button that triggers a delete mutation on a record.useSaveButton: A button to be used inside a form to trigger a save mutation.useExportButton: A button to be used withuseExportto trigger an export bulk data of a resource.useImportButton: A button to be used withuseImportto trigger an import bulk data for a resource.
-
#5714
38f129f40eeThanks @aliemir! - Refactored the internal logic ofuseFormto be more efficient and readable, along with few bug fixes and improvements to theuseFormhook.These changes are related to the issue #5702 and resolves #5460.
onFinishnow rejects when; -valuesis not provided, -resourceis not defined, -idis required but not provided. previously these cases were silently ignored.- Same changes also applies to
onFinishAutoSave. onFinishAutoSavehad an issue with returning the appropriate promise after being called. This resulted in unhandled promise rejections and uncontrollable resolved promises. Now it is fixed,onFinishAutoSavewill resolve and reject based on the response of the mutation.- When using auto save, debounced calls will now be cancelled and the respective promises will be rejected with
"cancelled by debounce"message. These changes might require an update to the code bases that usesonFinishAutoSaveto handle the rejection of the promise to avoid unhandled promise rejections. - Combined the separated submit functions into one for sake of simplicity and consistency. (internal)
onFinishrejects and resolved regardless of theonMutationSuccessandonMutationErrorhooks are provided or not. (Resolves #5460)metavalues were concatenated multiple times causing confusion and unexpected behavior, now it is fixed. (internal)- Moved the
iddetermination/inference logic to a separate hook. (internal)
-
Updated dependencies [
0c197d82393,56ed144a0f5]:- @refinedev/devtools-internal@1.1.7
4.48.0
Minor Changes
-
#5609
fd38d9c71a6Thanks @Cavdy! - feat: ability to pass an argument to usePermissions #5607Ability to pass an argument or parameters to usePermissions hook
const params = { tenantId: "id" }; usePermissions({ params });Resolves #5607
-
#5610
17c39ee2ee0Thanks @Conqxeror! - feat: allow passing function tooptionLabelandoptionValueprops foruseSelecthook.const { options } = useSelect({ optionLabel: (item) => `${item.firstName} ${item.lastName}`, optionValue: (item) => item.id, });feat: add
searchFieldprop touseSelecthook.Can be used to specify which field will be searched with value given to
onSearchfunction.const { onSearch } = useSelect({ searchField: "name" }); onSearch("John"); // Searchs by `name` field with value John.By default, it uses
optionLabel's value, ifoptionLabelis a string. Usestitlefield otherwise.// When `optionLabel` is string. const { onSearch } = useSelect({ optionLabel: "name" }); onSearch("John"); // Searchs by `name` field with value John. // When `optionLabel` is function. const { onSearch } = useSelect({ optionLabel: (item) => `${item.id} - ${item.name}`, }); onSearch("John"); // Searchs by `title` field with value John.Resolves #4880
Patch Changes
-
#5695
79865affa1cThanks @BatuhanW! - chore: apply biome format and fix lint errors. -
Updated dependencies [
79865affa1c]:- @refinedev/devtools-internal@1.1.6
4.47.2
Patch Changes
- #5619
e8a3620233aThanks @BatuhanW! - chore: update<WelcomePage />links.
4.47.1
Patch Changes
-
#5573
546df06482Thanks @alicanerdurmaz! - chore: add "use client" directive to exported files to work with nextjs app router -
Updated dependencies [
546df06482]:- @refinedev/devtools-internal@1.1.5
4.47.0
Minor Changes
-
#5538
b91de14ac8Thanks @Conqxeror! - feat: ability to configure useCan's queryOptions globally and through CanAccess component. #5472 -
#5522
71148278cbThanks @Conqxeror! - feat(core): add success notification support for auth provider methods #5473Updated the core and added successNotification field to AuthActionResponse and Updated relevant hooks to show success notification when successNotification object is provided and added specs.
Patch Changes
-
#5525
e2355e4179Thanks @aliemir! - Updated<WelcomePage />component to useRefineContextto determine if the context is defined or not. It will show an error dialog if the context is not defined. If the error is showing, it means that<Refine />component is not mounted or<WelcomePage />component is used outside of<Refine />component. -
#5332
5e65f71ecdThanks @vikavorkin! - fix: replace export-to-csv-fix-source-map with papaparse #5317Replace usage of
export-to-csv-fix-source-maptopapaparse, fixing issues withuseExporthook. -
#5526
b094b50c51Thanks @aliemir! - MarkeddataProviderprop of<Refine />component as optional. This will allow users to setup Refine gradually without having to provide a data provider. -
#5503
4b4d34208cThanks @BatuhanW! - refactor(core): re-export AuthBindings type as AuthProvider for consistency.
4.46.2
Patch Changes
-
#5423
75bb61dd3bThanks @aliemir! - UpdatedflattenObjectKeysmethod to support both nested and non-nested variables when propagating server side errors to form fields. Resolves #5461 -
#5401
93e00fd770Thanks @alicanerdurmaz! - fix:queryKeyis not overrideable. To fix this,useQueryoverloads refactored with single argument objects.- useQuery(queryKey, queryFn, options); + useQuery({ queryKey, queryFn, ...options });From now on, you can pass
queryKeyas an object property.// all data hooks can be used with this syntax. useList({ queryOptions: { queryKey: ["my-query-key"], }, }); -
#5406
e5888b6b9cThanks @aliemir! -useMenuhook was using outdatedmetaand routerparamsdue to missing dependency of the callback function. This was causing dynamic menu items to use wrong paths as links. (Resolves #5432) -
#5452
b621223bfbThanks @aliemir! - Added the ability to passmetaproperties when usinguseGo'sgofunction withtoas a resource object. This allows you to pass additional path parameters to the path defined in the resources array within the<Refine />component. Resolves #5451Assume we have the following resource defined in the
<Refine />component:{ name: "posts", list: "/posts", edit: "/:foo/posts/:id/edit", }import { useGo } from "@refinedev/core"; const MyButton = () => { const go = useGo(); return ( <Button onClick={() => { go({ to: { resource: "posts", action: "edit", id: "1", meta: { foo: "bar", }, }, type: "push", }); // generated path will be "/bar/posts/1/edit" }} > Go Posts </Button> ); }; -
#5381
19ceffbe9fThanks @aberhamm! - fix: MissingloginLinkattribute inAuthPagePropsfor<AuthPage type="register" />. #5381
4.46.1
Patch Changes
-
#5409
0026fe34d0Thanks @BatuhanW! - fix: excludegqlMutationandgqlQueryfrom building query keys foruseUpdate,useUpdateMany,useDelete, anduseDeleteManyhooks. -
#5409
0026fe34d0Thanks @BatuhanW! - feat: add optionalgqlQueryandgqlMutationfields toMetaQuerytype to be used indata hooks.We plan to utilize these fields on our GraphQL data providers in the future.
You can build your queries/mutations with
graphql-tagpackage and pass it to thegqlQuery/gqlMutationfields.For now, only
@refinedev/nestjs-querypackage supports it.import { useList } from "@refinedev/core"; import gql from "graphql-tag"; const PRODUCTS_QUERY = gql` query ProductsList( $paging: OffsetPaging! $filter: BlogPostFilter $sorting: [BlogPostSort!]! ) { products(paging: $paging, filter: $filter, sorting: $sorting) { nodes { id name } totalCount } } `; const { data } = useList({ resource: "products", meta: { gqlQuery: PRODUCTS_QUERY }, });
4.46.0
Minor Changes
-
#5343
dd8f1270f6Thanks @alicanerdurmaz! - fix:hideFormshould remove all form fields. (submit button, form fields, rememberMe checkbox, forgot password link, etc.) but the/registerlink should be visible. -
#5307
f8e407f850Thanks @jackprogramsjp! - feat: addedhideFormprops forLoginPageandRegisterPageforAuthPagefeature.Now with the
hideFormprops feature, you can be able to hide the forms (like email/password) to only show the OAuth providers. This avoids having to make your own entire AuthPage.
Patch Changes
-
#5323
17aa8c1cd6Thanks @alicanerdurmaz! - ### Breaking changesfix: added required
keyprop to<Authenticated />component to resolve issues of rendering of the unwanted content and wrongful redirections. #4782Why is it required?
Due to the nature of React, components are not unmounted and remounted again if props are changed. While this is mostly a good practice for performance, in some cases you'll want your component to re-mount instead of updating; for example, if you don't want to use any of the previous states and effects initiated with the old props.
The
<Authenticated />component has this kind of scenario when it's used for page-level authentication checks. If the previous check results were used for the rendering of the content (fallbackorchildren) this may lead to unexpected behaviors and flashing of the unwanted content.To avoid this, a key property must be set with different values for each use of the
<Authenticated />components. This will make sure that React will unmount and remount the component instead of updating the props.import { Refine, Authenticated, AuthPage } from "@refinedev/core"; import { CatchAllNavigate, } from "@refinedev/react-router-v6"; import { BrowserRouter, Routes, Route, Outlet, Navigate } from "react-router-dom"; const App = () => { return ( <BrowserRouter> <Refine {/* ... */}> <Routes> <Route element={ <Authenticated key="authenticated-routes" fallback={<CatchAllNavigate to="/login" />} > <Outlet /> </Authenticated> } > <Route index element={<h1>Dashboard Page</h1>} /> </Route> <Route element={ <Authenticated key="unauthenticated-routes" fallback={<Outlet />}> <Navigate to="/" replace /> </Authenticated> } > <Route path="/login" element={<AuthPage type="login" />} /> </Route> </Routes> </Refine> </BrowserRouter> ); };In the example above, the
<Authenticated />is rendered as the wrapper of both theindexroute and/loginroute. Without akeyproperty,<Authenticated />will not be re-mounted and can result in rendering the content depending on the previous authentication check. This will lead to redirecting to/loginwhen trying to access theindexroute instead of rendering the content of theindexor navigating toindexroute instead of/loginif the user just logged out. -
#5339
4c49ef0a06Thanks @alicanerdurmaz! - feat:<WelcomePage />component redesigned. -
#5316
3bdb9cb1cbThanks @ksankeerth! - fix: Return type is not mentioned correctly in useOne, useSelect, useForm, useMany and useShow hooksThis fix has improved type safety of return type of useOne, useSelect, useForm, useMany and useShow hooks.
4.45.1
Patch Changes
-
#5289
0d1e269c0283Thanks @alicanerdurmaz! - feat:<GitHubBanner />styles updated.fix:
<GitHubBanner />hydration error. #5295
4.45.0
Minor Changes
-
#5259
eac3df87ffbThanks @aliemir! - Added<AutoSaveIndicator />component and updated theAutoSaveIndicatorPropstype to allowelementsto be passed in.elementsprop is an object withsuccess,error,loadingandidlekeys. Each key is a React element that will be rendered when the corresponding state is active.By default every state will render a
spanwith the translated text of theautoSave.${state}key.
Patch Changes
- #5257
c35fdda7c61Thanks @omeraplak! - chore: update GitHub support banner text
4.44.12
Patch Changes
- #5208
72f9f608f42Thanks @BatuhanW! - chore: update commit frequency branch from next to master in README.
4.44.11
Patch Changes
-
#5199
2b8d658a17aThanks @aliemir! - ExportedBaseOptiontype as successor of the deprecatedOptiontype.BaseOptionis{ label: any; value: any; }.Usage of the deprecated
Optiontype was correctly assuming that thevalueproperty of the option is of typestring. This assumption was wrong and now the types are changed to reflect the correct values of options with the ability to change it via 4th generic typeTOptionofuseSelecthook. -
#5199
2b8d658a17aThanks @aliemir! - Reverted the faulty assumption on option values ofuseSelecthook to be of typestring. Now changed the types and the logic to reflect the correct values of options with the ability to change it via 4th generic typeTOptionofuseSelecthook. (Reverted PR #5160)By default
TOptionwill be equal toBaseOptiontype which is{ label: any; value: any; }. If you want to change the type of options, you can do it like this:import { HttpError, useSelect } from "@refinedev/core"; type MyData = { id: number; title: string; description: string; category: { id: string }; }; type Option = { label: MyData["title"]; value: MyData["id"] }; // equals to { label: string; value: number; } useSelect<MyData, HttpError, MyData, Option>({ resource: "posts", }); -
#5194
9df999ca643Thanks @fitrahfm! - fix: use relative path instead of path alias to import FlatTreeItemUsing path alias causes imported types being any during build/compilation process which should be TreeMenuItem[]
-
#5201
760cfbaaa2aThanks @aliemir! - Exported theflattenObjectKeysandpropertyPathToArrayhelpers from@refinedev/corepackage.
4.44.10
Patch Changes
-
#5199
2b8d658a17aThanks @aliemir! - ExportedBaseOptiontype as successor of the deprecatedOptiontype.BaseOptionis{ label: any; value: any; }.Usage of the deprecated
Optiontype was correctly assuming that thevalueproperty of the option is of typestring. This assumption was wrong and now the types are changed to reflect the correct values of options with the ability to change it via 4th generic typeTOptionofuseSelecthook. -
#5199
2b8d658a17aThanks @aliemir! - Reverted the faulty assumption on option values ofuseSelecthook to be of typestring. Now changed the types and the logic to reflect the correct values of options with the ability to change it via 4th generic typeTOptionofuseSelecthook. (Reverted PR #5160)By default
TOptionwill be equal toBaseOptiontype which is{ label: any; value: any; }. If you want to change the type of options, you can do it like this:import { HttpError, useSelect } from "@refinedev/core"; type MyData = { id: number; title: string; description: string; category: { id: string }; }; type Option = { label: MyData["title"]; value: MyData["id"] }; // equals to { label: string; value: number; } useSelect<MyData, HttpError, MyData, Option>({ resource: "posts", }); -
#5194
9df999ca643Thanks @fitrahfm! - fix: use relative path instead of path alias to import FlatTreeItemUsing path alias causes imported types being any during build/compilation process which should be TreeMenuItem[]
-
#5201
760cfbaaa2aThanks @aliemir! - Exported theflattenObjectKeysandpropertyPathToArrayhelpers from@refinedev/corepackage.
4.44.9
Patch Changes
-
#5177
4e0f6f9a69fThanks @aliemir! - Fixed the issue ofuseListhook requiring an empty object as prop even if there was no parameter passed to it. -
#5132
f616d6ffd94Thanks @mlukasik-dev! - fix:useSelect'soptionLabelandoptionValuetypes are wrong. -
#5160
9b9d5032b3aThanks @an-tran511! - fix: convert type of an option'svaluetostring
4.44.8
Patch Changes
-
#5177
4e0f6f9a69fThanks @aliemir! - Fixed the issue ofuseListhook requiring an empty object as prop even if there was no parameter passed to it. -
#5132
f616d6ffd94Thanks @mlukasik-dev! - fix:useSelect'soptionLabelandoptionValuetypes are wrong. -
#5160
9b9d5032b3aThanks @an-tran511! - fix: convert type of an option'svaluetostring
4.44.7
Patch Changes
- #5138
0e22d5804b2Thanks @aliemir! - PreventauthProvider.getIdentityto be called inuseLogifauditLogProvideris not defined.
4.44.6
Patch Changes
- #5138
0e22d5804b2Thanks @aliemir! - PreventauthProvider.getIdentityto be called inuseLogifauditLogProvideris not defined.
4.44.5
Patch Changes
-
#5087
88d52d639b9Thanks @alicanerdurmaz! - feat:metaprops addedliveProvider.subscribeandliveProvider.publishmethods. From now on, you can usemetato distinguish between methods bymeta.metatype:import { QueryFunctionContext } from "@tanstack/react-query"; type Fields = Array<string | object | NestedField>; type VariableOptions = | { type?: string; name?: string; value: any; list?: boolean; required?: boolean; } | { [k: string]: any }; type Meta = { dataProviderName?: string; operation?: string; fields?: Fields; variables?: VariableOptions; queryContext?: QueryFunctionContext; [k: string]: any; };Usage
import { LiveProvider, LiveEvent } from "@refinedev/core"; export const liveProvider = (client: any): LiveProvider => { return { subscribe: ({ channel, types, params, callback, meta }) => { console.log({ meta }); }, publish: ({ channel, type, payload, date, meta }: LiveEvent) => { console.log({ meta }); }, }; };
4.44.4
Patch Changes
-
#5087
88d52d639b9Thanks @alicanerdurmaz! - feat:metaprops addedliveProvider.subscribeandliveProvider.publishmethods. From now on, you can usemetato distinguish between methods bymeta.metatype:import { QueryFunctionContext } from "@tanstack/react-query"; type Fields = Array<string | object | NestedField>; type VariableOptions = | { type?: string; name?: string; value: any; list?: boolean; required?: boolean; } | { [k: string]: any }; type Meta = { dataProviderName?: string; operation?: string; fields?: Fields; variables?: VariableOptions; queryContext?: QueryFunctionContext; [k: string]: any; };Usage
import { LiveProvider, LiveEvent } from "@refinedev/core"; export const liveProvider = (client: any): LiveProvider => { return { subscribe: ({ channel, types, params, callback, meta }) => { console.log({ meta }); }, publish: ({ channel, type, payload, date, meta }: LiveEvent) => { console.log({ meta }); }, }; };
4.44.3
Patch Changes
-
#5050
613af0021f6Thanks @alicanerdurmaz! - feat: passdataProviderNametoliveProvider.subscribemethod. From now on, you can usedataProviderNameto distinguish between different data providers in live provider.Refer to documentation for more info about multiple data providers ->
Usage
import { useForm, useList } from "@refinedev/core"; useList({ dataProviderName: "first-data-provider", }); useForm({ dataProviderName: "second-data-provider", });import { LiveProvider } from "@refinedev/core"; export const liveProvider = (client: any): LiveProvider => { return { subscribe: ({ channel, types, params, callback, dataProviderName }) => { console.log({ dataProviderName }); // "second-data-provider" }, }; }; -
#5053
857d4020a30Thanks @alicanerdurmaz! - feat: The parameter types of data provider methods have been exported. From now on, you can use the parameter types of Data Provider methods.import type { DataProvider, GetListResponse // new exported types GetListParams, GetManyParams, GetOneParams, CreateParams, CreateManyParams, UpdateParams, UpdateManyParams, DeleteOneParams, DeleteManyParams, CustomParams, } from "@refinedev/core"; const myDataProvider: DataProvider = { getList: async (params: GetListParams): Promise<GetListResponse<any>> => { return { data: [], total: 0 }; }, };
4.44.2
Patch Changes
-
#5050
613af0021f6Thanks @alicanerdurmaz! - feat: passdataProviderNametoliveProvider.subscribemethod. From now on, you can usedataProviderNameto distinguish between different data providers in live provider.Refer to documentation for more info about multiple data providers ->
Usage
import { useForm, useList } from "@refinedev/core"; useList({ dataProviderName: "first-data-provider", }); useForm({ dataProviderName: "second-data-provider", });import { LiveProvider } from "@refinedev/core"; export const liveProvider = (client: any): LiveProvider => { return { subscribe: ({ channel, types, params, callback, dataProviderName }) => { console.log({ dataProviderName }); // "second-data-provider" }, }; }; -
#5053
857d4020a30Thanks @alicanerdurmaz! - feat: The parameter types of data provider methods have been exported. From now on, you can use the parameter types of Data Provider methods.import type { DataProvider, GetListResponse // new exported types GetListParams, GetManyParams, GetOneParams, CreateParams, CreateManyParams, UpdateParams, UpdateManyParams, DeleteOneParams, DeleteManyParams, CustomParams, } from "@refinedev/core"; const myDataProvider: DataProvider = { getList: async (params: GetListParams): Promise<GetListResponse<any>> => { return { data: [], total: 0 }; }, };
4.44.1
Patch Changes
-
#5050
613af0021f6Thanks @alicanerdurmaz! - feat: passdataProviderNametoliveProvider.subscribemethod. From now on, you can usedataProviderNameto distinguish between different data providers in live provider.Refer to documentation for more info about multiple data providers ->
Usage
import { useForm, useList } from "@refinedev/core"; useList({ dataProviderName: "first-data-provider", }); useForm({ dataProviderName: "second-data-provider", });import { LiveProvider } from "@refinedev/core"; export const liveProvider = (client: any): LiveProvider => { return { subscribe: ({ channel, types, params, callback, dataProviderName }) => { console.log({ dataProviderName }); // "second-data-provider" }, }; }; -
#5053
857d4020a30Thanks @alicanerdurmaz! - feat: The parameter types of data provider methods have been exported. From now on, you can use the parameter types of Data Provider methods.import type { DataProvider, GetListResponse // new exported types GetListParams, GetManyParams, GetOneParams, CreateParams, CreateManyParams, UpdateParams, UpdateManyParams, DeleteOneParams, DeleteManyParams, CustomParams, } from "@refinedev/core"; const myDataProvider: DataProvider = { getList: async (params: GetListParams): Promise<GetListResponse<any>> => { return { data: [], total: 0 }; }, };
4.44.0
Minor Changes
-
#5034
85bcff15d1eThanks @alicanerdurmaz! - feat: Thegofunction returned byuseGonow accepts aresourceobject as thetoparameter. From now now, you can provide either a string or a resource object to thegofunction. When a resource object is passed, it will be transformed into the path defined within the resources array of the<Refine />component.toaccepts an object with the following shape to navigate to a resource:Name Type Description resource stringresource name or identifier. id [ BaseKey][basekey]required when actionis"edit","show", or"clone".action "list"|"create"|"edit"|"show"|"clone"action name. import { useGo } from "@refinedev/core"; const MyComponent = () => { const go = useGo(); return ( <Button onClick={() => { go({ to: { resource: "posts", // resource name or identifier action: "edit", id: "1", } query: { foo: "bar", }, type: "push", }); }} > Go Posts With Default Filters </Button> ); };
4.43.0
Minor Changes
-
#5034
85bcff15d1eThanks @alicanerdurmaz! - feat: Thegofunction returned byuseGonow accepts aresourceobject as thetoparameter. From now now, you can provide either a string or a resource object to thegofunction. When a resource object is passed, it will be transformed into the path defined within the resources array of the<Refine />component.toaccepts an object with the following shape to navigate to a resource:Name Type Description resource stringresource name or identifier. id [ BaseKey][basekey]required when actionis"edit","show", or"clone".action "list"|"create"|"edit"|"show"|"clone"action name. import { useGo } from "@refinedev/core"; const MyComponent = () => { const go = useGo(); return ( <Button onClick={() => { go({ to: { resource: "posts", // resource name or identifier action: "edit", id: "1", } query: { foo: "bar", }, type: "push", }); }} > Go Posts With Default Filters </Button> ); };
4.42.4
Patch Changes
- Updated dependencies [
80513a4e42f]:- @refinedev/devtools-internal@1.1.4
4.42.3
Patch Changes
- Updated dependencies [
80513a4e42f]:- @refinedev/devtools-internal@1.1.3
4.42.2
Patch Changes
-
#5008
c8499114e55Thanks @aliemir! - Fixing the version of@refinedev/devtools-internaldependency to avoid breaking projects in mismatching releases. -
Updated dependencies [
c8499114e55]:- @refinedev/devtools-internal@1.1.2
4.42.1
Patch Changes
-
#5008
c8499114e55Thanks @aliemir! - Fixing the version of@refinedev/devtools-internaldependency to avoid breaking projects in mismatching releases. -
Updated dependencies [
c8499114e55]:- @refinedev/devtools-internal@1.1.1
4.42.0
Minor Changes
- #4960
d8e464fa2c4Thanks @aliemir! - Added devtools internals and integrated with the core hooks. Now users will be able to track the queries and mutation made by refine through refine devtools.
Patch Changes
- Updated dependencies [
d8e464fa2c4]:- @refinedev/devtools-internal@1.1.0
4.41.0
Minor Changes
- #4960
d8e464fa2c4Thanks @aliemir! - Added devtools internals and integrated with the core hooks. Now users will be able to track the queries and mutation made by refine through refine devtools.
Patch Changes
- Updated dependencies [
d8e464fa2c4]:- @refinedev/devtools-internal@1.0.0
4.40.0
Minor Changes
-
#4914
91a4d0da9f1Thanks @yildirayunlu! - feat: addoptimisticUpdateMapprop to theuseUpdateanduseUpdateManyhookslist,manyanddetailare the keys of theoptimisticUpdateMapobject. To automatically update the cache, you should passtrue. If you don't want to update the cache, you should passfalse.If you wish to customize the cache update, you have the option to provide functions for the
list,many, anddetailkeys. These functions will be invoked with thepreviousdata,values, andidparameters. Your responsibility is to return the updated data within these functions.const { mutate } = useUpdateMany(); mutate({ //... mutationMode: "optimistic", optimisticUpdateMap: { list: true, many: true, detail: (previous, values, id) => { if (!previous) { return null; } const data = { id, ...previous.data, ...values, foo: "bar", }; return { ...previous, data, }; }, }, });feat: add
optimisticUpdateMapprop to theuseFormhookconst { formProps, saveButtonProps } = useForm({ mutationMode: "optimistic", optimisticUpdateMap: { list: true, many: true, detail: (previous, values, id) => { if (!previous) { return null; } const data = { id, ...previous.data, ...values, foo: "bar", }; return { ...previous, data, }; }, }, });
Patch Changes
- #4903
e327cadc011Thanks @yildirayunlu! - feat: addinvalidateOnUnmountprop touseFormhook. From now on, you can use theinvalidateOnUnmountprop to invalidate queries upon unmount.
4.39.0
Minor Changes
-
#4914
91a4d0da9f1Thanks @yildirayunlu! - feat: addoptimisticUpdateMapprop to theuseUpdateanduseUpdateManyhookslist,manyanddetailare the keys of theoptimisticUpdateMapobject. To automatically update the cache, you should passtrue. If you don't want to update the cache, you should passfalse.If you wish to customize the cache update, you have the option to provide functions for the
list,many, anddetailkeys. These functions will be invoked with thepreviousdata,values, andidparameters. Your responsibility is to return the updated data within these functions.const { mutate } = useUpdateMany(); mutate({ //... mutationMode: "optimistic", optimisticUpdateMap: { list: true, many: true, detail: (previous, values, id) => { if (!previous) { return null; } const data = { id, ...previous.data, ...values, foo: "bar", }; return { ...previous, data, }; }, }, });feat: add
optimisticUpdateMapprop to theuseFormhookconst { formProps, saveButtonProps } = useForm({ mutationMode: "optimistic", optimisticUpdateMap: { list: true, many: true, detail: (previous, values, id) => { if (!previous) { return null; } const data = { id, ...previous.data, ...values, foo: "bar", }; return { ...previous, data, }; }, }, });
Patch Changes
- #4903
e327cadc011Thanks @yildirayunlu! - feat: addinvalidateOnUnmountprop touseFormhook. From now on, you can use theinvalidateOnUnmountprop to invalidate queries upon unmount.
4.38.4
Patch Changes
- #4951
04837c62077Thanks @aliemir! - - Update build configuration foresbuildto use the shared plugins.- Fix the lodash replacement plugin to skip redundant files.
4.38.3
Patch Changes
- #4951
04837c62077Thanks @aliemir! - - Update build configuration foresbuildto use the shared plugins.- Fix the lodash replacement plugin to skip redundant files.
4.38.2
Patch Changes
- #4948
8e5efffbb23Thanks @aliemir! - Keep the hook and component names in builds for better debugging.
4.38.1
Patch Changes
- #4948
8e5efffbb23Thanks @aliemir! - Keep the hook and component names in builds for better debugging.
4.38.0
Minor Changes
-
#4906
58d3d605510Thanks @alicanerdurmaz! - feat: addedonUnauthorizedcallback to<CanAccess />component. This callback to be called whenuseCanreturns false.<CanAccess onUnauthorized={({ resource, reason, action, params }) => console.log( `You cannot access ${resource}-${params.id} resource with ${action} action because ${reason}`, ) } > <YourComponent /> </CanAccess>
Patch Changes
- #4926
053798ae52bThanks @salihozdemir! - fix: updateuseFormwarn condition
4.37.0
Minor Changes
-
#4906
58d3d605510Thanks @alicanerdurmaz! - feat: addedonUnauthorizedcallback to<CanAccess />component. This callback to be called whenuseCanreturns false.<CanAccess onUnauthorized={({ resource, reason, action, params }) => console.log( `You cannot access ${resource}-${params.id} resource with ${action} action because ${reason}`, ) } > <YourComponent /> </CanAccess>
Patch Changes
- #4926
053798ae52bThanks @salihozdemir! - fix: updateuseFormwarn condition
4.36.2
Patch Changes
-
#4896
daabcd666beThanks @aliemir! -useInvalidatenow returns a promise that resolves when the invalidation is completed. -
#4896
daabcd666beThanks @aliemir! - Fine-tuning the invalidation process by setting up additional filters and options for the invalidation.Now after a successful mutation, refine will invalidate all the queries in the scope but trigger a refetch only for the active queries. If there are any ongoing queries, they will be kept as they are.
After receiving a realtime subscription event, refine will invalidate and refetch only the active queries.
4.36.1
Patch Changes
-
#4896
daabcd666beThanks @aliemir! -useInvalidatenow returns a promise that resolves when the invalidation is completed. -
#4896
daabcd666beThanks @aliemir! - Fine-tuning the invalidation process by setting up additional filters and options for the invalidation.Now after a successful mutation, refine will invalidate all the queries in the scope but trigger a refetch only for the active queries. If there are any ongoing queries, they will be kept as they are.
After receiving a realtime subscription event, refine will invalidate and refetch only the active queries.
4.36.0
Minor Changes
-
#4865
946e13408e7Thanks @aliemir! - Updated query keys to be more consistent and structured.Added mutation keys to the
useMutationcalls with the same structure as the query keys.Added
options.useNewQueryKeysoption to the<Refine>component for opting into the new query keys.Check out the documentation for more information.
4.35.0
Minor Changes
-
#4865
946e13408e7Thanks @aliemir! - Updated query keys to be more consistent and structured.Added mutation keys to the
useMutationcalls with the same structure as the query keys.Added
options.useNewQueryKeysoption to the<Refine>component for opting into the new query keys.Check out the documentation for more information.
4.34.0
Minor Changes
-
#4775
3052fb22449Thanks @alicanerdurmaz! - feat:queryKeysandpickDataProviderfunctions are exported.pickDataProvider: returns the data provider name based on the provided name or fallbacks to resource definition, ordefault.queryKeys: returns the query keys used by the data hooks based on theresourcedefinition
4.33.0
Minor Changes
-
#4775
3052fb22449Thanks @alicanerdurmaz! - feat:queryKeysandpickDataProviderfunctions are exported.pickDataProvider: returns the data provider name based on the provided name or fallbacks to resource definition, ordefault.queryKeys: returns the query keys used by the data hooks based on theresourcedefinition
4.32.2
Patch Changes
- #4765
e3e38de4114Thanks @yildirayunlu! - chore: removerefine cloudearly access message
4.32.1
Patch Changes
- #4765
e3e38de4114Thanks @yildirayunlu! - chore: removerefine cloudearly access message
4.32.0
Minor Changes
- #4741
026ccf34356Thanks @aliemir! - AddedsideEffects: falsetopackage.jsonto help bundlers tree-shake unused code.
4.31.0
Minor Changes
- #4741
026ccf34356Thanks @aliemir! - AddedsideEffects: falsetopackage.jsonto help bundlers tree-shake unused code.
4.30.0
Minor Changes
-
#4742
61950c8fe18Thanks @aliemir! - Removed@tanstack/react-query-devtoolspackage and its usage from refine's core. This means that you will no longer see the dev tools icon in the bottom right corner of your app by default. If you want to use the dev tools, you can install the package (@tanstack/react-query-devtools) and use it in your app.options.reactQuery.devtoolConfigproperty has been removed from the<Refine>components props. This option will no longer be functional and will be removed in the next major release. If you have any configuration for the dev tools, you can pass it to theReactQueryDevtoolscomponent directly.
Patch Changes
- #4740
41018fde9ffThanks @aliemir! - Usefetchfor telemetry calls as a fallback forImagewhen it's not available. This fixes an issue where telemetry calls would fail in some environments.
4.29.0
Minor Changes
-
#4742
61950c8fe18Thanks @aliemir! - Removed@tanstack/react-query-devtoolspackage and its usage from refine's core. This means that you will no longer see the dev tools icon in the bottom right corner of your app by default. If you want to use the dev tools, you can install the package (@tanstack/react-query-devtools) and use it in your app.options.reactQuery.devtoolConfigproperty has been removed from the<Refine>components props. This option will no longer be functional and will be removed in the next major release. If you have any configuration for the dev tools, you can pass it to theReactQueryDevtoolscomponent directly.
Patch Changes
- #4740
41018fde9ffThanks @aliemir! - Usefetchfor telemetry calls as a fallback forImagewhen it's not available. This fixes an issue where telemetry calls would fail in some environments.
4.28.2
Patch Changes
- #4696
35a2c695a74Thanks @BatuhanW! - feat: add optional projectId field to component options prop. Project ID will be sent with telemetry data if it exists.
4.28.1
Patch Changes
- #4696
35a2c695a74Thanks @BatuhanW! - feat: add optional projectId field to component options prop. Project ID will be sent with telemetry data if it exists.
4.28.0
Minor Changes
-
#4652
96af6d25b7aThanks @alicanerdurmaz! - feat: addederrrosfield toHttpErrortype. From now on, you can passerrorsfield toHttpError. This field will be used to update theuseForm's error state.export interface ValidationErrors { [field: string]: | string | string[] | boolean | { key: string; message: string }; } export interface HttpError extends Record<string, any> { message: string; statusCode: number; errors?: ValidationErrors; }Usage example:
import { HttpError } from "@refinedev/core"; const App = () => { return ( <Refine routerProvider={routerProvider} dataProvider={{ // ... update: async () => { // assume that the server returns the following error const error: HttpError = { message: "An error occurred while updating the record.", statusCode: 400, //This field will be used to update the `useForm`'s error state errors: { title: [ "Title is required.", "Title should have at least 5 characters.", ], "category.id": ["Category is required."], status: true, content: { key: "form.error.content", message: "Content is required.", }, }, }; return Promise.reject(error); }, }} > {/* ... */} </Refine> ); };Refer to the server-side form validation documentation for more information. →
-
#4652
96af6d25b7aThanks @alicanerdurmaz! - feat: addeddisableServerSideValidationto the refine options for globally disabling server-side validation.import { Refine } from "@refinedev/core"; <Refine options={{ disableServerSideValidation: true, }} > // ... </Refine>; -
#4591
f8891ead2bdThanks @yildirayunlu! - feat:autoSavefeature for useForm hook now acceptautoSaveobject.enabledis a boolean value anddebounceis a number value in milliseconds.debounceis optional and default value is1000.autoSavePropsis an object that containsdata,errorandstatusvalues.datais the saved data,erroris the error object andstatusis the status of the request.statuscan beloading,error,idleandsuccess.const { autoSaveProps } = useForm({ autoSave: { enabled: true, debounce: 2000, // not required, default is 1000 }, });
Patch Changes
-
#4659
3af99896101Thanks @salihozdemir! - chore: fix tsdoc description ofonCancelproperty on following hooks:useUpdateuseUpdateManyuseDeleteuseDeleteMany
-
#4665
3442f4bd00aThanks @yildirayunlu! - feat: addfalsereturn type onSuccessErrorNotificationThis issue has been fixed in this PR, where the
successNotificationanderrorNotificationmethods can now returnfalsewhen a callback function is given. This allows the conditional notification to be displayed.const { mutate } = useCreate<IPost>({}); mutate({ resource: "posts", values: { title: "Hello World", status: "published", }, successNotification: (data) => { if (data?.data.status === "published") { return { type: "success", message: "Post published", }; } return false; }, });
4.27.0
Minor Changes
-
#4652
96af6d25b7aThanks @alicanerdurmaz! - feat: addederrrosfield toHttpErrortype. From now on, you can passerrorsfield toHttpError. This field will be used to update theuseForm's error state.export interface ValidationErrors { [field: string]: | string | string[] | boolean | { key: string; message: string }; } export interface HttpError extends Record<string, any> { message: string; statusCode: number; errors?: ValidationErrors; }Usage example:
import { HttpError } from "@refinedev/core"; const App = () => { return ( <Refine routerProvider={routerProvider} dataProvider={{ // ... update: async () => { // assume that the server returns the following error const error: HttpError = { message: "An error occurred while updating the record.", statusCode: 400, //This field will be used to update the `useForm`'s error state errors: { title: [ "Title is required.", "Title should have at least 5 characters.", ], "category.id": ["Category is required."], status: true, content: { key: "form.error.content", message: "Content is required.", }, }, }; return Promise.reject(error); }, }} > {/* ... */} </Refine> ); };Refer to the server-side form validation documentation for more information. →
-
#4652
96af6d25b7aThanks @alicanerdurmaz! - feat: addeddisableServerSideValidationto the refine options for globally disabling server-side validation.import { Refine } from "@refinedev/core"; <Refine options={{ disableServerSideValidation: true, }} > // ... </Refine>; -
#4591
f8891ead2bdThanks @yildirayunlu! - feat:autoSavefeature for useForm hook now acceptautoSaveobject.enabledis a boolean value anddebounceis a number value in milliseconds.debounceis optional and default value is1000.autoSavePropsis an object that containsdata,errorandstatusvalues.datais the saved data,erroris the error object andstatusis the status of the request.statuscan beloading,error,idleandsuccess.const { autoSaveProps } = useForm({ autoSave: { enabled: true, debounce: 2000, // not required, default is 1000 }, });
Patch Changes
-
#4659
3af99896101Thanks @salihozdemir! - chore: fix tsdoc description ofonCancelproperty on following hooks:useUpdateuseUpdateManyuseDeleteuseDeleteMany
-
#4665
3442f4bd00aThanks @yildirayunlu! - feat: addfalsereturn type onSuccessErrorNotificationThis issue has been fixed in this PR, where the
successNotificationanderrorNotificationmethods can now returnfalsewhen a callback function is given. This allows the conditional notification to be displayed.const { mutate } = useCreate<IPost>({}); mutate({ resource: "posts", values: { title: "Hello World", status: "published", }, successNotification: (data) => { if (data?.data.status === "published") { return { type: "success", message: "Post published", }; } return false; }, });
4.26.4
Patch Changes
- #4626
03597ed8a9aThanks @aliemir! - Addedresourcesanitization to theuseCanWithoutCachehook to avoid cyclic value errors.
4.26.3
Patch Changes
- #4626
03597ed8a9aThanks @aliemir! - Addedresourcesanitization to theuseCanWithoutCachehook to avoid cyclic value errors.
4.26.2
Patch Changes
- #4614
c9fecca3c33Thanks @omeraplak! - chore: add refine cloud early access message
4.26.1
Patch Changes
- #4614
c9fecca3c33Thanks @omeraplak! - chore: add refine cloud early access message
4.26.0
Minor Changes
-
#4568
8c2b3be35b0Thanks @salihozdemir! - feat: add thetextTransformersoption to<Refine/>componentThe
textTransformersoption in refine is used to transform the resource name displayed on the user interface (UI). By default, if you define a resource namedposts, refine will display it asPosts. Similarly, when you delete a record, notification messages will be shown asPost deleted successfully..You have the flexibility to customize these messages by using the
textTransformersoption. For instance, if you wish to disable any transformation, you can set thetextTransformersoption as shown in the example below:const App: React.FC = () => ( <Refine // ... options={{ textTransformers: { humanize: (text) => text, plural: (text) => text, singular: (text) => text, }, }} /> );
Patch Changes
-
#4583
c3c0deed564Thanks @aliemir! - Added the missingresourceproperty inparamsof theuseCancall, which was leading to missing resource details in the access control checks in thecanfunction.The provided
resourceitem is sanitized to remove non-serializable properties such asiconetc. If you need such items, you should try to access yourresourceitem directly from your defitinions. -
#4599
5bb6f47a4d4Thanks @aliemir! - Update default document title generation to use the fallback title wheni18n'stranslatefunction returns thekeyvalue.
4.25.1
Patch Changes
- #4599
5bb6f47a4d4Thanks @aliemir! - Update default document title generation to use the fallback title wheni18n'stranslatefunction returns thekeyvalue.
4.25.0
Minor Changes
-
#4568
8c2b3be35b0Thanks @salihozdemir! - feat: add thetextTransformersoption to<Refine/>componentThe
textTransformersoption in refine is used to transform the resource name displayed on the user interface (UI). By default, if you define a resource namedposts, refine will display it asPosts. Similarly, when you delete a record, notification messages will be shown asPost deleted successfully..You have the flexibility to customize these messages by using the
textTransformersoption. For instance, if you wish to disable any transformation, you can set thetextTransformersoption as shown in the example below:const App: React.FC = () => ( <Refine // ... options={{ textTransformers: { humanize: (text) => text, plural: (text) => text, singular: (text) => text, }, }} /> );
Patch Changes
-
#4583
c3c0deed564Thanks @aliemir! - Added the missingresourceproperty inparamsof theuseCancall, which was leading to missing resource details in the access control checks in thecanfunction.The provided
resourceitem is sanitized to remove non-serializable properties such asiconetc. If you need such items, you should try to access yourresourceitem directly from your defitinions.
4.24.0
Minor Changes
-
#4523
18d446b1069Thanks @yildirayunlu! - feat: adduseLoadingOvertimehook and implement primitive hooksIf you need to do something when the loading time exceeds the specified time, refine provides the
useLoadingOvertimehook. It returns the elapsed time in milliseconds.const { elapsedTime } = useLoadingOvertime({ isLoading, interval: 1000, onInterval(elapsedInterval) { console.log("loading overtime", elapsedInterval); }, }); console.log(elapsedTime); // 1000, 2000, 3000, ...This hook implements the primitive data hooks:
-
#4527
ceadcd29fc9Thanks @salihozdemir! - fix: support multipleresourceusage with the same name via theidentifierPreviously, data hooks only worked with resource name. So if you had multiple
resourceusage with the same name, it would cause issues.Now the following hooks and its derivatives support
identifierto distinguish between the resources:useListuseInfiniteListuseOneuseManyuseCreateuseCreateManyuseUpdateuseUpdateManyuseDeleteuseDeleteMany
fix: generate correct
queryKey's for queries withidentifierPreviously, the
queryKeywas generated usingname. This caused issues when you had multipleresourceusage with the same name. Now thequeryKey's are generated usingidentifierif it's present. -
#4523
18d446b1069Thanks @yildirayunlu! - feat: adduseLoadingOvertimehookif you need to do something when the loading time exceeds the specified time, refine provides the
useLoadingOvertimehook. It returns the elapsed time in milliseconds.const { elapsedTime } = useLoadingOvertime({ isLoading, interval: 1000, onInterval(elapsedInterval) { console.log("loading overtime", elapsedInterval); }, });intervalandonIntervalare optional. It can be controlled globally from<Refine />options.<Refine //... options={{ //... overtime: { interval: 2000, // default 1000 onInterval(elapsedInterval) { console.log( "loading overtime", elapsedInterval, ); }, }, }} >
4.23.0
Minor Changes
-
#4523
18d446b1069Thanks @yildirayunlu! - feat: adduseLoadingOvertimehook and implement primitive hooksIf you need to do something when the loading time exceeds the specified time, refine provides the
useLoadingOvertimehook. It returns the elapsed time in milliseconds.const { elapsedTime } = useLoadingOvertime({ isLoading, interval: 1000, onInterval(elapsedInterval) { console.log("loading overtime", elapsedInterval); }, }); console.log(elapsedTime); // 1000, 2000, 3000, ...This hook implements the primitive data hooks:
-
#4527
ceadcd29fc9Thanks @salihozdemir! - fix: support multipleresourceusage with the same name via theidentifierPreviously, data hooks only worked with resource name. So if you had multiple
resourceusage with the same name, it would cause issues.Now the following hooks and its derivatives support
identifierto distinguish between the resources:useListuseInfiniteListuseOneuseManyuseCreateuseCreateManyuseUpdateuseUpdateManyuseDeleteuseDeleteMany
fix: generate correct
queryKey's for queries withidentifierPreviously, the
queryKeywas generated usingname. This caused issues when you had multipleresourceusage with the same name. Now thequeryKey's are generated usingidentifierif it's present. -
#4523
18d446b1069Thanks @yildirayunlu! - feat: adduseLoadingOvertimehookif you need to do something when the loading time exceeds the specified time, refine provides the
useLoadingOvertimehook. It returns the elapsed time in milliseconds.const { elapsedTime } = useLoadingOvertime({ isLoading, interval: 1000, onInterval(elapsedInterval) { console.log("loading overtime", elapsedInterval); }, });intervalandonIntervalare optional. It can be controlled globally from<Refine />options.<Refine //... options={{ //... overtime: { interval: 2000, // default 1000 onInterval(elapsedInterval) { console.log( "loading overtime", elapsedInterval, ); }, }, }} >
4.22.0
Minor Changes
-
#4449
cc84d61bc5cThanks @BatuhanW! - feat: allow access control provider to be configured globally.Now
accessControlProvideracceptsoptions.buttonsparameter to globally configure UI buttons' behaviour.These configuration will be used as a fallback, if no configuration on button prop level is found.
Default values:
options.buttons.enableAccessControl=>trueoptions.buttons.hideIfUnauthorized=>falseconst accessControlProvider: IAccessControlContext = { can: async (params: CanParams): Promise<CanReturnType> => { return { can: true }; }, options: { buttons: { enableAccessControl: true, hideIfUnauthorized: false, }, }, };
Patch Changes
-
#4521
a3c8d4f84c7Thanks @alicanerdurmaz! - fixed:useExport'sresourceprops is not working. With this fix,useExportwill now work withresourceprops.useExport({ resource: "users", });
4.21.0
Minor Changes
-
#4449
cc84d61bc5cThanks @BatuhanW! - feat: allow access control provider to be configured globally.Now
accessControlProvideracceptsoptions.buttonsparameter to globally configure UI buttons' behaviour.These configuration will be used as a fallback, if no configuration on button prop level is found.
Default values:
options.buttons.enableAccessControl=>trueoptions.buttons.hideIfUnauthorized=>falseconst accessControlProvider: IAccessControlContext = { can: async (params: CanParams): Promise<CanReturnType> => { return { can: true }; }, options: { buttons: { enableAccessControl: true, hideIfUnauthorized: false, }, }, };
Patch Changes
-
#4521
a3c8d4f84c7Thanks @alicanerdurmaz! - fixed:useExport'sresourceprops is not working. With this fix,useExportwill now work withresourceprops.useExport({ resource: "users", });
4.20.0
Minor Changes
- #4448
c82006f712aThanks @BatuhanW! - feat: useApiUrl hook tries to infer data provider from current resource. If current resource has a different data provider than the default one, it will be inferred without needing to explicitly pass data provider name.
4.19.0
Minor Changes
- #4448
c82006f712aThanks @BatuhanW! - feat: useApiUrl hook tries to infer data provider from current resource. If current resource has a different data provider than the default one, it will be inferred without needing to explicitly pass data provider name.
4.18.2
Patch Changes
-
#4446
5936d9cd4d4Thanks @salihozdemir! - refactor: increase accessibility of auth page componentsadd
htmlFortolabelelements to associate them with their inputs
4.18.1
Patch Changes
-
#4446
5936d9cd4d4Thanks @salihozdemir! - refactor: increase accessibility of auth page componentsadd
htmlFortolabelelements to associate them with their inputs
4.18.0
Minor Changes
-
#4430
cf07d59587fThanks @aliemir! - AddedqueryMetaandmutationMetaproperties to theuseFormhook. These properties are used to pass specific meta values to the query or mutation. This is useful when you have overlapping values in your data provider'sgetOneandupdatemethods. For example, you may want to change themethodof the mutation toPATCHbut if you pass it in themetaproperty, you'll end up changing the method of thegetOnerequest as well.queryMetaandmutationMetahas precedence overmeta. This means that if you have the same property inqueryMetaandmeta, the value inqueryMetawill be used.Usage
import { useForm } from "@refinedev/core"; export const MyEditPage = () => { const form = useForm({ // this is passed both to the mutation and the query requests meta: { myValue: "myValue", }, // this is only passed to the query request queryMeta: { propertyOnlyWorksForQuery: "propertyOnlyWorksForQuery", }, // this is only passed to the mutation request mutationMeta: { propertyOnlyWorksForMutation: "propertyOnlyWorksForMutation", }, }); };
Patch Changes
-
#4430
cf07d59587fThanks @aliemir! - Fix missingmetavalues inuseFormredirects after submission. -
#4431
c29a3618cf6Thanks @aliemir! - Updated the TSDoc comments to fix the broken links in the documentation. -
#4426
0602f4cdf1cThanks @yildirayunlu! - fix:resourceparameter in thelegacyResourceTransformhelper is not optional but used as optional
4.17.0
Minor Changes
-
#4430
cf07d59587fThanks @aliemir! - AddedqueryMetaandmutationMetaproperties to theuseFormhook. These properties are used to pass specific meta values to the query or mutation. This is useful when you have overlapping values in your data provider'sgetOneandupdatemethods. For example, you may want to change themethodof the mutation toPATCHbut if you pass it in themetaproperty, you'll end up changing the method of thegetOnerequest as well.queryMetaandmutationMetahas precedence overmeta. This means that if you have the same property inqueryMetaandmeta, the value inqueryMetawill be used.Usage
import { useForm } from "@refinedev/core"; export const MyEditPage = () => { const form = useForm({ // this is passed both to the mutation and the query requests meta: { myValue: "myValue", }, // this is only passed to the query request queryMeta: { propertyOnlyWorksForQuery: "propertyOnlyWorksForQuery", }, // this is only passed to the mutation request mutationMeta: { propertyOnlyWorksForMutation: "propertyOnlyWorksForMutation", }, }); };
Patch Changes
-
#4430
cf07d59587fThanks @aliemir! - Fix missingmetavalues inuseFormredirects after submission. -
#4431
c29a3618cf6Thanks @aliemir! - Updated the TSDoc comments to fix the broken links in the documentation. -
#4426
0602f4cdf1cThanks @yildirayunlu! - fix:resourceparameter in thelegacyResourceTransformhelper is not optional but used as optional
4.16.4
Patch Changes
- #4415
54837825fccThanks @alicanerdurmaz! - fixed:queryOptionsnot working as expected inuseSelecthook.
4.16.3
Patch Changes
- #4415
54837825fccThanks @alicanerdurmaz! - fixed:queryOptionsnot working as expected inuseSelecthook.
4.16.2
Patch Changes
-
#4407
473bbe5b31dThanks @aliemir! - Added missingcloneaction for document title generation. This fixes the issue of the document title not being generated when thecloneaction is used.This change introduces the
documentTitle.{resourceName}.clonekey to the list ofi18nkeys that are used to generate the document title.Default title for the
cloneaction is"#{{id}} Clone {{resourceName}} | refine". -
#4407
473bbe5b31dThanks @aliemir! - Fixed the issue oflabelnot taken into account with auto generated document titles.labelwill be prioritized over the resource name when generating the document title and thelabelwill not be capitalized.
4.16.1
Patch Changes
-
#4407
473bbe5b31dThanks @aliemir! - Added missingcloneaction for document title generation. This fixes the issue of the document title not being generated when thecloneaction is used.This change introduces the
documentTitle.{resourceName}.clonekey to the list ofi18nkeys that are used to generate the document title.Default title for the
cloneaction is"#{{id}} Clone {{resourceName}} | refine". -
#4407
473bbe5b31dThanks @aliemir! - Fixed the issue oflabelnot taken into account with auto generated document titles.labelwill be prioritized over the resource name when generating the document title and thelabelwill not be capitalized.
4.16.0
Minor Changes
-
#4313
28fe67047a0Thanks @abdellah711! - feat: implementgenerateDefaultDocumentTitlefunctionThis function generates a default document title based on the current route by following these rules (
resourcein this case is "Post"):- list ->
Posts | refine - edit ->
#{id} Edit Post | refine - show ->
#{id} Show Post | refine - create ->
Create new Post | refine - default (not a
resource) ->refine
- list ->
Patch Changes
- #4381
500cf2becc2Thanks @yildirayunlu! - feat: exportTranslationContext
4.15.0
Minor Changes
-
#4313
28fe67047a0Thanks @abdellah711! - feat: implementgenerateDefaultDocumentTitlefunctionThis function generates a default document title based on the current route by following these rules (
resourcein this case is "Post"):- list ->
Posts | refine - edit ->
#{id} Edit Post | refine - show ->
#{id} Show Post | refine - create ->
Create new Post | refine - default (not a
resource) ->refine
- list ->
Patch Changes
- #4381
500cf2becc2Thanks @yildirayunlu! - feat: exportTranslationContext
4.14.3
Patch Changes
- #4279
3e4c977b8d3Thanks @yildirayunlu! - fix: queryKey method params foruseDelete,useDeleteManyanduseUpdatehooks
4.14.2
Patch Changes
- #4279
3e4c977b8d3Thanks @yildirayunlu! - fix: queryKey method params foruseDelete,useDeleteManyanduseUpdatehooks
4.14.1
Patch Changes
- #4279
3e4c977b8d3Thanks @yildirayunlu! - fix: queryKey method params foruseDelete,useDeleteManyanduseUpdatehooks
4.14.0
Minor Changes
-
#4241
fbe109b5a8bThanks @salihozdemir! - Added new generic types to theuseFormhooks. Now you can pass the query types and the mutation types to the hook.import { useForm } from "@refinedev/core"; useForm<TQueryFnData, TError, TVariables, TData, TResponse, TResponseError>();
4.13.0
Minor Changes
-
#4241
fbe109b5a8bThanks @salihozdemir! - Added new generic types to theuseFormhooks. Now you can pass the query types and the mutation types to the hook.import { useForm } from "@refinedev/core"; useForm<TQueryFnData, TError, TVariables, TData, TResponse, TResponseError>();
4.12.0
Minor Changes
-
#4194
8df15fe0e4eThanks @alicanerdurmaz! - feat:sorters.modeprop added touseTableanduseDataGridhooks. This prop handles the sorting mode of the table. It can be eitherserveroroff.- "off":
sortersare not sent to the server. You can use thesortersvalue to sort the records on the client side. - "server": Sorting is done on the server side. Records will be fetched by using the
sortersvalue.
feat:
filters.modeprop added touseTableanduseDataGridhooks. This prop handles the filtering mode of the table. It can be eitherserveroroff.- "off":
filtersare not sent to the server. You can use thefiltersvalue to filter the records on the client side. - "server": Filtering is done on the server side. Records will be fetched by using the
filtersvalue.
- "off":
Patch Changes
- #4194
8df15fe0e4eThanks @alicanerdurmaz! - fix:filters,sorters,current, and,pageSizeremoved fromuseMetareturned object.
4.11.0
Minor Changes
-
#4194
8df15fe0e4eThanks @alicanerdurmaz! - feat:sorters.modeprop added touseTableanduseDataGridhooks. This prop handles the sorting mode of the table. It can be eitherserveroroff.- "off":
sortersare not sent to the server. You can use thesortersvalue to sort the records on the client side. - "server": Sorting is done on the server side. Records will be fetched by using the
sortersvalue.
feat:
filters.modeprop added touseTableanduseDataGridhooks. This prop handles the filtering mode of the table. It can be eitherserveroroff.- "off":
filtersare not sent to the server. You can use thefiltersvalue to filter the records on the client side. - "server": Filtering is done on the server side. Records will be fetched by using the
filtersvalue.
- "off":
Patch Changes
- #4194
8df15fe0e4eThanks @alicanerdurmaz! - fix:filters,sorters,current, and,pageSizeremoved fromuseMetareturned object.
4.10.0
Minor Changes
-
#4135
e72c0d2b41fThanks @salihozdemir! - feat: Expose the query params to themetaand add the ability to pass globalmetato data provider methods-
Added the ability to pass
metato data provider methods globally for specific resources.For example, to pass the
roleproperty to all data provider methods for thepostsresource, use the following code:import { Refine } from "@refinedev/core"; const App: React.FC = () => { return ( <Refine resources={[ { name: "posts", meta: { role: "editor", }, }, ]} /> ); };Now, when you call any data hook with the
postsresource, themetaproperty will be accessible in the data provider methods.const dataProvider = { getList: async ({ resource, meta }) => { console.log(meta.role); // "editor" }, }; -
Added the query params to the
metaproperty by default.For example, if you call the
useListhook on theexample.com/posts?status=publishedURL, themetaproperty will be accessible in the data provider methods as follows:const dataProvider = { getList: async ({ resource, meta }) => { console.log(meta.status); // "published" }, };
-
Patch Changes
-
#4159
f7f590589e7Thanks @aliemir! - fixed: missing resource meta in route compositionsAdded missing resource meta values when composing routes. This fixes the bug where the resource meta values does not included in the route composition.
4.9.0
Minor Changes
-
#4135
e72c0d2b41fThanks @salihozdemir! - feat: Expose the query params to themetaand add the ability to pass globalmetato data provider methods-
Added the ability to pass
metato data provider methods globally for specific resources.For example, to pass the
roleproperty to all data provider methods for thepostsresource, use the following code:import { Refine } from "@refinedev/core"; const App: React.FC = () => { return ( <Refine resources={[ { name: "posts", meta: { role: "editor", }, }, ]} /> ); };Now, when you call any data hook with the
postsresource, themetaproperty will be accessible in the data provider methods.const dataProvider = { getList: async ({ resource, meta }) => { console.log(meta.role); // "editor" }, }; -
Added the query params to the
metaproperty by default.For example, if you call the
useListhook on theexample.com/posts?status=publishedURL, themetaproperty will be accessible in the data provider methods as follows:const dataProvider = { getList: async ({ resource, meta }) => { console.log(meta.status); // "published" }, };
-
Patch Changes
-
#4159
f7f590589e7Thanks @aliemir! - fixed: missing resource meta in route compositionsAdded missing resource meta values when composing routes. This fixes the bug where the resource meta values does not included in the route composition.
4.8.5
Patch Changes
- #4139
e4c60056a4dThanks @alicanerdurmaz! - - Fixed: incorrect css syntax on gh-banner
4.8.4
Patch Changes
- #4139
e4c60056a4dThanks @alicanerdurmaz! - - Fixed: incorrect css syntax on gh-banner
4.8.3
Patch Changes
- #4139
e4c60056a4dThanks @alicanerdurmaz! - - Fixed: incorrect css syntax on gh-banner
4.8.2
Patch Changes
- #4133
68f035dc4c0Thanks @alicanerdurmaz! - Added: Hide<GithubBanner />on mobile.
4.8.1
Patch Changes
- #4133
68f035dc4c0Thanks @alicanerdurmaz! - Added: Hide<GithubBanner />on mobile.
4.8.0
Minor Changes
-
#4113
1c13602e308Thanks @salihozdemir! - Added missing third generic parameter to hooks which are usinguseQueryinternally.For example:
import { useOne, HttpError } from "@refinedev/core"; const { data } = useOne<{ count: string }, HttpError, { count: number }>({ resource: "product-count", queryOptions: { select: (rawData) => { return { data: { count: Number(rawData?.data?.count), }, }; }, }, }); console.log(typeof data?.data.count); // number
Patch Changes
-
#4129
e64ffe999b3Thanks @aliemir! - Added the missing connection between the data provider's and theuseManyhook'smetaproperty. -
#4113
1c13602e308Thanks @salihozdemir! - Updated the generic type name of hooks that useuseQueryto synchronize generic type names withtanstack-query.
4.7.2
Patch Changes
- #4102
44e403aa654Thanks @aliemir! - Revert changes in<GithubBanner />to promote github stars.
4.7.1
Patch Changes
- #4102
44e403aa654Thanks @aliemir! - Revert changes in<GithubBanner />to promote github stars.
4.7.0
Minor Changes
- #4040
8a1100cf9edThanks @aliemir! - Add a generic type touseParseanduseParsedfor type-safe additional params.
Patch Changes
- #4089
65f2a9fa223Thanks @salihozdemir! - Update Github banner to Product Hunt banner for temporary.
4.6.0
Minor Changes
- #4040
8a1100cf9edThanks @aliemir! - Add a generic type touseParseanduseParsedfor type-safe additional params.
Patch Changes
- #4089
65f2a9fa223Thanks @salihozdemir! - Update Github banner to Product Hunt banner for temporary.
4.5.10
Patch Changes
-
#4035
e0c75450f97Thanks @salihozdemir! - Add types for notification methods arguments based on given generic types. -
#4071
98cd4b0f203Thanks @salihozdemir! - UpdateauthBindingserror type to provide changeable error messages on notifcations.Example for
loginmethod:import { AuthBindings } from "@refinedev/core"; const authProvider: AuthBindings = { login: async ({ email, password }) => { ... return { success: false, error: { message: "Login Failed!", name: "The email or password that you've entered doesn't match any account.", }, }; }, ... };
4.5.9
Patch Changes
-
#4035
e0c75450f97Thanks @salihozdemir! - Add types for notification methods arguments based on given generic types. -
#4071
98cd4b0f203Thanks @salihozdemir! - UpdateauthBindingserror type to provide changeable error messages on notifcations.Example for
loginmethod:import { AuthBindings } from "@refinedev/core"; const authProvider: AuthBindings = { login: async ({ email, password }) => { ... return { success: false, error: { message: "Login Failed!", name: "The email or password that you've entered doesn't match any account.", }, }; }, ... };
4.5.8
Patch Changes
- #4014
3db450fade0Thanks @salihozdemir! - Add console warning foruseFormanduseShowhooks when custom resource is provided andidprop is not passed.
4.5.7
Patch Changes
- #4014
3db450fade0Thanks @salihozdemir! - Add console warning foruseFormanduseShowhooks when custom resource is provided andidprop is not passed.
4.5.6
Patch Changes
- #3974
4dcc20d6a60Thanks @salihozdemir! - Updated the design of theWelcomePagecomponent.
4.5.5
Patch Changes
- #3974
4dcc20d6a60Thanks @salihozdemir! - Updated the design of theWelcomePagecomponent.
4.5.4
Patch Changes
- #3987
d7d68e3ff68Thanks @aliemir! - Watch foridchanges inuseFormhook.
4.5.3
Patch Changes
- #3987
d7d68e3ff68Thanks @aliemir! - Watch foridchanges inuseFormhook.
4.5.2
Patch Changes
- #3911
5f9c70ebf2fThanks @salihozdemir! - In forms that useuseForm, theonFinishwas resetting the currentidtoundefinedwhen the mutation is successful. Now, theidwill not be set toundefined.
4.5.1
Patch Changes
- #3911
5f9c70ebf2fThanks @salihozdemir! - In forms that useuseForm, theonFinishwas resetting the currentidtoundefinedwhen the mutation is successful. Now, theidwill not be set toundefined.
4.5.0
Minor Changes
- #3912
0ffe70308b2Thanks @alicanerdurmaz! - -titleprop added toAuthPage'srenderContentprop to use in the custom content.titleprop added toAuthPageto render a custom title.- ⚠️ These features have not been implemented yet. Only types were added. It will be implemented in the next release.
4.4.0
Minor Changes
- #3912
0ffe70308b2Thanks @alicanerdurmaz! - -titleprop added toAuthPage'srenderContentprop to use in the custom content.titleprop added toAuthPageto render a custom title.- ⚠️ These features have not been implemented yet. Only types were added. It will be implemented in the next release.
4.3.0
Minor Changes
- #3892
41a4525454cThanks @BatuhanW! - feat: make CanAccess component props optional. Now CanAccess component infers resource and action automagically.
4.2.0
Minor Changes
- #3892
41a4525454cThanks @BatuhanW! - feat: make CanAccess component props optional. Now CanAccess component infers resource and action automagically.
4.1.6
Patch Changes
- #3890
db12d60095fThanks @aliemir! - - Fixed layout flickering on authenticated routes.- Fixed repeated navigations issue on routes with
<Authenticated>component. - Fixed conflicting navigation paths with
authProvidermethods and<Authenticated>component.
- Fixed repeated navigations issue on routes with
4.1.5
Patch Changes
- #3890
db12d60095fThanks @aliemir! - - Fixed layout flickering on authenticated routes.- Fixed repeated navigations issue on routes with
<Authenticated>component. - Fixed conflicting navigation paths with
authProvidermethods and<Authenticated>component.
- Fixed repeated navigations issue on routes with
4.1.4
Patch Changes
-
#3884
c507c10c351Thanks @omeraplak! - fix: resource's icon parameter sanitized on useCan hook -
#3883
64b8292c5e8Thanks @omeraplak! - feat: add custom query key support for useCustom hook
4.1.3
Patch Changes
-
#3884
c507c10c351Thanks @omeraplak! - fix: resource's icon parameter sanitized on useCan hook -
#3883
64b8292c5e8Thanks @omeraplak! - feat: add custom query key support for useCustom hook
4.1.2
Patch Changes
- #3874
5ed083a8050Thanks @aliemir! - Add fallback option forlabelfrommetaandoptions.
4.1.1
Patch Changes
- #3874
5ed083a8050Thanks @aliemir! - Add fallback option forlabelfrommetaandoptions.
4.1.0
Minor Changes
-
Thanks @aliemir, @alicanerdurmaz, @batuhanW, @salihozdemir, @yildirayunlu, @recepkutuk!
🪄 Migrating your project automatically with refine-codemod ✨
@refinedev/codemodpackage handles the breaking changes for your project automatically, without any manual steps. It migrates your project from3.x.xto4.x.x.Just
cdinto root folder of your project (wherepackage.jsonis contained) and run this command:npx @refinedev/codemod@latest refine3-to-refine4And it's done. Now your project uses
refine@4.x.x.📝 Changelog
We're releasing a new way to connect routers to refine. Now the
routerProviderprop is marked as optional in<Refine>component.New
routerProviderproperty is smaller and more flexible than the previous one which is now can be used withlegacyRouterProviderproperty.We've redesigned our bindings to the router libraries. Instead of handling the route creation process, now refine leaves this to the user and only uses a way to communicate with the router and the routes through the bindings provided to
routerProviderproperty.The changes in routing system comes with a new way to define resource actions as well. Actions now can be defined as paths, components or both. We're encouraging our users to use paths, which enables our users to use all the optimizations that the router libraries provide without giving up any features of refine.
Router libraries are also comes with components like
RefineRouteswhich can be used to define routes for resources when you pass components to the actions of the resources. Please refer to the documentation for more information.Changes in
resourcesNow you can define actions in multiple ways;
- As a path
<Refine resources={[ { name: "posts", list: "/posts", }, ]} > ... </Refine>- As a component
import { PostList } from "src/posts"; <Refine resources={[ { name: "posts", list: PostList, }, ]} > ... </Refine>;- As both
import { PostList } from "src/posts"; <Refine resources={[ { name: "posts", list: { path: "/posts", component: PostList, }, }, ]} > ... </Refine>;This also comes with some additional changes;
optionsproperty is renamed tometafor consistency.parentNameis now defined withparentproperty inmetaobject.auditLogis renamed toaudit.routeinoptionsis now deprecated for the new routing system. If you want to define a custom route for a resource, you can define such routes in action definitions.- Parents are not included in the routes by default. If you want to inclue parents in the routes, you need to define action paths explicitly.
identifiercan be passed to the resource definition to distinguish between resources with the same name. This is useful when you have multiple resources with the same name.
Nested routes
Now, refine supports nested routes with parameters. You can define the action paths for a resource with parameters. Parameters will be filled with the current ones in the URL and additional ones can be provided via
metaproperties in hooks and components.<Refine resources={[ { name: "posts", list: "users/:authorId/posts", show: "users/:authorId/posts/:id", }, ]} >When you're in the
listpage of thepostsresource, assuming you already have theauthorIdparameter present in the URL, theshowaction will be rendered with theauthorIdparameter filled with the current one in the URL. If you want to use a differentauthorId, you can passmetaproperties to the components or hooks, such asuseGetToPathhook to get the navigation path.const { go } = useGo(); const getToPath = useGetToPath(); const to = getToPath({ resource: "posts", action: "show", meta: { id: 1, authorId: 2, }, }); // "to" will be "/users/2/posts/1" go({ to, type: "push" });Changes in
routerProviderrouterProvideris now smaller and more flexible. It only contains the following properties;Link: A component that acceptstoprop and renders a link to the given path.go: A function that returns a function that accepts a config object and navigates to the given path.back: A function that returns a function that navigates back to the previous page.parse: A function that returns a function that returns theresource,id,actionand additionalparamsfrom the given path. This is the refine's way to communicate with the router library.
None of the properties are required. Missing properties may result in some features not working but it won't break refine.
Our users are able to provide different implementations for the router bindings, such as handling the search params in the path with a different way or customizing the navigation process.
Note: Existing
routerProviderimplementation is preserved aslegacyRouterProviderand will continue working as before. We're planning to remove it in the next major version.Note: New routing system do not handle the authentication process. You can now wrap your components with
Authenticatedcomponent or handle the authentication check inside your components throughuseIsAuthenticatedhook to provide more flexible auth concepts in your app.Changes in hooks
We're now providing new hooks for the new routing system. You're free to use them or use the ones provided by your router library.
useGouseBackuseParseduseLinkuseGetToPath
are provided by refine to use the properties of
routerProviderin a more convenient way.useResourceWithRouteis now deprecated and only works with the legacy routing system.useResourcehas changed its definition and now accepts a single argument which is theresourcename. It returns theresourceobject depending on the current route or the givenresourcename. Ifresourceis provided but not found, it will create a temporary one to use with the givenresourcename.useNavigation's functions in its return value are now acceptingmetaobject as an argument. This can be used to provide parameters to the target routes. For example, if your path for theeditaction of a resource is/:userId/posts/:id/edit, you can provideuserIdparameter inmetaobject and it will be used in the path.- Hooks using routes, redirection etc. are now accepts
metaproperty in their arguments. This can be used to provide parameters to the target routes. This change includesuseMenuanduseBreadcrumbwhich are creating paths to the resources for their purposes. selectedKeyinuseMenuhook's return type now can beundefinedif the current route is not found in the menu items.
warnWhenUnsavedChangespropIn earlier versions, refine was handling this feature in
beforeunloadevent. This was causing unintended dependencies to thewindowand was not customizable. Now, refine is leaving this to the router libraries. Router packages@refinedev/react-router-v6,@refinedev/nextjs-routerand@refinedev/remix-routerare now exporting a componentUnsavedChangesNotifierwhich can be placed under the<Refine>component and registers a listener to the necessary events to handle thewarnWhenUnsavedChangesfeature.Changes in
Authenticatedcomponent.<Authenticated>component now acceptsredirectOnFailto override the redirection path on authentication failure. This can be used to redirect to a different page when the user is not authenticated. This property only works if thefallbackprop is not provided.redirectOnFailalso respects the newly introducedappendCurrentPathToQueryprop which can be used to append the current path to the query string of the redirection path. This can be used to redirect the user to the page they were trying to access after they logged in.Changes in
<Refine>We've removed the long deprecated props from
<Refine />component and deprecated some more to encourage users to use the new routing system.In earlier versions, we've accepted layout related props such as
Layout,Sider,Header,Footer,OffLayoutAreaandTitle. All these props were used in the route creation process while wrapping the components to theLayoutand others were passed to theLayoutfor configuration. Now, we've deprecated these props and we're encouraging users to useLayoutprop and its props in thechildrenof<Refine />component. This will allow users to customize the layout easily and provide custom layouts per route.We've also deprecated the route related props such as;
catchAll, which was used in rendering 404 pages and was unclear to the user when its going to be rendered in the app.LoginPage, which was rendered at/loginpath and was not customizable enough.DashboardPage, which wass rendered at/path and was limiting our users to handle the index page just with a single prop.ReadyPage, which was shown when<Refine>had no resources defined. Now, we're accepting empty resources array and rendering nothing in this case.
We're encouraging our users to create their own routes for the above props and give them the flexibility to use the full potential of the router library they're using.
Integration with existing apps
We've made the changes to the routing system, the resource definitions and some additional changes to make the integration with existing apps possible.
Now you can migrate your existing apps to refine with ease and incrementally adopt refine's features.
Backward compatibility
We've made all the changes in a backward compatible way. You can continue using the old routing system and the old props of
<Refine />component. Migrating to the new behaviors are optional but encouraged.We're planning to keep the support for the deprecated props and the old behaviors until the next major version.
-
Thanks @aliemir, @alicanerdurmaz, @batuhanW, @salihozdemir, @yildirayunlu, @recepkutuk! Added audit log support for the following hooks:
-
Thanks @aliemir, @alicanerdurmaz, @batuhanW, @salihozdemir, @yildirayunlu, @recepkutuk! Added a helper function to pick not deprecated value. Gives priority according to the order of the arguments.
const sorter = undefined; const sorters = [{ id: 1 }]; const value = pickNotDeprecated(sorter, sorters) ?? 10; // [{ id: 1 }] -
Thanks @aliemir, @alicanerdurmaz, @batuhanW, @salihozdemir, @yildirayunlu, @recepkutuk!
useListhook- Added default value for
pagination.currentproperty. It is set to 1. - Added default value for
pagination.pageSizeproperty. It is set to 10. - Added
pagination.modeproperty. By default, it is "server".- When it is "off", all records will be fetched from the API.
- When it is "client", all records will be fetched from the API and pagination will be handled by the
useListhook. - When it is "server", pagination will be handled by the API using
currentandpageSizeproperties of yourpaginationobject.
useTablehookuseTablereturn values and properties are updated.-
initialCurrentandinitialPageSizeprops are now deprecated. Usepaginationprop instead. -
To ensure backward compatibility,
initialCurrentandinitialPageSizeprops will work as before.useTable({ - initialCurrent, - initialPageSize, + pagination: { + current, + pageSize, + }, }) -
hasPaginationprop is now deprecated. Usepagination.modeinstead. -
To ensure backward compatibility,
hasPaginationprop will work as before.useTable({ - hasPagination, + pagination: { + mode: "off" | "server" | "client", + }, }) -
initialSorterandpermanentSorterprops are now deprecated. Usesorters.initialandsorters.permanentinstead. -
To ensure backward compatibility,
initialSorterandpermanentSorterprops will work as before.useTable({ - initialSorter, - permanentSorter, + sorters: { + initial, + permanent, + }, }) -
initialFilter,permanentFilter, anddefaultSetFilterBehaviorprops are now deprecated. Usefilters.initial,filters.permanent, andfilters.defaultBehaviorinstead. -
To ensure backward compatibility,
initialFilter,permanentFilter, anddefaultSetFilterBehaviorprops will work as before.useTable({ - initialFilter, - permanentFilter, - defaultSetFilterBehavior, + filters: { + initial, + permanent, + defaultBehavior, + }, }) -
sorterandsetSorterreturn values are now deprecated. UsesortersandsetSortersinstead. -
To ensure backward compatibility,
sorterandsetSorterreturn values will work as before.const { - sorter, + sorters, - setSorter, + setSorters, } = useTable();
- Added default value for
-
Thanks @aliemir, @alicanerdurmaz, @batuhanW, @salihozdemir, @yildirayunlu, @recepkutuk! All
@tanstack/react-queryimports re-exported from@refinedev/corehave been removed. You should import them from@tanstack/react-querypackage directly.If the package is not installed, you can install it with your package manager:
npm install @tanstack/react-query # or pnpm add @tanstack/react-query # or yarn add @tanstack/react-queryAfter that, you can import them from
@tanstack/react-querypackage directly instead of@refinedev/corepackage.- import { QueryClient } from "@refinedev/core"; + import { QueryClient } from "@tanstack/react-query"; -
Thanks @aliemir, @alicanerdurmaz, @batuhanW, @salihozdemir, @yildirayunlu, @recepkutuk!
optionsprop of resource is now deprecated. Usemetaprop instead.- To ensure backward compatibility,
optionsprop will be used ifmetaprop is not provided.
<Refine resources={[ { name: "posts", - options: {}, + meta: {}, }, ]} /> -
Thanks @aliemir, @alicanerdurmaz, @batuhanW, @salihozdemir, @yildirayunlu, @recepkutuk!
AuthProviderdeprecated and renamed toLegacyAuthProvider.legacyAuthProviderprop is added to<Refine>component for backward compatibility.legacyprop added to auth hooks supportAuthProviderandLegacyAuthProvider.
-
Thanks @aliemir, @alicanerdurmaz, @batuhanW, @salihozdemir, @yildirayunlu, @recepkutuk!
<ReadyPage>isnow deprecated.- Created a
<WelcomePage>component to welcome users.
-
Thanks @aliemir, @alicanerdurmaz, @batuhanW, @salihozdemir, @yildirayunlu, @recepkutuk!
useListanduseInfiniteList'sconfigprop is now deprecated. Usesorters,filters,paginationandhasPaginationprops instead.
useList({ - config: { - sort, - filters, - pagination, - hasPagination, - }, + sorters, + filters, + pagination, + hasPagination, }) useInfiniteList({ - config: { - sort, - filters, - pagination, - hasPagination, - }, + sorters, + filters, + pagination, + hasPagination, })useImportanduseExport'sresourceNameprop is now deprecated. Useresourceprop instead.
useImport({ - resourceName, + resource, }) useExport({ - resourceName, + resource, })useExport'ssorterprop is now deprecated. Usesortersprop instead.
useExport({ - sorter, + sorters, })useSelect'ssortprop is now deprecated. Usesortersprop instead.
useSelect({ - sort, + sorters, })useSelect'sconfig.sortprop is now deprecated. Useconfig.sortersprop instead.
useCustom({ config: { - sort, + sorters, } }) -
Thanks @aliemir, @alicanerdurmaz, @batuhanW, @salihozdemir, @yildirayunlu, @recepkutuk!
hasPaginationdefault value set tofalseonuseSelect. So all of the records will be fetched by default. -
Thanks @aliemir, @alicanerdurmaz, @batuhanW, @salihozdemir, @yildirayunlu, @recepkutuk! Updated
useSelecthook to supportoptionLabelandoptionValuetype askeyof TDatainstead ofstring.So
optionLabelandoptionValuehave an interface based on the givenTDatatype.- optionLabel?: string; - optionValue?: string; + optionLabel?: keyof TData extends string ? keyof TData : never; + optionValue?: keyof TData extends string ? keyof TData : never; -
Thanks @aliemir, @alicanerdurmaz, @batuhanW, @salihozdemir, @yildirayunlu, @recepkutuk! Moving to the
@refinedevscope 🎉🎉Moved to the
@refinedevscope and updated our packages to use the new scope. From now on, all packages will be published under the@refinedevscope with their new names.Now, we're also removing the
refineprefix from all packages. So, the@pankod/refine-corepackage is now@refinedev/core,@pankod/refine-antdis now@refinedev/antd, and so on.
Patch Changes
3.103.0
Minor Changes
- #3822
0baa99ba787Thanks @BatuhanW! - - refine v4 release announcement added to "postinstall". - refine v4 is released 🎉 The new version is 100% backward compatible. You can upgrade to v4 with a single command! See the migration guide here: https://refine.dev/docs/migration-guide/3x-to-4x
3.102.0
Minor Changes
- #3822
0baa99ba787Thanks @BatuhanW! - - refine v4 release announcement added to "postinstall". - refine v4 is released 🎉 The new version is 100% backward compatible. You can upgrade to v4 with a single command! See the migration guide here: https://refine.dev/docs/migration-guide/3x-to-4x
3.101.2
Patch Changes
- #3768
38eb18ab795Thanks @BatuhanW! - Update URL for GitHubBanner component
3.101.1
Patch Changes
- #3768
38eb18ab795Thanks @BatuhanW! - Update URL for GitHubBanner component
3.101.0
Minor Changes
- #3716
03177f8aa06Thanks @BatuhanW! - Added GitHubBanner component.
3.100.0
Minor Changes
- #3716
03177f8aa06Thanks @BatuhanW! - Added GitHubBanner component.
3.99.6
Patch Changes
- #3657
5868456194fThanks @fuunnx! - Fix optimistic updates of list's query data following a mutation usinguseUpdate
3.99.5
Patch Changes
- #3657
5868456194fThanks @fuunnx! - Fix optimistic updates of list's query data following a mutation usinguseUpdate
3.99.4
Patch Changes
-
#3548
8795efb04ddThanks @alicanerdurmaz! - fixed: wronginitialCurrentvalue onuseTablejsDoc- * @default 10 + * @default 1 ```
3.99.3
Patch Changes
-
#3548
8795efb04ddThanks @alicanerdurmaz! - fixed: wronginitialCurrentvalue onuseTablejsDoc- * @default 10 + * @default 1 ```
3.99.2
Patch Changes
- #3455
0405eb18e88Thanks @yildirayunlu! - Fix error translation key onuseInfiniteListhook.
3.99.1
Patch Changes
- #3455
0405eb18e88Thanks @yildirayunlu! - Fix error translation key onuseInfiniteListhook.
3.99.0
Minor Changes
-
0767d7a07a7Thanks @yildirayunlu! - Added theuseInfiniteListhook 🥳. This hook is a modified version of react-query'suseInfiniteQueryused for retrieving items from a resource with pagination, sort, and filter configurations.
3.98.0
Minor Changes
-
0767d7a07a7Thanks @yildirayunlu! - Added theuseInfiniteListhook 🥳. This hook is a modified version of react-query'suseInfiniteQueryused for retrieving items from a resource with pagination, sort, and filter configurations.
3.97.0
Minor Changes
-
#3442
8f2954611faThanks @salihozdemir! - Added swizzle support for@pankod/refine-corepackage.Swizzleable components:
AuthenticatedCanAccessErrorPage- Authentication Pages
LoginLogoutRegisterForgotPasswordUpdatePassword
Patch Changes
-
#3436
ea74f3a8408Thanks @sevkioruc! - Fix useList, useCustom and useCustomMutation hooks i18n issue in the error messages. -
#3440
96d93eb2d71Thanks @salihozdemir! - Made the auth provider'susePermissionsmethod optional.
3.96.0
Minor Changes
-
#3442
8f2954611faThanks @salihozdemir! - Added swizzle support for@pankod/refine-corepackage.Swizzleable components:
AuthenticatedCanAccessErrorPage- Authentication Pages
LoginLogoutRegisterForgotPasswordUpdatePassword
Patch Changes
-
#3436
ea74f3a8408Thanks @sevkioruc! - Fix useList, useCustom and useCustomMutation hooks i18n issue in the error messages. -
#3440
96d93eb2d71Thanks @salihozdemir! - Made the auth provider'susePermissionsmethod optional.
3.95.3
Patch Changes
-
#3382
6604586b030Thanks @alicanerdurmaz! - Fixed: The link in the jsDOC of theliveModereplaced with the correct link.- * @type [`"auto" | "manual" | "off"`](/docs/api-reference/core/interfaceReferences/#crudsorting) + * @type [`"auto" | "manual" | "off"`](/docs/api-reference/core/providers/live-provider/#livemode)
3.95.2
Patch Changes
-
#3382
6604586b030Thanks @alicanerdurmaz! - Fixed: The link in the jsDOC of theliveModereplaced with the correct link.- * @type [`"auto" | "manual" | "off"`](/docs/api-reference/core/interfaceReferences/#crudsorting) + * @type [`"auto" | "manual" | "off"`](/docs/api-reference/core/providers/live-provider/#livemode)
3.95.1
Patch Changes
- #3399
22b44a857a8Thanks @yildirayunlu! - FixuseTablehook error return type.
3.95.0
Minor Changes
22b44a857a8Thanks @yildirayunlu! - FixuseTablehook error return type.
3.94.2
Patch Changes
-
#3364
98a1fbec65aThanks @aliemir! - ChangedIResourceComponentsfromIResourceContextto useReact.ComponentTyperather thanReact.FunctionComponentto make it compatible with other types and interfaces. -
#3356
310ebd05990Thanks @omeraplak! - Fixed checkError hook is not called in onError of useCustomMutation
3.94.1
Patch Changes
-
#3364
98a1fbec65aThanks @aliemir! - ChangedIResourceComponentsfromIResourceContextto useReact.ComponentTyperather thanReact.FunctionComponentto make it compatible with other types and interfaces. -
#3356
310ebd05990Thanks @omeraplak! - Fixed checkError hook is not called in onError of useCustomMutation
3.94.0
Minor Changes
- #3335
ce6acf2b3d4Thanks @omeraplak! - feat:useResourcehook can now also return the currentaction
3.93.0
Minor Changes
- #3335
ce6acf2b3d4Thanks @omeraplak! - feat:useResourcehook can now also return the currentaction
3.92.0
Minor Changes
- #3324
9bfb34749bcThanks @aliemir! - Added the ability to pass mutation options touseMutationhooks in mutation hooks:useCreate(data)useUpdate(data)useDelete(data)useDeleteMany(data)useUpdateMany(data)useCreateMany(data)useCustomMutation(data)useLogin(auth)useLogout(auth)useRegister(auth)useForgotPassword(auth)useUpdatePassword(auth)useForm(form)
Patch Changes
814eb1009daThanks @omeraplak! - chore: re-exported@tanstack/react-query
3.91.0
Minor Changes
- #3324
9bfb34749bcThanks @aliemir! - Added the ability to pass mutation options touseMutationhooks in mutation hooks:useCreate(data)useUpdate(data)useDelete(data)useDeleteMany(data)useUpdateMany(data)useCreateMany(data)useCustomMutation(data)useLogin(auth)useLogout(auth)useRegister(auth)useForgotPassword(auth)useUpdatePassword(auth)useForm(form)
Patch Changes
814eb1009daThanks @omeraplak! - chore: re-exported@tanstack/react-query
3.90.6
Patch Changes
-
#3224
a47f17931a8Thanks @leapful! - Restore filter operator after clear it by using filter dropdown -
#3220
b867497f469Thanks @aliemir! - Updated image links inREADME.MDwith CDN
3.90.5
Patch Changes
-
#3224
a47f17931a8Thanks @leapful! - Restore filter operator after clear it by using filter dropdown -
#3220
b867497f469Thanks @aliemir! - Updated image links inREADME.MDwith CDN
3.90.4
Patch Changes
- #3098
a241ef3c957Thanks @aliemir! - UpdatenotificationProviderprop handling by converting to a custom hook to prevent hook usage errors.
3.90.3
Patch Changes
- #3098
a241ef3c957Thanks @aliemir! - UpdatenotificationProviderprop handling by converting to a custom hook to prevent hook usage errors.
3.90.2
Patch Changes
- #3073
38dfde0c2ecThanks @samelhusseini! - FixedqueryOptionsparameter ofuseShowhook
3.90.1
Patch Changes
- #3073
38dfde0c2ecThanks @samelhusseini! - FixedqueryOptionsparameter ofuseShowhook
3.90.0
Minor Changes
- #3030
d0998d66cd0Thanks @yildirayunlu! - AddqueryOptionsparams onuseShowhook.
3.89.0
Minor Changes
- #3030
d0998d66cd0Thanks @yildirayunlu! - AddqueryOptionsparams onuseShowhook.
3.88.4
Patch Changes
- #2975
249f9521c4Thanks @salihozdemir! - AddedhasPaginationproperty touseSelecthook for disabling pagination.
3.88.3
Patch Changes
- #2975
249f9521c4Thanks @salihozdemir! - AddedhasPaginationproperty touseSelecthook for disabling pagination.
3.88.2
Patch Changes
- #2953
e3642eafa2Thanks @alicanerdurmaz! - FixuseLogout()'sonSuccessbehavious according toAuthProviderresolved-rejectedvalues.
3.88.1
Patch Changes
- #2953
e3642eafa2Thanks @alicanerdurmaz! - FixuseLogout()'sonSuccessbehavious according toAuthProviderresolved-rejectedvalues.
3.88.0
Minor Changes
-
#2872
da3fc4a702Thanks @TDP17! - Feat: Added ability to manage breadcrumb component globally via optionsUsage
<Refine options= {{ breadcrumb: false, // hide globally }} /> or ```jsx <Refine options= {{ breadcrumb: <MyCustomBreadcrumbComponent /> // custom component }} />
3.87.0
Minor Changes
-
#2872
da3fc4a702Thanks @TDP17! - Feat: Added ability to manage breadcrumb component globally via optionsUsage
<Refine options= {{ breadcrumb: false, // hide globally }} /> or ```jsx <Refine options= {{ breadcrumb: <MyCustomBreadcrumbComponent /> // custom component }} />
3.86.2
Patch Changes
- #2839
5388a338abThanks @aliemir! -useCanhook was returning the stale value if same call is made with skipped access control.
3.86.1
Patch Changes
- #2839
5388a338abThanks @aliemir! -useCanhook was returning the stale value if same call is made with skipped access control.
3.86.0
Minor Changes
-
Only
orwas supported as a conditional filter. Nowandandorcan be used together and nested. 🚀{ operator: "or", value: [ { operator: "and", value: [ { field: "name", operator: "eq", value: "John Doe", }, { field: "age", operator: "eq", value: 30, }, ], }, { operator: "and", value: [ { field: "name", operator: "eq", value: "JR Doe", }, { field: "age", operator: "eq", value: 1, }, ], }, ], }
3.85.0
Minor Changes
-
#2751
addff64c77Thanks @yildirayunlu! - Onlyorwas supported as a conditional filter. Nowandandorcan be used together and nested. 🚀{ operator: "or", value: [ { operator: "and", value: [ { field: "name", operator: "eq", value: "John Doe", }, { field: "age", operator: "eq", value: 30, }, ], }, { operator: "and", value: [ { field: "name", operator: "eq", value: "JR Doe", }, { field: "age", operator: "eq", value: 1, }, ], }, ], }
3.84.0
Minor Changes
-
Marked
getMany,createMany,updateManyanddeleteManyfunctions as optional and substituted withgetOne,create,updateanddeleteOnerespectively. Now users can choose to skip implementinggetMany,createMany,updateManyanddeleteManyfunctions and usegetOne,create,updateanddeleteOnefunctions instead.Breaking Change
getMany,createMany,updateManyanddeleteManyfunctions are now optional and may cause type issues if used outside of the refine hooks.
3.83.0
Minor Changes
-
#2688
508045ac30Thanks @aliemir! - MarkedgetMany,createMany,updateManyanddeleteManyfunctions as optional and substituted withgetOne,create,updateanddeleteOnerespectively. Now users can choose to skip implementinggetMany,createMany,updateManyanddeleteManyfunctions and usegetOne,create,updateanddeleteOnefunctions instead.Breaking Change
getMany,createMany,updateManyanddeleteManyfunctions are now optional and may cause type issues if used outside of the refine hooks.
3.82.0
Minor Changes
-
Added
useSelect(), setState handler functions are memoizedFixed when
queryOptions.enabled = trueonuseSelect(), fetches all data. #2691
Patch Changes
- fix:
useSelect()'s overriddenonSearchfunction is not calling when value is empty.
3.81.0
Minor Changes
-
#2704
e4d78052efThanks @alicanerdurmaz! - AddeduseSelect(), setState handler functions are memoizedFixed when
queryOptions.enabled = trueonuseSelect(), fetches all data. #2691
Patch Changes
- #2705
031f67707cThanks @alicanerdurmaz! - fix:useSelect()'s overriddenonSearchfunction is not calling when value is empty.
3.80.0
Minor Changes
-
Added infinite loading example to antd
useSelect()useSelect()fetchSizeprop is deprecated. From nowpaginationshould be used -
Added
dataProviderNameproperty to resource options. Now you can define default data provider per resource.Usage
<Refine dataProvider={{ default: myProvider, second: mySecondProvider, }} resources={[ { name: "posts", options: { dataProviderName: "second", }, }, ]} />
Patch Changes
-
Add AuthProps type export
-
Mark
defaultkey as required for multiple data providers indataProviderprop of<Refine />component.
3.79.0
Minor Changes
-
#2629
bc89228e73Thanks @bungambohlah! - Added infinite loading example to antduseSelect()useSelect()fetchSizeprop is deprecated. From nowpaginationshould be used -
#2674
3bd6196056Thanks @aliemir! - AddeddataProviderNameproperty to resource options. Now you can define default data provider per resource.Usage
<Refine dataProvider={{ default: myProvider, second: mySecondProvider, }} resources={[ { name: "posts", options: { dataProviderName: "second", }, }, ]} />
Patch Changes
-
#2666
8a562d2114Thanks @omeraplak! - Add AuthProps type export -
#2684
38c3876af5Thanks @aliemir! - Markdefaultkey as required for multiple data providers indataProviderprop of<Refine />component.
3.78.0
Minor Changes
-
clientConfigproperty now acceptsQueryClientinstance - #2665Usage
import { QueryClient } from "@tanstack/react-query"; const queryClient = new QueryClient(); const App: React.FC = () => ( <Refine ... options={{ reactQuery: { clientConfig: queryClient }, }} /> );
3.77.0
Minor Changes
-
#2670
f260932051Thanks @alicanerdurmaz! -clientConfigproperty now acceptsQueryClientinstance - #2665Usage
import { QueryClient } from "@tanstack/react-query"; const queryClient = new QueryClient(); const App: React.FC = () => ( <Refine ... options={{ reactQuery: { clientConfig: queryClient }, }} /> );
3.76.0
Minor Changes
-
- Added new component core and mantine support.
- Move Auth types
@pankod/refine-ui-typesto@pankod/refine-core
Patch Changes
- fix core data hooks type errors
3.75.1
Patch Changes
- #2667
6e6a9e98e5Thanks @alicanerdurmaz! - fix core data hooks type errors
3.75.0
Minor Changes
- #2627
c5fb45d61fThanks @yildirayunlu! - - Added new component core and mantine support.- Move Auth types
@pankod/refine-ui-typesto@pankod/refine-core
- Move Auth types
3.74.8
Patch Changes
- add props table to useCan documentation
3.74.7
Patch Changes
- #2615
ad3947d847Thanks @alicanerdurmaz! - add props table to useCan documentation
3.74.6
Patch Changes
- Updated
devtoolConfigtype.
3.74.5
Patch Changes
- #2505
a4dbb63c88Thanks @salihozdemir! - UpdateddevtoolConfigtype.
3.74.4
Patch Changes
- Fixed useMenu hook is not reacting to locale change - #2598
3.74.3
Patch Changes
- #2600
3ed69bba17Thanks @omeraplak! - Fixed useMenu hook is not reacting to locale change - #2598
3.74.2
Patch Changes
- Removed redundant type inheritance
3.74.1
Patch Changes
- #2586
d7c8b7642bThanks @necatiozmen! - Removed redundant type inheritance
3.74.0
Minor Changes
-
Combine action related types into a single file and derive types from it to avoid future inconsistencies.
Renamed
RedirectionTypestype toRedirectAction.Updated every type definition of actions to use the new
Actiontype or derivations of it.
Patch Changes
-
Fixed the issue in resource routes not taking
options.routeof parent resource into account. -
Rename
reset-password->forgot-passwordon docs.
3.73.0
Minor Changes
-
Combine action related types into a single file and derive types from it to avoid future inconsistencies.
Renamed
RedirectionTypestype toRedirectAction.Updated every type definition of actions to use the new
Actiontype or derivations of it.
Patch Changes
-
Fixed the issue in resource routes not taking
options.routeof parent resource into account. -
Rename
reset-password->forgot-passwordon docs.
3.72.1
Patch Changes
- #2568
efe99f7843Thanks @yildirayunlu! - Renamereset-password->forgot-passwordon docs.
3.72.0
Minor Changes
-
#2486
ee4d0d112aThanks @aliemir! - Combine action related types into a single file and derive types from it to avoid future inconsistencies.Renamed
RedirectionTypestype toRedirectAction.Updated every type definition of actions to use the new
Actiontype or derivations of it.
Patch Changes
- #2486
ee4d0d112aThanks @aliemir! - Fixed the issue in resource routes not takingoptions.routeof parent resource into account.
3.71.2
Patch Changes
-
Fix
useImporthook requests with properly invoking requests sequentially and manage progress state. -
Removed
childrenproperty fromuseCansparams.resourcesince it can be inITreeMenutype andReact.ReactNodebreaks thereact-querys key stringify function. -
Fixed undoable mutation is called many times - #2556
3.71.1
Patch Changes
-
#2560
373cee23baThanks @aliemir! - FixuseImporthook requests with properly invoking requests sequentially and manage progress state. -
#2537
4407bf8825Thanks @ozkalai! - Removedchildrenproperty fromuseCansparams.resourcesince it can be inITreeMenutype andReact.ReactNodebreaks thereact-querys key stringify function. -
#2559
75b699cd6cThanks @omeraplak! - Fixed undoable mutation is called many times - #2556
3.71.0
Minor Changes
-
- Renamed
resetPasswordin AuthProvider toforgotPassword - Renamed
useResetPasswordhook touseForgotPassword
- Renamed
3.70.0
Minor Changes
- #2524
27bf81bebbThanks @biskuvit! - - RenamedresetPasswordin AuthProvider toforgotPassword- Renamed
useResetPasswordhook touseForgotPassword
- Renamed
3.69.9
Patch Changes
-
Add register function to
AuthContextProviderfor invalidate auth store queries. -
Fixed version of react-router to
6.3.0
3.69.8
Patch Changes
- #2501
4095a578d4Thanks @omeraplak! - Fixed version of react-router to6.3.0
3.69.7
Patch Changes
- #2447
628a37a675Thanks @biskuvit! - Add register function toAuthContextProviderfor invalidate auth store queries.
3.69.6
Patch Changes
- Fix import of react-query
DevtoolsOptionsinterface
3.69.5
Patch Changes
- #2481
7820454ae7Thanks @omeraplak! - Fix import of react-queryDevtoolsOptionsinterface
3.69.4
Patch Changes
- Fixed default login page for headless
3.69.3
Patch Changes
- #2475
fc859677d9Thanks @omeraplak! - Fixed default login page for headless
3.69.2
Patch Changes
- Update
useFormanduseShowhooks to watch foridfrompropsand update the query with the newidwhen it changes.
3.69.1
Patch Changes
- #2467
21bb649bc7Thanks @aliemir! - UpdateuseFormanduseShowhooks to watch foridfrompropsand update the query with the newidwhen it changes.
3.69.0
Minor Changes
- Adding more CRUD Filter Operators
- Add
initialDatasupport toDashboardPagefor@pankod/refine-nextjs-router.
3.68.0
Minor Changes
- #2456
f20a0ed621Thanks @workatease! - Adding more CRUD Filter Operators
- #2142
dd00de215aThanks @ozkalai! - AddinitialDatasupport toDashboardPagefor@pankod/refine-nextjs-router.
3.67.0
Minor Changes
- Updated the generation of type declarations, moved the declarations from
tsuptotscfor a better experience withPeek DefinitionandGo to Definitionfeatures. After this change, it's expected to navigate to the source code of therefinepackages instead of thedistdirectory with combined declarations.
- Removed
josedependency.
- Remove
decamelizedependency fromhumanizeStringhelper and replace the functionality with regExp.
Patch Changes
- Fixed the issue with the TS compiler and
useResourcehooks return type.
- Pass
dataProviderNameprop to mutations in@pankod/refine-core'suseImporthook.
3.66.1
Patch Changes
- #2448
f1edb19979Thanks @aliemir! - PassdataProviderNameprop to mutations in@pankod/refine-core'suseImporthook.
3.66.0
Minor Changes
- #2440
0150dcd070Thanks @aliemir! - Updated the generation of type declarations, moved the declarations fromtsuptotscfor a better experience withPeek DefinitionandGo to Definitionfeatures. After this change, it's expected to navigate to the source code of therefinepackages instead of thedistdirectory with combined declarations.
- #2439
f2faf99f25Thanks @yildirayunlu! - Removedjosedependency.
- #2443
2c428b3105Thanks @ozkalai! - Removedecamelizedependency fromhumanizeStringhelper and replace the functionality with regExp.
Patch Changes
- #2440
0150dcd070Thanks @aliemir! - Fixed the issue with the TS compiler anduseResourcehooks return type.
3.65.3
Patch Changes
- Fixed,
loginLinkandregisterLinktexts and remove unnecessary props from forms
- Fixed syncWithLocation not tracking when useTable filters were reset
3.65.2
Patch Changes
- #2435
bdf32c6cf9Thanks @omeraplak! - Fixed syncWithLocation not tracking when useTable filters were reset
3.65.1
Patch Changes
- #2433
3ce29dda52Thanks @biskuvit! - Fixed,loginLinkandregisterLinktexts and remove unnecessary props from forms
3.65.0
Minor Changes
-
🎉 Added
AuthPagecomponent to therefineapp. This page is used to login, register, forgot password and update password. Login page is default page and oldLoginPagecomponent is deprecated.New Auth Hooks
📌 Added
useRegisterhook. This hook is used to register new user.useRegisterfalls into register function ofAuthProvider.📌 Added
useForgotPasswordhook. This hook is used to forgot password.useForgotPasswordfalls intoforgotPasswordfunction ofAuthProvider.📌 Added
useUpdatePasswordhook. This hook is used to update password.useUpdatePasswordfalls intoupdatePasswordfunction ofAuthProvider.- <LoginPage> + <AuthPage>New
AuthPageprops:interface IAuthPageProps extends IAuthCommonProps { type?: "login" | "register" | "forgotPassword" | "updatePassword"; } interface IAuthCommonProps { submitButton?: React.ReactNode; registerLink?: React.ReactNode; loginLink?: React.ReactNode; forgotPasswordLink?: React.ReactNode; updatePasswordLink?: React.ReactNode; backLink?: React.ReactNode; providers?: IProvider[]; } interface IProvider { name: string; icon?: React.ReactNode; label?: string; }
Patch Changes
-
Fixed
<AuthPage>by adding missing props to "login" and "register" pages.Fixed
<Refine>componentLoginPageproperty.
3.64.2
Patch Changes
-
#2415
f7c98f0ef9Thanks @biskuvit! - Fixed<AuthPage>by adding missing props to "login" and "register" pages.Fixed
<Refine>componentLoginPageproperty.
3.64.1
Patch Changes
-
#2299
a02cb9e8efThanks @biskuvit! - 🎉 AddedAuthPageto therefineapp. This page is used to login, register, forgot password and update password. Login page is default page and oldLoginPagecomponent is deprecated.New Auth Hooks
📌 Added
useRegisterhook. This hook is used to register new user.useRegisterfalls into register function ofAuthProvider.📌 Added
useForgotPasswordhook. This hook is used to forgot password.useForgotPasswordfalls intoforgotPasswordfunction ofAuthProvider.📌 Added
useUpdatePasswordhook. This hook is used to update password.useUpdatePasswordfalls intoupdatePasswordfunction ofAuthProvider.- <LoginPage> + <AuthPage>New
AuthPageprops:interface IAuthPageProps extends IAuthCommonProps { type?: "login" | "register" | "forgotPassword" | "updatePassword"; } interface IAuthCommonProps { registerLink?: React.ReactNode; loginLink?: React.ReactNode; forgotPasswordLink?: React.ReactNode; updatePasswordLink?: React.ReactNode; backLink?: React.ReactNode; providers?: IProvider[]; } interface IProvider { name: string; icon?: React.ReactNode; label?: string; }Add
AuthPageas a default page to Routers📌 Added
AuthPageto therefine-nextjs-router. Default page isAuthPage.📌 Added
AuthPageto therefine-react-location. Default page isAuthPage.📌 Added
AuthPageto therefine-react-router-v6. Default page isAuthPage.📌 Added
AuthPageto therefine-remix-router. Default page isAuthPage.
3.64.0
Minor Changes
-
Add an option to hide
resourcesfrom theSidermenu<Refine ... ... resources={[ { name: "posts", list: PostList, options: { hide: true, }, }, ]} />
-
Add object path syntax support for the useSelect hook
useSelect({ resource: "posts", optionLabel: "nested.title", optionLabel: "nested.id", });
3.63.0
Minor Changes
-
#2391
e530670c2dThanks @omeraplak! - Add an option to hideresourcesfrom theSidermenu<Refine ... ... resources={[ { name: "posts", list: PostList, options: { hide: true, }, }, ]} />
-
#2395
3019fae7a0Thanks @omeraplak! - Add object path syntax support for the useSelect hookuseSelect({ resource: "posts", optionLabel: "nested.title", optionLabel: "nested.id", });
3.62.1
Patch Changes
- fix redirectPage return value #2377
3.62.0
Minor Changes
-
Added a new
<Refine>component property:options.Previously, the options were passed as a property to the
<Refine>component. Now, the options are passed to the<Refine>viaoptionsproperty like this:<Refine - mutationMode="undoable" - undoableTimeout={5000} - warnWhenUnsavedChanges - syncWithLocation - liveMode="off" - disableTelemetry={false} + options={{ + mutationMode: "undoable", + undoableTimeout: 5000, + warnWhenUnsavedChanges: true, + syncWithLocation: true, + liveMode: "off", + disableTelemetry: false, + }} />
-
Added a new redirect feature. It is now possible to set default redirects.
By default, when a form is submitted, it will redirect to the "list" page of the current resource. You can change this behavior by setting the
redirectparameter like this:<Refine ... options={{ redirect: { afterCreate: "show", afterClone: "edit", afterEdit: false }, }} />
Patch Changes
-
lodashmoved to "dependencies" for CommonJS builds
-
- Fixed
lodash-esusage for ESM builds
- Fixed
3.61.1
Patch Changes
- #2377
c62fb114b1Thanks @alicanerdurmaz! - fix redirectPage return value #2377
3.61.0
Minor Changes
-
Added a new
<Refine>component property:options.Previously, the options were passed as a property to the
<Refine>component. Now, the options are passed to the<Refine>viaoptionsproperty like this:<Refine - mutationMode="undoable" - undoableTimeout={5000} - warnWhenUnsavedChanges - syncWithLocation - liveMode="off" - disableTelemetry={false} + options={{ + mutationMode: "undoable", + undoableTimeout: 5000, + warnWhenUnsavedChanges: true, + syncWithLocation: true, + liveMode: "off", + disableTelemetry: false, + }} />
-
Added a new redirect feature. It is now possible to set default redirects.
By default, when a form is submitted, it will redirect to the "list" page of the current resource. You can change this behavior by setting the
redirectparameter like this:<Refine ... options={{ redirect: { afterCreate: "show", afterClone: "edit", afterEdit: false }, }} />
Patch Changes
-
lodashmoved to "dependencies" for CommonJS builds
-
- Fixed
lodash-esusage for ESM builds
- Fixed
3.60.0
Minor Changes
-
Added a new
<Refine>component property:options.Previously, the options were passed as a property to the
<Refine>component. Now, the options are passed to the<Refine>viaoptionsproperty like this:<Refine - mutationMode="undoable" - undoableTimeout={5000} - warnWhenUnsavedChanges - syncWithLocation - liveMode="off" - disableTelemetry={false} + options={{ + mutationMode: "undoable", + undoableTimeout: 5000, + warnWhenUnsavedChanges: true, + syncWithLocation: true, + liveMode: "off", + disableTelemetry: false, + }} />
-
Added a new redirect feature. It is now possible to set default redirects.
By default, when a form is submitted, it will redirect to the "list" page of the current resource. You can change this behavior by setting the
redirectparameter like this:<Refine ... options={{ redirect: { afterCreate: "show", afterClone: "edit", afterEdit: false }, }} />
Patch Changes
-
lodashmoved to "dependencies" for CommonJS builds
-
- Fixed
lodash-esusage for ESM builds
- Fixed
3.59.0
Minor Changes
-
#2352
e4d39eff33Thanks @salihozdemir! - Added a new<Refine>component property:options.Previously, the options were passed as a property to the
<Refine>component. Now, the options are passed to the<Refine>viaoptionsproperty like this:<Refine - mutationMode="undoable" - undoableTimeout={5000} - warnWhenUnsavedChanges - syncWithLocation - liveMode="off" - disableTelemetry={false} + options={{ + mutationMode: "undoable", + undoableTimeout: 5000, + warnWhenUnsavedChanges: true, + syncWithLocation: true, + liveMode: "off", + disableTelemetry: false, + }} />
-
#2361
95e1a17cd1Thanks @salihozdemir! - Added a new redirect feature. It is now possible to set default redirects.By default, when a form is submitted, it will redirect to the "list" page of the current resource. You can change this behavior by setting the
redirectparameter like this:<Refine ... options={{ redirect: { afterCreate: "show", afterClone: "edit", afterEdit: false }, }} />
Patch Changes
- #2366
de87f13dadThanks @omeraplak! - -lodashmoved to "dependencies" for CommonJS builds
- #2366
de87f13dadThanks @omeraplak! - - Fixedlodash-esusage for ESM builds
3.58.5
Patch Changes
lodashmoved to dependencies.
3.58.4
Patch Changes
- #2350
f8e5d99598Thanks @ozkalai! -lodashmoved to dependencies.
3.58.3
Patch Changes
- Fixed react-query devtools was consuming high CPU
3.58.2
Patch Changes
- #2333
2f0255ec95Thanks @omeraplak! - Fixed react-query devtools was consuming high CPU
3.58.1
Patch Changes
AuthProvider'sloginmethod can now return a value forRemix's authentication flow
3.58.0
Minor Changes
- Updated
reactQueryDevtoolConfigprop type and addedfalseoption to disable the React Query Devtools.
3.57.0
Minor Changes
- #2311
645391a3d9Thanks @aliemir! - UpdatedreactQueryDevtoolConfigprop type and addedfalseoption to disable the React Query Devtools.
3.56.11
Patch Changes
- Fixed user-defined URL query parameters being deleted when using
syncWithLocation
3.56.10
Patch Changes
- Added QueryFunctionContext's values to
queryContextinmetaData.
3.56.9
Patch Changes
- #2294
c67a232861Thanks @salihozdemir! - Added QueryFunctionContext's values toqueryContextinmetaData.
3.56.8
Patch Changes
- Fixed
@tanstack/react-query-devtoolsdependency
3.56.7
Patch Changes
754da29b34Thanks @omeraplak! - Fixed@tanstack/react-query-devtoolsdependency
3.56.6
Patch Changes
- Upgraded
react-queryversion to 4.
- Updated the return value of
useGetIdentity. When thegetUserIdentityfunction is not defined, it returns{}instead ofundefined.
3.56.5
Patch Changes
- #2260
a97ec592dfThanks @salihozdemir! - Upgradedreact-queryversion to 4.
- #2260
a97ec592dfThanks @salihozdemir! - Updated the return value ofuseGetIdentity. When thegetUserIdentityfunction is not defined, it returns{}instead ofundefined.
3.56.4
Patch Changes
-
Fix useCan hook params keys.
Since
react-querystringifies the query keys, it will throw an error for a circular dependency if we includeReact.ReactNodeelements inside the keys. The feature in #2220(https://github.com/refinedev/refine/issues/2220) includes such change and to fix this, we need to removeiconproperty in theresource
-
Updated
<Refine/>component with memoization to prevent unwanted effects.- Fixed the issue:
react-query'squeryClientwas re-initializing on every render which was causing it to reset the query cache. - Memoized the
notificationProviderprop to prevent unnecessary re-renders. - Memoized the
resourcesprop to prevent unnecessary transform calls on every render.
- Fixed the issue:
-
- Fixed Browser back navigation is broken with
syncWithLocationand paginateduseTable- #2276 - Updated
pushandreplaceargs ofuseNavigation
- Fixed Browser back navigation is broken with
3.56.3
Patch Changes
-
#2278
8b11f8a267Thanks @biskuvit! - Fix useCan hook params keys.Since
react-querystringifies the query keys, it will throw an error for a circular dependency if we includeReact.ReactNodeelements inside the keys. The feature in #2220(https://github.com/refinedev/refine/issues/2220) includes such change and to fix this, we need to removeiconproperty in theresource
-
#2280
e22cac6d8bThanks @aliemir! - Updated<Refine/>component with memoization to prevent unwanted effects.- Fixed the issue:
react-query'squeryClientwas re-initializing on every render which was causing it to reset the query cache. - Memoized the
notificationProviderprop to prevent unnecessary re-renders. - Memoized the
resourcesprop to prevent unnecessary transform calls on every render.
- Fixed the issue:
- #2279
786fb08b8bThanks @omeraplak! - - Fixed Browser back navigation is broken withsyncWithLocationand paginateduseTable- #2276- Updated
pushandreplaceargs ofuseNavigation
- Updated
3.56.2
Patch Changes
- Fixed invalidation of authentication caches every time
checkAuthis run
3.56.1
Patch Changes
- #2271
40b84d35a3Thanks @omeraplak! - Fixed invalidation of authentication caches every timecheckAuthis run
3.56.0
Minor Changes
- Add React@18 support 🚀
3.55.0
Minor Changes
- #1718
b38620d842Thanks @omeraplak! - Add React@18 support 🚀
3.54.0
Minor Changes
-
Added config parameter to useCustomMutationHook to send headers.
const apiUrl = useApiUrl(); const { mutate } = useCustomMutation<ICategory>(); mutate({ url: `${API_URL}/categories`, method: "post", values: { title: "New Category", }, config: { headers: { Authorization: "Bearer ****", }, }, });
3.53.0
Minor Changes
-
#2245
e949df7f1cThanks @yildirayunlu! - Added config parameter to useCustomMutationHook to send headers.const apiUrl = useApiUrl(); const { mutate } = useCustomMutation<ICategory>(); mutate({ url: `${API_URL}/categories`, method: "post", values: { title: "New Category", }, config: { headers: { Authorization: "Bearer ****", }, }, });
3.52.0
Minor Changes
-
Added
useCustomMutationhook for custom mutation requests.import { useCustomMutation } from "@pankod/refine-core"; const { mutation } = useCustomMutation(); mutation({ url: "https://api.example.com/users", method: "POST", values: { name: "John Doe", email: "johndoe@mail.com", }, });
3.51.0
Minor Changes
-
#2229
878e9a105eThanks @yildirayunlu! - AddeduseCustomMutationhook for custom mutation requests.import { useCustomMutation } from "@pankod/refine-core"; const { mutation } = useCustomMutation(); mutation({ url: "https://api.example.com/users", method: "POST", values: { name: "John Doe", email: "johndoe@mail.com", }, });
3.50.0
Minor Changes
-
Pass the full
resourceto theaccessControlProvidercan method. This will enable Attribute Based Access Control (ABAC), for example granting permissions based on the value of a field in the resource object.const App: React.FC = () => { <Refine // other providers and props accessControlProvider={{ can: async ({ resource, action, params }) => { if (resource === "posts" && action === "edit") { return Promise.resolve({ can: false, reason: "Unauthorized", }); } // or you can access directly *resource object // const resourceName = params?.resource?.name; // const anyUsefulOption = params?.resource?.options?.yourUsefulOption; // if (resourceName === "posts" && anyUsefulOption === true && action === "edit") { // return Promise.resolve({ // can: false, // reason: "Unauthorized", // }); // } return Promise.resolve({ can: true }); }, }} />; };
3.49.0
Minor Changes
-
#2222
43e92b9785Thanks @omeraplak! - Pass the fullresourceto theaccessControlProvidercan method. This will enable Attribute Based Access Control (ABAC), for example granting permissions based on the value of a field in the resource object.const App: React.FC = () => { <Refine // other providers and props accessControlProvider={{ can: async ({ resource, action, params }) => { if (resource === "posts" && action === "edit") { return Promise.resolve({ can: false, reason: "Unauthorized", }); } // or you can access directly *resource object // const resourceName = params?.resource?.name; // const anyUsefulOption = params?.resource?.options?.yourUsefulOption; // if (resourceName === "posts" && anyUsefulOption === true && action === "edit") { // return Promise.resolve({ // can: false, // reason: "Unauthorized", // }); // } return Promise.resolve({ can: true }); }, }} />; };
3.48.0
Minor Changes
-
All of the refine packages have dependencies on the
@pankod/refine-corepackage. So far we have managed these dependencies withpeerDependencies+dependenciesbut this causes issues like #2183. (having more than one @pankod/refine-core version in node_modules and creating different instances)Managing as
peerDependencies+devDependenciesseems like the best way for now to avoid such issues.
Patch Changes
- Fix adding the current path to the
toparameter when redirecting to the login page afterlogout- #2211
3.47.0
Minor Changes
-
#2217
b4aae00f77Thanks @omeraplak! - All of the refine packages have dependencies on the@pankod/refine-corepackage. So far we have managed these dependencies withpeerDependencies+dependenciesbut this causes issues like #2183. (having more than one @pankod/refine-core version in node_modules and creating different instances)Managing as
peerDependencies+devDependenciesseems like the best way for now to avoid such issues.
3.46.0
Minor Changes
-
Update notification props in data hooks of
@pankod/refine-coreto cover dynamic notifications.Now users will be able to show notifications according to the API response by assigning a function which returns
OpenNotificationParamsinstead of anOpenNotificationParamsobject.Example
{ const { mutate } = useCreate({ /* ... */ successNotification: (data, values, resource) => ({ message: data?.message ?? "Success!", type: "success", description: data?.description; }), errorNotification: (error, values, resource) => ({ message: error?.message ?? error?.code ?? "Error!", type: "error", description: error?.reason; }) /* ... */ }); }
3.45.0
Minor Changes
-
#2177
5a805c789aThanks @aliemir! - Update notification props in data hooks of@pankod/refine-coreto cover dynamic notifications.Now users will be able to show notifications according to the API response by assigning a function which returns
OpenNotificationParamsinstead of anOpenNotificationParamsobject.Example
{ const { mutate } = useCreate({ /* ... */ successNotification: (data, values, resource) => ({ message: data?.message ?? "Success!", type: "success", description: data?.description; }), errorNotification: (error, values, resource) => ({ message: error?.message ?? error?.code ?? "Error!", type: "error", description: error?.reason; }) /* ... */ }); }
3.44.0
Minor Changes
- Added ability to compare
orfilters. This was a missing feature on filters inuseTablehook. With this feature, we will preventorfilter bugs (Resolves #2124) such as re-adding the same filters and being unable to modifyorfilter. To removeorfilter withmergebehavior, you should pass an empty object asvalue.
Patch Changes
-
Fix redirection after submit in
useForm. Botheditandcreatewill redirect tolist(it waseditpreviously)Resolves #2123
3.43.1
Patch Changes
-
#2172
c33d13eb15Thanks @aliemir! - Fix redirection after submit inuseForm. Botheditandcreatewill redirect tolist(it waseditpreviously)Resolves #2123
3.43.0
Minor Changes
- #2164
4d5f6b25e5Thanks @aliemir! - Added ability to compareorfilters. This was a missing feature on filters inuseTablehook. With this feature, we will preventorfilter bugs (Resolves #2124) such as re-adding the same filters and being unable to modifyorfilter. To removeorfilter withmergebehavior, you should pass an empty object asvalue.
3.42.0
Minor Changes
-
@pankod/refine-core- Added extra params to
useSubscriptionanduseResourceSubscription useOne,useManyanduseListpassed extra params to own subscription hook.
@pankod/refine-hasura- Added
liveProvider.
To see an example of how to use it, check out
here.@pankod/refine-nhost- Added
liveProvider.
To see an example of how to use it, check out
here.@pankod/refine-graphql- Added
liveProvider.
- Added extra params to
Patch Changes
- Fixed it to appear in menu items even if
Listis not given in resources #2147
3.41.1
Patch Changes
- #2151
d4c7377361Thanks @omeraplak! - Fixed it to appear in menu items even ifListis not given in resources #2147
3.41.0
Minor Changes
-
#2120
2aa7aace52Thanks @salihozdemir! - ###@pankod/refine-core- Added extra params to
useSubscriptionanduseResourceSubscription useOne,useManyanduseListpassed extra params to own subscription hook.
@pankod/refine-hasura- Added
liveProvider.
To see an example of how to use it, check out
here.@pankod/refine-nhost- Added
liveProvider.
To see an example of how to use it, check out
here.@pankod/refine-graphql- Added
liveProvider.
- Added extra params to
3.40.0
Minor Changes
-
Add a simple and transparent telemetry module to collect usage statistics defined within a very limited scope.
Tracking is completely safe and anonymous. It does not contain any personally identifiable information and does not use cookies. Participation is optional and users can opt out easily.
For more information, you can check the documentation.
3.39.0
Minor Changes
-
#2078
868bb943adThanks @yildirayunlu! - Add a simple and transparent telemetry module to collect usage statistics defined within a very limited scope.Tracking is completely safe and anonymous. It does not contain any personally identifiable information and does not use cookies. Participation is optional and users can opt out easily.
For more information, you can check the documentation.
3.38.2
Patch Changes
-
- The redirect method that return from
useFormupdated to be avaiable for passingid.
const { redirect } = useForm(); redirect("edit", id);- Returning API response to
onFinishfunction for successful mutations
- The redirect method that return from
3.38.1
Patch Changes
-
#2089
ee8e8bbd6cThanks @ozkalai! - - The redirect method that return fromuseFormupdated to be avaiable for passingid.const { redirect } = useForm(); redirect("edit", id);- Returning API response to
onFinishfunction for successful mutations
- Returning API response to
3.38.0
Minor Changes
-
useLogis converted to useQuery mutation.// before const { log } = useLog(); log({ resource: 'posts', action: 'create', data: { id: 1 } });// after const { log } = useLog(); const { mutation } = log; mutation({ resource: 'posts', action: 'create', data: { id: 1 } });
Patch Changes
- Fixed
useBreadcrumbhook throwsconsole.warneven if i18nProvider is not used - #2103
3.37.0
Minor Changes
-
#2049
98966b586fThanks @yildirayunlu! -useLogis converted to useQuery mutation.// before const { log } = useLog(); log({ resource: 'posts', action: 'create', data: { id: 1 } });// after const { log } = useLog(); const { mutation } = log; mutation({ resource: 'posts', action: 'create', data: { id: 1 } });
Patch Changes
- #2104
9d77c63a92Thanks @omeraplak! - FixeduseBreadcrumbhook throwsconsole.warneven if i18nProvider is not used - #2103
3.36.0
Minor Changes
-
Ability to disable server-side pagination on
useTableanduseListhooks.Implementation
Added
hasPaginationproperty touseTableto enable/disable pagination. UpdateduseListconfig with no pagination option. SethasPaginationtofalseto disable pagination.useTablehook uses theuseListhook under the hood and propagates thehasPaginationproperty to it. Also setting pagination related return values toundefinedfor better type check on the user side.Use Cases
In some data providers, some of the resources might not support pagination which was not supported prior to these changes. To handle the pagination on the client-side or to disable completely, users can set
hasPaginationtofalse.
Patch Changes
-
Added
actionstranslate support for CRUD operations (list,create,edit,show) in theuseBreadcrumbuseBreadcrumbhook.#️⃣ First, We need to add the
actionskey to the translation file."actions": { "list": "List", "create": "Create", "edit": "Edit", "show": "Show" },#️⃣ If you don't provide the
actionskey,useBreadcrumbwill try to find thebuttonskey in thetranslationfile for backward compatibility."buttons": { "list": "List", "create": "Create", "edit": "Edit", "show": "Show" },🎉 You can check the code part of this pull request to see how it works here👇🏼
const key = `actions.${action}`; const actionLabel = translate(key); if (actionLabel === key) { console.warn( `Breadcrumb missing translate key for the "${action}" action. Please add "actions.${action}" key to your translation file. For more information, see https://refine.dev/docs/core/hooks/useBreadcrumb/#i18n-support`, ); breadcrumbs.push({ label: translate(`buttons.${action}`, humanizeString(action)), }); } else { breadcrumbs.push({ label: translate(key, humanizeString(action)), }); }
3.35.0
Minor Changes
-
#2050
635cfe9fdbThanks @ozkalai! - Ability to disable server-side pagination onuseTableanduseListhooks.Implementation
Added
hasPaginationproperty touseTableto enable/disable pagination. UpdateduseListconfig with no pagination option. SethasPaginationtofalseto disable pagination.useTablehook uses theuseListhook under the hood and propagates thehasPaginationproperty to it. Also setting pagination related return values toundefinedfor better type check on the user side.Use Cases
In some data providers, some of the resources might not support pagination which was not supported prior to these changes. To handle the pagination on the client-side or to disable completely, users can set
hasPaginationtofalse.
Patch Changes
-
#2069
ecde34a9b3Thanks @biskuvit! - Addedactionstranslate support for CRUD operations (list,create,edit,show) in theuseBreadcrumbuseBreadcrumbhook.#️⃣ First, We need to add the
actionskey to the translation file."actions": { "list": "List", "create": "Create", "edit": "Edit", "show": "Show" },#️⃣ If you don't provide the
actionskey,useBreadcrumbwill try to find thebuttonskey in thetranslationfile for backward compatibility."buttons": { "list": "List", "create": "Create", "edit": "Edit", "show": "Show" },🎉 You can check the code part of this pull request to see how it works here👇🏼
const key = `actions.${action}`; const actionLabel = translate(key); if (actionLabel === key) { console.warn( `Breadcrumb missing translate key for the "${action}" action. Please add "actions.${action}" key to your translation file. For more information, see https://refine.dev/docs/core/hooks/useBreadcrumb/#i18n-support`, ); breadcrumbs.push({ label: translate(`buttons.${action}`, humanizeString(action)), }); } else { breadcrumbs.push({ label: translate(key, humanizeString(action)), }); }
3.34.2
Patch Changes
- Fixed
useImportonFinishtwice call bug.
3.34.1
Patch Changes
- #2047
0338ce9d6bThanks @salihozdemir! - FixeduseImportonFinishtwice call bug.
3.34.0
Minor Changes
- Added i18n support for resource names on
useBreadcrumbhook.
- Export
RefinePropsandResourcePropstype.
Patch Changes
- We have fixed texts with translations of default login pages in Material UI and Headless.
3.33.0
Minor Changes
- #2030
d96ba1e9c8Thanks @biskuvit! - Added i18n support for resource names onuseBreadcrumbhook.
- #1922
12f08ae6a3Thanks @yildirayunlu! - ExportRefinePropsandResourcePropstype.
Patch Changes
- #2029
b257d87fefThanks @ozkalai! - We have fixed texts with translations of default login pages in Material UI and Headless.
3.32.0
Minor Changes
- Add
useMenuhook to@pankod/refine-core
Patch Changes
- Add custom route support to
defaultOpenKeysinuseMenu
- Handle the
undefinedcase at audit-log logger in data hooks.
- Remove dashboard item in
useMenuhook
3.31.0
Minor Changes
498c425a0eThanks @omeraplak! - AdduseMenuhook to@pankod/refine-core
Patch Changes
498c425a0eThanks @omeraplak! - Add custom route support todefaultOpenKeysinuseMenu
498c425a0eThanks @omeraplak! - Handle theundefinedcase at audit-log logger in data hooks.
- #2009
5b893a9bffThanks @aliemir! - Remove dashboard item inuseMenuhook
3.30.0
Minor Changes
- Add
useMenuhook to@pankod/refine-core
Patch Changes
- Add custom route support to
defaultOpenKeysinuseMenu
- Handle the
undefinedcase at audit-log logger in data hooks.
3.29.2
Patch Changes
- Fix hook-inside-hook call in
notificationProvidersetup at<Refine/>
3.29.1
Patch Changes
- #1973
206540971bThanks @aliemir! - Fix hook-inside-hook call innotificationProvidersetup at<Refine/>
3.29.0
Minor Changes
- Updated
notificationProviderprop in theRefinewrapper component to be able to lazily initialized.
3.28.0
Minor Changes
- Updated
notificationProviderprop in theRefinewrapper component to be able to lazily initialized.
3.27.0
Minor Changes
- Updated
notificationProviderprop in theRefinewrapper component to be able to lazily initialized.
3.26.0
Minor Changes
- #1896
2ba2a96fd2Thanks @aliemir! - UpdatednotificationProviderprop in theRefinewrapper component to be able to lazily initialized.
3.23.2
Patch Changes
-
#1873
2deb19babfThanks @aliemir! - Removed dummy default values from internal contexts. Updated contexts:- Auth
- Access Control
- Notification
- Translation (i18n)
- unsavedWarn
BREAKING:
useGetLocalehook now can returnundefinedinstead of a fallback value ofenin cases ofi18nProviderbeingundefined.
3.23.1
Patch Changes
3281378b11Thanks @rassie! - Fix: Don't "humanize" labels in breadcrumbs
3.23.0
Minor Changes
- #1843
31850119e0Thanks @salihozdemir! - AdduseBreadcrumbhook andBreadrumbcomponent for@pankod/refine-antdpackage