Skip to content

Commit

Permalink
fix: ensure package is tree-shakeable (#30776)
Browse files Browse the repository at this point in the history
  • Loading branch information
tido64 authored Mar 14, 2024
1 parent b2a1d9e commit 68debe6
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 28 deletions.
15 changes: 14 additions & 1 deletion packages/react-components/react-platform-adapter/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
{
"extends": ["plugin:@fluentui/eslint-plugin/react"],
"root": true
"root": true,
"overrides": [
{
"files": "**/*.ts",
"rules": {
"@rnx-kit/no-export-all": [
"error",
{
"expand": "all"
}
]
}
}
]
}

This file was deleted.

24 changes: 12 additions & 12 deletions packages/react-components/react-platform-adapter/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
export { XPlatProvider, suppressCssVariableInsertion, type XPlatProviderProps } from './XPlatProvider';
export { jsxPlatformAdapter } from './jsx';
export {
getStylesFromClassName,
makeStyles,
makeStylesCore,
makeResetStyles,
mergeClasses,
shorthands,
TextDirectionProvider,
useRenderer_unstable,
} from './styling/index';
export { XPlatProvider, suppressCssVariableInsertion } from './XPlatProvider/XPlatProvider';
export type { XPlatProviderProps } from './XPlatProvider/XPlatProvider.types';
export { jsxPlatformAdapter } from './jsx/jsxPlatformAdapter';
export { getStylesFromClassName } from './styling/classNameMap';
export { makeResetStyles } from './styling/makeResetStyles';
export { makeStyles } from './styling/makeStyles';
export { mergeClasses } from './styling/mergeClasses';
export { shorthands } from './styling/shorthands';

// re-export some griffel types to have fluent use the griffel adapter instead of griffel directly
export { useRenderer_unstable, TextDirectionProvider } from '@griffel/react';
export { makeStyles as makeStylesCore } from '@griffel/core';

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import type * as React from 'react';

import { html } from 'react-strict-dom';
import { getStylesFromClassName } from '../styling/index';
import { JSXRuntime } from './types';
import { getStylesFromClassName } from '../styling/classNameMap';
import type { JSXRuntime } from './types';

const modifyPropsForNative = <P extends {}>(
props: (P & { children?: React.ReactNode; className?: string; style?: React.CSSProperties }) | null,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JSXRuntime } from './types';
import type { JSXRuntime } from './types';

export const jsxPlatformAdapter = (reactJsx: JSXRuntime) => {
return reactJsx;
Expand Down

This file was deleted.

0 comments on commit 68debe6

Please sign in to comment.