43 KiB
@refinedev/nextjs-router
6.1.0
Minor Changes
-
#6159
ad401d52957bf831e47707e86cb1e2f8b8c20f4bThanks @alicanerdurmaz! - feat:<DocumentTitleHandler/>should populatedresource.meta.labelfield if it's not provided on the Refine's resource definition. From now on, users be able to use theresource.meta.labelfield to customize document title more easily.import { BrowserRouter, DocumentTitleHandler, } from "@refinedev/react-router-v6"; import { Refine } from "@refinedev/core"; const App = () => { return ( <BrowserRouter> <Refine /* ... */ > {/* ... */} <DocumentTitleHandler handler={({ action, params, resource }) => { const id = params?.id ?? ""; const actionPrefixMatcher = { create: "Create new ", clone: `#${id} Clone ${resource?.meta?.label}`, edit: `#${id} Edit ${resource?.meta?.label}`, show: `#${id} Show ${resource?.meta?.label}`, list: `${resource?.meta?.label}`, }; const suffix = " | <Company Name>"; const title = actionPrefixMatcher[action || "list"] + suffix; return title; }} /> </Refine> </BrowserRouter> ); };
6.0.6
Patch Changes
-
6bd14228760d3e1e205ea9248e427f9afa2ec046Thanks @BatuhanW! - chore: addedtypequalifier to imports used as type only.- import { A } from "./example.ts"; + import type { A } from "./example.ts";
6.0.5
Patch Changes
-
#5945
90930b381d8d369c63bc59beedf69c391875166dThanks @aliemir! - chore: addedtypequalifier to imports used as type only.- import { A } from "./example.ts"; + import type { A } from "./example.ts";
6.0.4
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.
6.0.3
Patch Changes
-
#5881
ba719f6ea26Thanks @aliemir! - fix:/parse-table-paramsexport in node10 module resolutions/parse-table-paramssubpath export is not correctly resolved bynode10module resolutions. -
#5850
c2ef59bf82fThanks @aliemir! - fix: replace imports ofqswith default importsUpdated
qsimports and usage to prevent issues with ESM builds and to ensure correctly importing the module. -
#5881
ba719f6ea26Thanks @aliemir! - fix: declaration files in node10, node16 and nodenext module resolutions -
#5849
8a8f88b2c30Thanks @aliemir! - fix: replacenext/*imports with extensions in ESM buildsUpdated imports from
next/*tonext/*.jsto prevent issues with ESM builds and to ensure correctly importing the module.
6.0.2
Patch Changes
-
#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. -
#5754
56ed144a0f5Thanks @alicanerdurmaz! - chore: TypeScript upgraded to v5.x.x. #5752
6.0.1
Patch Changes
- #5695
79865affa1cThanks @BatuhanW! - chore: apply biome format and fix lint errors.
6.0.0
Major Changes
-
#5573
546df06482Thanks @alicanerdurmaz! - With this version, the@refinedev/nextjs-routerpackage now starts supporting Next.js@14 and App Router by default. You can upgrade your application by following the upgrade guide.We recommend that projects using Ant Design refrain from upgrading at the moment due to the incompatibility between Ant Design and Next.js 14 Pages Router. For more detailed information, you can refer to the Known Issues document in Ant Design here.
Upgrade Guide
npm i next@14 @refinedev/nextjs-router@latestSee Next.js 14 Upgrade Guide and Next.js 14 Codemods for more information.
Changes to default export
Default export for
@refinedev/nextjs-routeris nowApp Routerinstead ofPages.If you are using
Pages, update your imports as follows:- import routerProvider from "@refinedev/nextjs-router"; + import routerProvider from "@refinedev/nextjs-router/pages";If you are using
App Router, update your imports as follows:- import routerProvider from "@refinedev/nextjs-router/app"; + import routerProvider from "@refinedev/nextjs-router";Changes to
parseTableParamsimportIf you will use
parseTableParamson client side for App Router, you can use the following import:import { parseTableParams } from "@refinedev/nextjs-router";parseTableParamsfrom@refinedev/nextjs-routerhas"use client"directive.If you want to use
parseTableParamson server side for App Router, you can use the following import:import parseTableParams from "@refinedev/nextjs-router/parse-table-params";parseTableParamsfrom@refinedev/nextjs-router/parse-table-paramsdoesn't have"use client"directive.Dropped Refine v3 router provider legacy support
Now,
@refinedev/nextjs-routeronly supports Refine v4 router provider.The following exports are removed:
- @refinedev/nextjs-router/legacy - @refinedev/nextjs-router/legacy-app - @refinedev/nextjs-router/legacy-pages
Patch Changes
- #5573
546df06482Thanks @alicanerdurmaz! - chore: add "use client" directive to exported files to work with nextjs app router
5.5.7
Patch Changes
-
#5597
1738981da0Thanks @alicanerdurmaz! - fix:metahas corrupted route parameters.parsefunction from@refinedev/nextjs-routerprovides returns search params as following structure:{ "pageSize": "25", "current": "1", "sorters[0][field]": "status", "sorters[0][order]": "asc", "filters[0][field]": "status", "filters[0][value]": "draft", "filters[0][operator]": "contains" }This structure is not predictable and not sanitazble. So,
parsefunction has been updated to provide following structure:{ "pageSize": "25", "current": "1", "sorters": [ { "field": "status", "order": "asc" } ], "filters": [ { "field": "status", "value": "draft", "operator": "contains" } ] }With this schema we can easily sanitize, deduplicate and predict the structure of the query parameters.
5.5.6
Patch Changes
- #5549
61215d3b41Thanks @aliemir! - Updated index exports to provide appropriate types for the exported elements. Resolves #5548
5.5.5
Patch Changes
- #5425
190af9fce2Thanks @aliemir! - Updated@refinedev/corepeer dependencies to latest (^4.46.1)
5.5.4
Patch Changes
- #5114
00a9252c5deThanks @alicanerdurmaz! - feat:nextupdated to latest version.
5.5.3
Patch Changes
- #5114
00a9252c5deThanks @alicanerdurmaz! - feat:nextupdated to latest version.
5.5.2
Patch Changes
-
#5022
80513a4e42fThanks @BatuhanW! - chore: update README.md- fix grammar errors.
- make all README.md files consistent.
- add code example code snippets.
5.5.1
Patch Changes
-
#5022
80513a4e42fThanks @BatuhanW! - chore: update README.md- fix grammar errors.
- make all README.md files consistent.
- add code example code snippets.
5.5.0
Minor Changes
- #4741
026ccf34356Thanks @aliemir! - AddedsideEffects: falsetopackage.jsonto help bundlers tree-shake unused code.
5.4.0
Minor Changes
- #4741
026ccf34356Thanks @aliemir! - AddedsideEffects: falsetopackage.jsonto help bundlers tree-shake unused code.
5.3.2
Patch Changes
- #4466
a398c19b023Thanks @aliemir! - Fixed the unhandled nullablepathnameissue returning fromusePathnamehook for theappDirrouter.
5.3.1
Patch Changes
- #4466
a398c19b023Thanks @aliemir! - Fixed the unhandled nullablepathnameissue returning fromusePathnamehook for theappDirrouter.
5.3.0
Minor Changes
-
#4313
28fe67047a0Thanks @abdellah711! - feat: dynamic window title for NextJSpagesdirectoryThis feature enables users to generate document titles for each page in NextJS
pagesdirectory. To activate it, users need to include theDocumentTitleHandlercomponent within the<Refine>component. By default, theDocumentTitleHandlerwill generate titles using thegenerateDefaultDocumentTitleexported from@refinedev/core.The
DocumentTitleHandlercomponent accepts an optional prop calledhandler, which is a callback function. This function is triggered whenever thepathnamechanges and receives an object with the following parameters:{ resource, // 'posts' action, // 'create' params, // {id: 1} pathname, // '/posts/create' autoGeneratedTitle; // 'Create new Post | refine' }The
handlercallback should return the new title based on the provided parameters.To update the title in a child component, the user can use the
useDocumentTitlehook. It accepts either a string representing the new title or an object with the propertyi18nKeyif the app supports multiple languages.useDocumentTitle({ i18nKey: "documentTitle.default" });Note that this hook doesn't support SSR, and it will generate the titles in the client-side only.
5.2.0
Minor Changes
-
#4313
28fe67047a0Thanks @abdellah711! - feat: dynamic window title for NextJSpagesdirectoryThis feature enables users to generate document titles for each page in NextJS
pagesdirectory. To activate it, users need to include theDocumentTitleHandlercomponent within the<Refine>component. By default, theDocumentTitleHandlerwill generate titles using thegenerateDefaultDocumentTitleexported from@refinedev/core.The
DocumentTitleHandlercomponent accepts an optional prop calledhandler, which is a callback function. This function is triggered whenever thepathnamechanges and receives an object with the following parameters:{ resource, // 'posts' action, // 'create' params, // {id: 1} pathname, // '/posts/create' autoGeneratedTitle; // 'Create new Post | refine' }The
handlercallback should return the new title based on the provided parameters.To update the title in a child component, the user can use the
useDocumentTitlehook. It accepts either a string representing the new title or an object with the propertyi18nKeyif the app supports multiple languages.useDocumentTitle({ i18nKey: "documentTitle.default" });Note that this hook doesn't support SSR, and it will generate the titles in the client-side only.
5.1.6
Patch Changes
- #4160
9dc8ba1dd81Thanks @joshbaumann! - fix: unsaved changes prompt not showing when the browser is refreshed.
5.1.5
Patch Changes
- #4160
9dc8ba1dd81Thanks @joshbaumann! - fix: unsaved changes prompt not showing when the browser is refreshed.
5.1.4
Patch Changes
- #3987
d7d68e3ff68Thanks @aliemir! - AddisReadycheck toparsemethod for/pagesto wait until the correct values are returned from therouter.
5.1.3
Patch Changes
- #3987
d7d68e3ff68Thanks @aliemir! - AddisReadycheck toparsemethod for/pagesto wait until the correct values are returned from therouter.
5.1.2
Patch Changes
- #3893
d8c0a2f1cd1Thanks @aliemir! - Fixed the export ofRefineRoutesat/apppath. (Thanks to @thomas-advantitge for the #3863)
5.1.1
Patch Changes
- #3893
d8c0a2f1cd1Thanks @aliemir! - Fixed the export ofRefineRoutesat/apppath. (Thanks to @thomas-advantitge for the #3863)
5.1.0
Minor Changes
-
Thanks @aliemir, @alicanerdurmaz, @batuhanW, @salihozdemir, @yildirayunlu, @recepkutuk! We're releasing a new way to connect your router to refine.
The legacy
routerProviderand its exports are now deprecated but accessible at@refinedev/nextjs-router/legacy-appand@refinedev/nextjs-router/legacy-pages.The new
routerBindingsare smaller and more flexible than the previos one.New
routerBindingsexportNew
routerBindingscontains following properties;go: Which returns a function to handle the navigation innext. It accepts a config object and navigates to the given path. UsesuseRouterhook under the hood.back: Which returns a function to handle the navigation innext. It navigates back to the previous page. UsesuseRouterhook under the hood.parse: Which returns a function to parse the given path and returns theresource,id,actionand additionalparams. UsesuseRouterfor/pagesdir andusePathnameanduseSearchParamsfor/appdir.Link: A component that acceptstoprop and renders a link to the given path. UsesLinkcomponent fromnext/linkunder the hood.
Complemetary Components
-
RefineRoutes- A component that renders the routes for the resources when the actions are defined as components. This can be used to achieve the legacy behavior ofrouterProviderprop.RefineRoutescomponent accepts a render function as a child and passesJSX.Elementif there's a match for the given path,undefinedis passed otherwise. You can use this in[[...refine]]route to render the matching action component for a resource. We're encouraging our users to use file based routing instead of[[...refine]]route which provides more flexibility and a better development experience with its performance benefits. -
NavigateToResource- A component that navigates to the firstlistaction of theresourcesarray of<Refine>. Optionally, you can pass aresourceprop to navigate tolistaction of the resource. This can be placed at theindexroute of your app to redirect to the first resource. -
UnsavedChangesNotifier- This component handles the prompt when the user tries to leave the page with unsaved changes. It can be placed under theRefinecomponent.
-
Thanks @aliemir, @alicanerdurmaz, @batuhanW, @salihozdemir, @yildirayunlu, @recepkutuk!
AuthProvideris renamed toLegacyAuthProviderwith refine@4. Components and functions are updated to supportLegacyAuthProvider. -
Thanks @aliemir, @alicanerdurmaz, @batuhanW, @salihozdemir, @yildirayunlu, @recepkutuk!
parseTableParamshelper is added to let users parse the query params in SSR methods to persistsyncWithLocationfeature in tables. -
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
4.5.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
4.4.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
4.3.0
Minor Changes
- #3387
a4731bd8fb4Thanks @vanflux! - Forwarding ref on RefineLink component
4.2.0
Minor Changes
- #3387
a4731bd8fb4Thanks @vanflux! - Forwarding ref on RefineLink component
4.1.0
Minor Changes
-
#3140
102bfbf3283Thanks @aliemir! - - Bumped Next.js to 13- Added support for experimental
appDiroption innext.config.jsto allow for the latest Next.js features.
pagesdirectoryCurrent support for
pagesdirectory has not changed and will continue to work as before. It will be supported as long asNext.jscontinues to support and prompts it as the stable way of working withNext.js.appDiroptionappDiroption is a new experimental feature inNext.jsthat introduces a bunch of new features. It is currently in beta and is not stable. It is not recommended to use it in production. But can be used alongside the currentpagesdirectory support.To use
appDiroption, you need to add it to yournext.config.jsfile.// next.config.js module.exports = { /* ... */ experimental: { appDir: true, }, };Using
appDirwith refineWe've needed to make some changes to the
@pankod/refine-nextjs-routerto make it work with the current structure of theappdirectory feature. To make sure these do not break the current support forpagesdirectory, we've added a new exports at the sub path@pankod/refine-nextjs-router/appthat can be used with theappDiroption.Note
To make optional catch-all routes to work with the
appdirectory, you need to define them as directories unlike the option of defining them as files withpagesdirectory.You need to use
NextRouteComponentfrom@pankod/refine-nextjs-router/appinstead ofNextRouteComponentfrom@pankod/refine-nextjs-routerwhen usingappDiroption.Inside your
layoutfile, you need to bindparamstorouterProviderto make sure@pankod/refine-nextjs-routercan work properly with the new structure.// app/[[...refine]]/layout.tsx "use client"; import routerProvider from "@pankod/refine-nextjs-router/app"; const Layout = ({ children, params }) => { return ( <Refine routerProvider={routerProvider.apply({ params })} /* ... */ > {children} </Refine> ); };Warning
Please note that, unlike the
routerProviderfrom the@pankod/refine-nextjs-router,routerProviderfrom@pankod/refine-nextjs-router/appis a function and you need to bindparamsto make it work properly.// app/[[...refine]]/page.tsx "use client"; import { NextRouteComponent } from "@pankod/refine-nextjs-router/app"; export default NextRouteComponent;Warning
You need to add
"use client";directive to bothlayout.tsxandpage.tsxinsideapp/[[...refine]]directory.Warning
checkAuthenticationdoes not work withappDir. We're aiming to release a substitute for it using middleware but for now its not included in this release. - Added support for experimental
4.0.0
Major Changes
-
#3140
102bfbf3283Thanks @aliemir! - - Bumped Next.js to 13- Added support for experimental
appDiroption innext.config.jsto allow for the latest Next.js features.
pagesdirectoryCurrent support for
pagesdirectory has not changed and will continue to work as before. It will be supported as long asNext.jscontinues to support and prompts it as the stable way of working withNext.js.appDiroptionappDiroption is a new experimental feature inNext.jsthat introduces a bunch of new features. It is currently in beta and is not stable. It is not recommended to use it in production. But can be used alongside the currentpagesdirectory support.To use
appDiroption, you need to add it to yournext.config.jsfile.// next.config.js module.exports = { /* ... */ experimental: { appDir: true, }, };Using
appDirwith refineWe've needed to make some changes to the
@pankod/refine-nextjs-routerto make it work with the current structure of theappdirectory feature. To make sure these do not break the current support forpagesdirectory, we've added a new exports at the sub path@pankod/refine-nextjs-router/appthat can be used with theappDiroption.Note
To make optional catch-all routes to work with the
appdirectory, you need to define them as directories unlike the option of defining them as files withpagesdirectory.You need to use
NextRouteComponentfrom@pankod/refine-nextjs-router/appinstead ofNextRouteComponentfrom@pankod/refine-nextjs-routerwhen usingappDiroption.Inside your
layoutfile, you need to bindparamstorouterProviderto make sure@pankod/refine-nextjs-routercan work properly with the new structure.// app/[[...refine]]/layout.tsx "use client"; import routerProvider from "@pankod/refine-nextjs-router/app"; const Layout = ({ children, params }) => { return ( <Refine routerProvider={routerProvider.apply({ params })} /* ... */ > {children} </Refine> ); };Warning
Please note that, unlike the
routerProviderfrom the@pankod/refine-nextjs-router,routerProviderfrom@pankod/refine-nextjs-router/appis a function and you need to bindparamsto make it work properly.// app/[[...refine]]/page.tsx "use client"; import { NextRouteComponent } from "@pankod/refine-nextjs-router/app"; export default NextRouteComponent;Warning
You need to add
"use client";directive to bothlayout.tsxandpage.tsxinsideapp/[[...refine]]directory.Warning
checkAuthenticationdoes not work withappDir. We're aiming to release a substitute for it using middleware but for now its not included in this release. - Added support for experimental
3.38.0
Minor Changes
-
Added
handleRefineParamshelper function to handle catch-all refine params. -
Added ability to parse catch-all refine route in Next.js router. This way, instead of creating multiple pages, users can only create one page at the root
[[...refine]].tsxand handle all params for the app. -
Added ability to manage the initial route of refine by binding
initialRoutevariable toNextRouteComponentcomponent.
3.37.0
Minor Changes
-
Added
handleRefineParamshelper function to handle catch-all refine params. -
Added ability to parse catch-all refine route in Next.js router. This way, instead of creating multiple pages, users can only create one page at the root
[[...refine]].tsxand handle all params for the app. -
Added ability to manage the initial route of refine by binding
initialRoutevariable toNextRouteComponentcomponent.
3.36.0
Minor Changes
-
#2486
ee4d0d112aThanks @aliemir! - AddedhandleRefineParamshelper function to handle catch-all refine params. -
#2486
ee4d0d112aThanks @aliemir! - Added ability to parse catch-all refine route in Next.js router. This way, instead of creating multiple pages, users can only create one page at the root[[...refine]].tsxand handle all params for the app. -
#2486
ee4d0d112aThanks @aliemir! - Added ability to manage the initial route of refine by bindinginitialRoutevariable toNextRouteComponentcomponent.
3.35.0
Minor Changes
- Add
initialDatasupport toDashboardPagefor@pankod/refine-nextjs-router.
3.34.0
Minor Changes
- #2142
dd00de215aThanks @ozkalai! - AddinitialDatasupport toDashboardPagefor@pankod/refine-nextjs-router.
3.33.0
Minor Changes
- Update type declaration generation with
tscinstead oftsupfor better navigation throughout projects source code.
3.32.0
Minor Changes
- #2440
0150dcd070Thanks @aliemir! - Update type declaration generation withtscinstead oftsupfor better navigation throughout projects source code.
3.31.3
Patch Changes
- Fixed default login page is
<LoginPage>.
-
🎉 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; }
3.31.2
Patch Changes
- #2415
f7c98f0ef9Thanks @biskuvit! - Fixed default login page is<LoginPage>.
3.31.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.31.0
Minor Changes
- Add React@18 support 🚀
3.30.0
Minor Changes
- #1718
b38620d842Thanks @omeraplak! - Add React@18 support 🚀
3.29.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.28.0
Minor Changes
-
e78b181b12Thanks @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.27.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.
3.26.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.25.6
Patch Changes
-
Created a wrapper
<Link>component for handlinghrefandtoprops. When usingtothe wrapper will pass it to thehrefprop. -
Updated dependencies []:
- @pankod/refine-core@3.36.0
3.25.5
Patch Changes
-
#2061
0237725cf3Thanks @salihozdemir! - Created a wrapper<Link>component for handlinghrefandtoprops. When usingtothe wrapper will pass it to thehrefprop. -
Updated dependencies [
ecde34a9b3,635cfe9fdb]:- @pankod/refine-core@3.35.0
3.25.4
Patch Changes
-
Add
legacyBehavior: falseto<Link/>component to migrate to the new Next.js Link behavior. next.js#36436 -
Updated dependencies []:
- @pankod/refine-core@3.34.0
3.25.3
Patch Changes
-
#2021
a0a895cae4Thanks @aliemir! - AddlegacyBehavior: falseto<Link/>component to migrate to the new Next.js Link behavior. next.js#36436 -
Updated dependencies [
d96ba1e9c8,b257d87fef,12f08ae6a3]:- @pankod/refine-core@3.33.0
3.25.2
Patch Changes
- We've updated Next.js version to
12.1.6
3.25.1
Patch Changes
- #1951
cc5f9ae78aThanks @omeraplak! - We've updated Next.js version to12.1.6
3.22.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. -
Updated dependencies [
2deb19babf]:- @pankod/refine-core@3.23.2