Minor Changes
-
Thanks @aliemir, @alicanerdurmaz, @batuhanW, @salihozdemir, @yildirayunlu, @recepkutuk!
We're releasing a new way to connect your router to refine.The legacy
routerProvider
and its exports are now deprecated but accessible at@refinedev/nextjs-router/legacy-app
and@refinedev/nextjs-router/legacy-pages
.The new
routerBindings
are smaller and more flexible than the previos one.New
routerBindings
exportNew
routerBindings
contains following properties;go
: Which returns a function to handle the navigation innext
. It accepts a config object and navigates to the given path. UsesuseRouter
hook under the hood.back
: Which returns a function to handle the navigation innext
. It navigates back to the previous page. UsesuseRouter
hook under the hood.parse
: Which returns a function to parse the given path and returns theresource
,id
,action
and additionalparams
. UsesuseRouter
for/pages
dir andusePathname
anduseSearchParams
for/app
dir.Link
: A component that acceptsto
prop and renders a link to the given path. UsesLink
component fromnext/link
under 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 ofrouterProvider
prop.RefineRoutes
component accepts a render function as a child and passesJSX.Element
if there's a match for the given path,undefined
is 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 firstlist
action of theresources
array of<Refine>
. Optionally, you can pass aresource
prop to navigate tolist
action of the resource. This can be placed at theindex
route 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 theRefine
component.
-
Thanks @aliemir, @alicanerdurmaz, @batuhanW, @salihozdemir, @yildirayunlu, @recepkutuk!
AuthProvider
is renamed toLegacyAuthProvider
with refine@4. Components and functions are updated to supportLegacyAuthProvider
. -
Thanks @aliemir, @alicanerdurmaz, @batuhanW, @salihozdemir, @yildirayunlu, @recepkutuk!
parseTableParams
helper is added to let users parse the query params in SSR methods to persistsyncWithLocation
feature in tables. -
Thanks @aliemir, @alicanerdurmaz, @batuhanW, @salihozdemir, @yildirayunlu, @recepkutuk!
Moving to the@refinedev
scope 🎉🎉Moved to the
@refinedev
scope and updated our packages to use the new scope. From now on, all packages will be published under the@refinedev
scope with their new names.Now, we're also removing the
refine
prefix from all packages. So, the@pankod/refine-core
package is now@refinedev/core
,@pankod/refine-antd
is now@refinedev/antd
, and so on.