Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(react-dialog): adopt custom JSX pragma #27475

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: adopts custom JSX pragma",
"packageName": "@fluentui/react-dialog",
"email": "bernardo.sunderhus@gmail.com",
"dependentChangeType": "patch"
}
1 change: 1 addition & 0 deletions packages/react-components/react-dialog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"dependencies": {
"@griffel/react": "^1.5.2",
"@fluentui/react-utilities": "^9.7.4",
"@fluentui/react-jsx-runtime": "^9.0.0-alpha.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont use carrets for pre-releases, this will create issue on consumers end when resolving deps. for such a fundamental part as custom JSX pragma it is even more dangerous.

"@fluentui/keyboard-keys": "^9.0.2",
"@fluentui/react-context-selector": "^9.1.17",
"@fluentui/react-shared-contexts": "^9.3.3",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import * as React from 'react';
/** @jsxRuntime classic */
/** @jsx createElement */

import { createElement } from '@fluentui/react-jsx-runtime';

import { DialogProvider, DialogSurfaceProvider } from '../../contexts';
import type { DialogState, DialogContextValues } from './Dialog.types';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import * as React from 'react';
import { getSlots } from '@fluentui/react-utilities';
/** @jsxRuntime classic */
/** @jsx createElement */

import { createElement } from '@fluentui/react-jsx-runtime';

import { getSlotsNext } from '@fluentui/react-utilities';
import type { DialogActionsState, DialogActionsSlots } from './DialogActions.types';

/**
* Render the final JSX of DialogActions
*/
export const renderDialogActions_unstable = (state: DialogActionsState) => {
const { slots, slotProps } = getSlots<DialogActionsSlots>(state);
const { slots, slotProps } = getSlotsNext<DialogActionsSlots>(state);

// TODO Add additional slots in the appropriate place
return <slots.root {...slotProps.root} />;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import * as React from 'react';
import { getSlots } from '@fluentui/react-utilities';
/** @jsxRuntime classic */
/** @jsx createElement */

import { createElement } from '@fluentui/react-jsx-runtime';

import { getSlotsNext } from '@fluentui/react-utilities';
import type { DialogBodyState, DialogBodySlots } from './DialogBody.types';

/**
* Render the final JSX of DialogBody
*/
export const renderDialogBody_unstable = (state: DialogBodyState) => {
const { slots, slotProps } = getSlots<DialogBodySlots>(state);
const { slots, slotProps } = getSlotsNext<DialogBodySlots>(state);

// TODO Add additional slots in the appropriate place
return <slots.root {...slotProps.root} />;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import * as React from 'react';
import { getSlots } from '@fluentui/react-utilities';
/** @jsxRuntime classic */
/** @jsx createElement */

import { createElement } from '@fluentui/react-jsx-runtime';

import { getSlotsNext } from '@fluentui/react-utilities';
import type { DialogContentState, DialogContentSlots } from './DialogContent.types';

/**
* Render the final JSX of DialogContent
*/
export const renderDialogContent_unstable = (state: DialogContentState) => {
const { slots, slotProps } = getSlots<DialogContentSlots>(state);
const { slots, slotProps } = getSlotsNext<DialogContentSlots>(state);

return <slots.root {...slotProps.root} />;
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import * as React from 'react';
import { getSlots } from '@fluentui/react-utilities';
/** @jsxRuntime classic */
/** @jsx createElement */

import { createElement } from '@fluentui/react-jsx-runtime';

import { getSlotsNext } from '@fluentui/react-utilities';
import type { DialogSurfaceState, DialogSurfaceSlots, DialogSurfaceContextValues } from './DialogSurface.types';
import { DialogSurfaceProvider } from '../../contexts';
import { Portal } from '@fluentui/react-portal';
Expand All @@ -8,7 +12,7 @@ import { Portal } from '@fluentui/react-portal';
* Render the final JSX of DialogSurface
*/
export const renderDialogSurface_unstable = (state: DialogSurfaceState, contextValues: DialogSurfaceContextValues) => {
const { slots, slotProps } = getSlots<DialogSurfaceSlots>(state);
const { slots, slotProps } = getSlotsNext<DialogSurfaceSlots>(state);

return (
<Portal>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import * as React from 'react';
import { getSlots } from '@fluentui/react-utilities';
/** @jsxRuntime classic */
/** @jsxFrag Fragment */
bsunderhus marked this conversation as resolved.
Show resolved Hide resolved
/** @jsx createElement */

import { createElement, Fragment } from '@fluentui/react-jsx-runtime';

import { getSlotsNext } from '@fluentui/react-utilities';
import type { DialogTitleState, DialogTitleSlots } from './DialogTitle.types';

/**
* Render the final JSX of DialogTitle
*/
export const renderDialogTitle_unstable = (state: DialogTitleState) => {
const { slots, slotProps } = getSlots<DialogTitleSlots>(state);
const { slots, slotProps } = getSlotsNext<DialogTitleSlots>(state);

return (
<>
Expand Down