16 KiB
@refinedev/remix-router
3.0.0
Major Changes
-
#5355
5acc257f8bThanks @rodbs! - Upgrade to Remix v2Upgraded
@refinedev/remix-routerto useRemix v2. This version change does not contain any breaking changes on the@refinedev/remix-routerside.Depending on your project's status, if you decide to upgrade to
Remix v2, you may or may not need to make necessary changes to your project. Please refer to the Remix v2 upgrade guide for more information.If your project is created with
create-refine-appwhich already initializes Remix projects using the v2 routing convention, you'll need to make the below changes to get rid of the warnings:/** @type {import('@remix-run/dev').AppConfig} */ module.exports = { - future: { - v2_routeConvention: true, - }, };Due to the change in its default value, you may also need to set
serverModuleFormatto"cjs"in yourremix.config.jsfile:/** @type {import('@remix-run/dev').RemixConfig */ module.exports = { + serverModuleFormat: "cjs", };Other than the changes mentioned above,
@refinedev/remix-routerand rest of the Refine packages should work as expected without requiring any changes.Migration Guide for
@refinedev/remix-routerInstall the latest version of
@refinedev/remix-routerand@refinedev/cli:npm i @refinedev/remix-router@latest @refinedev/cli@latestYou'll also need to update your remix dependencies:
npm i @remix-run/node@latest @remix-run/react@latest @remix-run/serve@latestPlease refer to the Remix v2 upgrade guide for more information.
You may also receive a warning when you try to build and run your production build on your local. This is because
@remix-run/serverequires a built path to be passed to it.@refinedev/cliwill provide a fallback value for this which may work for your app but CLI will still warn you about it. You can either ignore the warning or provide a built path tostartcommand.{ "scripts": { - "start": "refine start", + "start": "refine start ./build/index.js", }, }There should be no changes necessary regarding
@refinedev/remix-routerbut your app may need to be updated according to the changes inRemix v2. Please refer to the Remix v2 upgrade guide for more information.
2.3.1
Patch Changes
- #5425
190af9fce2Thanks @aliemir! - Updated@refinedev/corepeer dependencies to latest (^4.46.1)
2.3.0
Minor Changes
- #4741
026ccf34356Thanks @aliemir! - AddedsideEffects: falsetopackage.jsonto help bundlers tree-shake unused code.
2.2.0
Minor Changes
- #4741
026ccf34356Thanks @aliemir! - AddedsideEffects: falsetopackage.jsonto help bundlers tree-shake unused code.
2.1.0
Minor Changes
-
Thanks @aliemir, @alicanerdurmaz, @batuhanW, @salihozdemir, @yildirayunlu, @recepkutuk!
parseTableParamshelper is added to let users parse the query params in loaders to persistsyncWithLocationfeature in tables. -
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 your router to refine.
The legacy
routerProviderand its exports are now deprecated but accessible at@refinedev/remix-router/legacypath.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 in@remix-run/react. It accepts a config object and navigates to the given path. UsesuseNavigatehook under the hood.back: Which returns a function to handle the navigation in@remix-run/react. It navigates back to the previous page. UsesuseNavigatehook under the hood.parse: Which returns a function to parse the given path and returns theresource,id,actionand additionalparams. UsesuseParamsanduseLocationhooks under the hood.Link: A component that acceptstoprop and renders a link to the given path. UsesLinkcomponent from@remix-run/reactunder 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# @pankod/refine-remix-router splat route to render the matching action component for a resource. We're encouraging our users to use file based routing instead of# @pankod/refine-remix-router splat 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! 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
1.9.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
1.8.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
1.7.2
Patch Changes
- #3779
2acb0cd8ad6Thanks @aliemir! - Updated the brokenPromptwithuseBlockerinstead of an unsafe workaround.
1.7.1
Patch Changes
- #3779
2acb0cd8ad6Thanks @aliemir! - Updated the brokenPromptwithuseBlockerinstead of an unsafe workaround.
1.7.0
Minor Changes
-
Added ability to manage the initial route of refine by binding
initialRoutevariable toRemixRouteComponentcomponent. -
Add splat route support to remix with
handleRefineParamshelper.
1.6.0
Minor Changes
-
Added ability to manage the initial route of refine by binding
initialRoutevariable toRemixRouteComponentcomponent. -
Add splat route support to remix with
handleRefineParamshelper.
1.5.0
Minor Changes
-
#2486
ee4d0d112aThanks @aliemir! - Added ability to manage the initial route of refine by bindinginitialRoutevariable toRemixRouteComponentcomponent. -
#2486
ee4d0d112aThanks @aliemir! - Add splat route support to remix withhandleRefineParamshelper.
1.4.0
Minor Changes
- Update type declaration generation with
tscinstead oftsupfor better navigation throughout projects source code.
1.3.0
Minor Changes
- #2440
0150dcd070Thanks @aliemir! - Update type declaration generation withtscinstead oftsupfor better navigation throughout projects source code.
1.2.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; }
1.2.2
Patch Changes
- #2415
f7c98f0ef9Thanks @biskuvit! - Fixed default login page is<LoginPage>.
1.2.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.
1.2.0
Minor Changes
- Add
checkAuthenticationto handle authentication processes more easily
1.1.0
Minor Changes
- #2323
c4157066bdThanks @omeraplak! - AddcheckAuthenticationto handle authentication processes more easily
1.0.2
Patch Changes
- Our Story with Remix begins 👊
1.0.1
Patch Changes
- #2305
db0157671dThanks @omeraplak! - Our Story with Remix begins 👊