From bafc35b3c39259e33cd218bdff17cd88a9fa3355 Mon Sep 17 00:00:00 2001 From: Bernardo Sunderhus Date: Thu, 27 Oct 2022 11:54:41 +0000 Subject: [PATCH 1/2] fix(react-utilities): exposes internal methods used in API surface --- ...ct-utilities-4b8968e2-4358-44f1-9085-11dc0120eb70.json | 7 +++++++ .../react-utilities/etc/react-utilities.api.md | 8 ++++---- .../src/hooks/useIsomorphicLayoutEffect.ts | 1 - .../react-utilities/src/hooks/useMergedRefs.ts | 2 -- .../react-components/react-utilities/src/trigger/types.ts | 1 - 5 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 change/@fluentui-react-utilities-4b8968e2-4358-44f1-9085-11dc0120eb70.json diff --git a/change/@fluentui-react-utilities-4b8968e2-4358-44f1-9085-11dc0120eb70.json b/change/@fluentui-react-utilities-4b8968e2-4358-44f1-9085-11dc0120eb70.json new file mode 100644 index 00000000000000..11e4dc5d6a145e --- /dev/null +++ b/change/@fluentui-react-utilities-4b8968e2-4358-44f1-9085-11dc0120eb70.json @@ -0,0 +1,7 @@ +{ + "type": "minor", + "comment": "exposes internal methods that are used in the API surface", + "packageName": "@fluentui/react-utilities", + "email": "bernardo.sunderhus@gmail.com", + "dependentChangeType": "patch" +} diff --git a/packages/react-components/react-utilities/etc/react-utilities.api.md b/packages/react-components/react-utilities/etc/react-utilities.api.md index 1ed485eb38c865..6275961ede1d35 100644 --- a/packages/react-components/react-utilities/etc/react-utilities.api.md +++ b/packages/react-components/react-utilities/etc/react-utilities.api.md @@ -78,7 +78,7 @@ export function isResolvedShorthand>(sh // @internal export function mergeCallbacks(callback1: ((...args: Args) => void) | undefined, callback2: ((...args: Args) => void) | undefined): (...args: Args) => void; -// @internal +// @public export type RefObjectFunction = React_2.RefObject & ((value: T) => void); // @public @@ -133,7 +133,7 @@ export type SlotShorthandValue = React_2.ReactChild | React_2.ReactNode[] | Reac // @public export const SSRProvider: React_2.FC; -// @internal +// @public export type TriggerProps = { children?: React_2.ReactElement | ((props: TriggerChildProps) => React_2.ReactElement | null) | null; }; @@ -160,13 +160,13 @@ export function useForceUpdate(): DispatchWithoutAction; // @public export function useId(prefix?: string, providedId?: string): string; -// @internal +// @public export const useIsomorphicLayoutEffect: typeof React_2.useEffect; // @public export function useIsSSR(): boolean; -// @internal +// @public export function useMergedRefs(...refs: (React_2.Ref | undefined)[]): RefObjectFunction; // @internal (undocumented) diff --git a/packages/react-components/react-utilities/src/hooks/useIsomorphicLayoutEffect.ts b/packages/react-components/react-utilities/src/hooks/useIsomorphicLayoutEffect.ts index 03a58dbcc4662e..7c8a42b8b3196f 100644 --- a/packages/react-components/react-utilities/src/hooks/useIsomorphicLayoutEffect.ts +++ b/packages/react-components/react-utilities/src/hooks/useIsomorphicLayoutEffect.ts @@ -2,7 +2,6 @@ import * as React from 'react'; import { canUseDOM } from '../ssr/index'; /** - * @internal * React currently throws a warning when using useLayoutEffect on the server. To get around it, we can conditionally * useEffect on the server (no-op) and useLayoutEffect in the browser. We occasionally need useLayoutEffect to * ensure we don't get a render flash for certain operations, but we may also need affected components to render on diff --git a/packages/react-components/react-utilities/src/hooks/useMergedRefs.ts b/packages/react-components/react-utilities/src/hooks/useMergedRefs.ts index 699ec119603fd4..11464490c17df2 100644 --- a/packages/react-components/react-utilities/src/hooks/useMergedRefs.ts +++ b/packages/react-components/react-utilities/src/hooks/useMergedRefs.ts @@ -1,14 +1,12 @@ import * as React from 'react'; /** - * @internal * A Ref function which can be treated like a ref object in that it has an attached * current property, which will be updated as the ref is evaluated. */ export type RefObjectFunction = React.RefObject & ((value: T) => void); /** - * @internal * React hook to merge multiple React refs (either MutableRefObjects or ref callbacks) into a single ref callback that * updates all provided refs * @param refs - Refs to collectively update with one ref value. diff --git a/packages/react-components/react-utilities/src/trigger/types.ts b/packages/react-components/react-utilities/src/trigger/types.ts index 05f28c581b468e..161a500e0642cc 100644 --- a/packages/react-components/react-utilities/src/trigger/types.ts +++ b/packages/react-components/react-utilities/src/trigger/types.ts @@ -19,7 +19,6 @@ export type FluentTriggerComponent = { }; /** - * @internal * A trigger may have a children that could be either: * 1. A single element * 2. A render function that will receive properties and must return a valid element or null From f37399f3b5c06359f3a12af94b47311214928ad6 Mon Sep 17 00:00:00 2001 From: Bernardo Sunderhus Date: Fri, 28 Oct 2022 11:16:58 +0200 Subject: [PATCH 2/2] Update change/@fluentui-react-utilities-4b8968e2-4358-44f1-9085-11dc0120eb70.json Co-authored-by: ling1726 --- ...ui-react-utilities-4b8968e2-4358-44f1-9085-11dc0120eb70.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/change/@fluentui-react-utilities-4b8968e2-4358-44f1-9085-11dc0120eb70.json b/change/@fluentui-react-utilities-4b8968e2-4358-44f1-9085-11dc0120eb70.json index 11e4dc5d6a145e..7dfc5ecaa13ef3 100644 --- a/change/@fluentui-react-utilities-4b8968e2-4358-44f1-9085-11dc0120eb70.json +++ b/change/@fluentui-react-utilities-4b8968e2-4358-44f1-9085-11dc0120eb70.json @@ -1,6 +1,6 @@ { "type": "minor", - "comment": "exposes internal methods that are used in the API surface", + "comment": "feat: exposes internal methods that are used in the API surface", "packageName": "@fluentui/react-utilities", "email": "bernardo.sunderhus@gmail.com", "dependentChangeType": "patch"