Skip to content

Commit

Permalink
release: november 2024 (#6445)
Browse files Browse the repository at this point in the history
- chore(chakra-ui): fix broken tsdoc links #6429 
- feat: export useInvalidateAuthStore hook #6405 Resolves #6341  
- feat(core): add `<MetaContext />` #6435 
- chore(antd): update @ant-design/icons and @ant-design/pro-layout dependencies #6369 Resolves #6363, #5931 
- feat(core,antd,mui,mantine,chakra-ui): add new prop to auth-page to p… #6432  Resolves #6431 
- fix(core): link component overrides to instead of go #6462 Resolves #6461 
- fix(react-hook-form): onChange handler autoSave check in useForm #6459 Resolves #6458 
- fix(core): link component ref type is too restrictive (#6464) Resolves #6463
  • Loading branch information
alicanerdurmaz authored Nov 7, 2024
1 parent 170aceb commit 4ff4335
Show file tree
Hide file tree
Showing 216 changed files with 1,746 additions and 1,091 deletions.
7 changes: 7 additions & 0 deletions .changeset/beige-cougars-add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@refinedev/chakra-ui": patch
---

chore(tsdoc): fix broken external documentation link

In TSDoc description of the `<EmailField />` component, link to the official documentation of Chakra UI was broken and couldn't be opened. This PR fixes the link by updating the URL to the correct one.
45 changes: 45 additions & 0 deletions .changeset/breezy-wolves-nail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
"@refinedev/chakra-ui": minor
"@refinedev/mantine": minor
"@refinedev/antd": minor
"@refinedev/core": minor
"@refinedev/mui": minor
---

feat: added new prop called `mutationVariables` to `<AuthPage />`. #6431
From now on, you can pass additional parameters to the `authProvider` methods using the `mutationVariables` prop of the `<AuthPage />` component.

```tsx
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
// ...
},
// ...
};
```

[Resolves #6431](https://github.com/refinedev/refine/issues/6431)
15 changes: 15 additions & 0 deletions .changeset/early-pets-march.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
"@refinedev/antd": minor
---

chore: update `@ant-design/icons` and `@ant-design/pro-layout` versions

Updated previously pinned versions of `@ant-design/icons` from `5.0.1` and `@ant-design/pro-layout` from `7.17.12` to latest versions. This minor update resolves the previous issues with `React@18` types and conflicting type ranges with `@ant-design/pro-layout` package.

After `@ant-design/icons` version `5.4.0` build issues and type issues are resolved. Following this release `@ant-design/pro-layout` also updated its dependency range to match the latest `@ant-design/icons` version.

Previously `@ant-design/icons` were pinned to `5.0.1` and recommended to pin in projects as well. After this update, you may also need to update the `@ant-design/icons` version in your project to match the latest version. (A range above `^5.5.1` is required to match `@refinedev/antd`).

[Resolves #6363](https://github.com/refinedev/refine/issues/6363)
[Resolves #5931 - previously resolved by #5934](https://github.com/refinedev/refine/issues/5931)
[Accompanies #6354 - `@ant-design/pro-layout` also depends on `express` dependency and updated its version in the latest release](https://github.com/refinedev/refine/pull/6354)
9 changes: 9 additions & 0 deletions .changeset/eight-drinks-compare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@refinedev/react-hook-form": patch
---

fix: onChange handler `autoSave` check in `useForm`

Autosave can now be explicitly disabled.

Resolves #6458
7 changes: 7 additions & 0 deletions .changeset/hip-spies-end.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@refinedev/inferencer": patch
---

chore: update `@ant-design/icons` version to match `@refinedev/antd`.

This is a patch release to update the `@ant-design/icons` version to match the `@refinedev/antd` version. Previously `@ant-design/icons` were pinned to `5.0.1` version to avoid conflicts with `React@18` and `@ant-design/pro-layout` packages. After `5.4.0` these issues are resolved and we can safely update the version to latest range.
9 changes: 9 additions & 0 deletions .changeset/red-cups-decide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@refinedev/core": minor
---

feat: exported useInvalidateAuthStore hook from auth hooks

Now you can invalide the users identity state and force a react query refresh using this hook

Resolves [#6341](https://github.com/refinedev/refine/issues/6341)
7 changes: 7 additions & 0 deletions .changeset/ten-radios-rush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@refinedev/core": minor
---

feat: Added `MetaContext` to share data between components, providers, and hooks.

> 🚨 Designed for internal use only.
17 changes: 17 additions & 0 deletions .changeset/three-cameras-hope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
"@refinedev/core": patch
---

fix: Added more flexibility to the [`<Link />`](https://refine.dev/docs/routing/components/link/) component's `ref` type by changing it from `HTMLAnchorElement` to `Element`.
From now on, we can pass any type of `ref` to the [`<Link />`](https://refine.dev/docs/routing/components/link/) component.

```tsx
// 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](https://github.com/refinedev/refine/issues/6463)
16 changes: 16 additions & 0 deletions .changeset/unlucky-spoons-shout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
"@refinedev/core": patch
---

fix: Priority logic between `to` and `go` props in [`Link`](https://refine.dev/docs/routing/components/link/) component.
From now on, the `to` prop has priority over the `go` prop. If both are passed, the `to` prop will be used.

```tsx
// 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](https://github.com/refinedev/refine/issues/6461)
35 changes: 35 additions & 0 deletions documentation/docs/authentication/components/auth-page/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,41 @@ const MyLoginPage = () => {
};
```

### mutationVariables

`mutationVariables` is used to pass additional variables to the `authProvider` methods.

```tsx
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
// ...
},
// ...
};
```

## API Reference

### Properties
Expand Down
1 change: 1 addition & 0 deletions documentation/docs/routing/components/link/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: <Link />
source: packages/core/src/components/link/index.tsx
---

`<Link />` is a component that is used to navigate to different pages in your application.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,41 @@ const MyLoginPage = () => {
};
```

### mutationVariables

`mutationVariables` is used to pass additional variables to the `authProvider` methods.

```tsx
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
// ...
},
// ...
};
```

## FAQ

### How can I remove the default title and logo ?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,41 @@ const MyLoginPage = () => {
};
```

### mutationVariables

`mutationVariables` is used to pass additional variables to the `authProvider` methods.

```tsx
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
// ...
},
// ...
};
```

## API Reference

### Properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,41 @@ const MyLoginPage = () => {
};
```

### mutationVariables

`mutationVariables` is used to pass additional variables to the `authProvider` methods.

```tsx
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
// ...
},
// ...
};
```

## API Reference

### Properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,43 @@ const MyLoginPage = () => {
};
```

### mutationVariables

`mutationVariables` is used to pass additional variables to the `authProvider` methods.

```tsx
import { AuthPage } from "@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
// ...
},
// ...
};
```

## API Reference

### Properties
Expand Down
2 changes: 1 addition & 1 deletion examples/app-crm-minimal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"dependencies": {
"@ant-design/cssinjs": "^1.17.2",
"@ant-design/icons": "5.0.1",
"@ant-design/icons": "^5.5.1",
"@ant-design/plots": "^1.2.5",
"@dnd-kit/core": "^6.0.8",
"@dnd-kit/modifiers": "^6.0.1",
Expand Down
1 change: 0 additions & 1 deletion examples/app-crm-minimal/src/components/icon/TextIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,5 @@ export const TextIconSvg = () => (
);

export const TextIcon = (props: Partial<CustomIconComponentProps>) => (
// @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
<Icon component={TextIconSvg} {...props} />
);
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ export const AccountSettings = ({ opened, setOpened, userId }: Props) => {
<Text strong>Account Settings</Text>
<Button
type="text"
// @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
icon={<CloseOutlined />}
onClick={() => closeModal()}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export const CurrentUser = () => {
>
<Button
style={{ textAlign: "left" }}
// @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
icon={<SettingOutlined />}
type="text"
block
Expand Down
Loading

0 comments on commit 4ff4335

Please sign in to comment.