},
+) => {
+ return noopResult;
+};
From b2a1d9e225f1a2de07d773f419c8eadd2a5216ac Mon Sep 17 00:00:00 2001
From: Tommy Nguyen <4123478+tido64@users.noreply.github.com>
Date: Thu, 14 Mar 2024 11:33:41 +0100
Subject: [PATCH 2/3] chore: remove Chakra workarounds, bump RNTA (#30777)
---
apps/xplat-v9/babel.config.js | 6 +-----
apps/xplat-v9/index.js | 2 --
apps/xplat-v9/ios/Podfile.lock | 8 ++++----
apps/xplat-v9/macos/Podfile.lock | 8 ++++----
apps/xplat-v9/package.json | 6 +-----
.../react-platform-adapter/package.json | 3 ++-
yarn.lock | 19 ++++++++++++-------
7 files changed, 24 insertions(+), 28 deletions(-)
diff --git a/apps/xplat-v9/babel.config.js b/apps/xplat-v9/babel.config.js
index e68f72da3b0333..94bd7267d31665 100644
--- a/apps/xplat-v9/babel.config.js
+++ b/apps/xplat-v9/babel.config.js
@@ -1,8 +1,4 @@
module.exports = {
presets: ['@rnx-kit/babel-preset-metro-react-native'],
- plugins: [
- '@babel/plugin-transform-nullish-coalescing-operator', // required by Chakra
- '@babel/plugin-transform-logical-assignment-operators', // required by Chakra
- '@stylexjs/babel-plugin',
- ],
+ plugins: ['@stylexjs/babel-plugin'],
};
diff --git a/apps/xplat-v9/index.js b/apps/xplat-v9/index.js
index 9a739b41317a7a..9b73932914001a 100644
--- a/apps/xplat-v9/index.js
+++ b/apps/xplat-v9/index.js
@@ -2,8 +2,6 @@
* @format
*/
-import 'core-js/features/array/flat'; // required by Chakra
-import 'core-js/features/array/flat-map'; // required by Chakra
import { AppRegistry } from 'react-native';
import App from './App';
import { name as appName } from './app.json';
diff --git a/apps/xplat-v9/ios/Podfile.lock b/apps/xplat-v9/ios/Podfile.lock
index e134932d60a660..3b0c9fb8c2ce36 100644
--- a/apps/xplat-v9/ios/Podfile.lock
+++ b/apps/xplat-v9/ios/Podfile.lock
@@ -1054,7 +1054,7 @@ PODS:
- React-RCTFabric
- ReactCommon/turbomodule/core
- Yoga
- - ReactTestApp-DevSupport (3.2.15):
+ - ReactTestApp-DevSupport (3.3.1):
- React-Core
- React-jsi
- ReactTestApp-Resources (1.0.0-dev)
@@ -1280,11 +1280,11 @@ SPEC CHECKSUMS:
React-utils: 987a4526a2fc0acdfaf87888adfe0bf9d0452066
ReactCommon: dcc87812d79ce368cc41b7cf49fb624cf3c22b6b
ReactNativeHost: 46268e9273b0afaf9e9720d6cc81507d95d8dd7a
- ReactTestApp-DevSupport: 8a69118a4beadc5c4426e35d4d38c3dc7357cb3d
- ReactTestApp-Resources: da77347b3f02b5d79ba3fecb3ad328b2f6a7ef4d
+ ReactTestApp-DevSupport: d07f4ee3757454ccca60cc95b9d533a00ba41513
+ ReactTestApp-Resources: 857244f3a23f2b3157b364fa06cf3e8866deff9c
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
Yoga: a716eea57d0d3430219c0a5a233e1e93ee931eb7
PODFILE CHECKSUM: cadb274a002043a2a0ccc7f3d1f4c687c0004793
-COCOAPODS: 1.14.2
+COCOAPODS: 1.14.3
diff --git a/apps/xplat-v9/macos/Podfile.lock b/apps/xplat-v9/macos/Podfile.lock
index 410488130ab4da..382919e2966d27 100644
--- a/apps/xplat-v9/macos/Podfile.lock
+++ b/apps/xplat-v9/macos/Podfile.lock
@@ -1019,7 +1019,7 @@ PODS:
- React-Core
- React-cxxreact
- ReactCommon/turbomodule/core
- - ReactTestApp-DevSupport (3.2.15):
+ - ReactTestApp-DevSupport (3.3.1):
- React-Core
- React-jsi
- ReactTestApp-Resources (1.0.0-dev)
@@ -1237,11 +1237,11 @@ SPEC CHECKSUMS:
React-utils: b360b43f6554167a3d030d18d439e62872ee7eb1
ReactCommon: 4a9c46cbe8803df27da190b48f5c64cee33a483a
ReactNativeHost: 59d4565eee4fb44efb46d3bff7adbaf2cf29fa5f
- ReactTestApp-DevSupport: 8a69118a4beadc5c4426e35d4d38c3dc7357cb3d
- ReactTestApp-Resources: 8539dac0f8d2ef3821827a537e37812104c6ff78
+ ReactTestApp-DevSupport: d07f4ee3757454ccca60cc95b9d533a00ba41513
+ ReactTestApp-Resources: 9d83e280b173ba2ee053b8135730dff60f9ab674
SocketRocket: f6c6249082c011e6de2de60ed641ef8bbe0cfac9
Yoga: 3725908fb0d6c8d45b7e133940f5d603e588b7ce
PODFILE CHECKSUM: b33f0b7a7f695ecaa04ef3bb721e1a1a3f780ad6
-COCOAPODS: 1.13.0
+COCOAPODS: 1.14.3
diff --git a/apps/xplat-v9/package.json b/apps/xplat-v9/package.json
index ec89b803f5467b..5cf0ec8439b546 100644
--- a/apps/xplat-v9/package.json
+++ b/apps/xplat-v9/package.json
@@ -24,7 +24,6 @@
"@fluentui/react-provider": "*",
"@fluentui/react-theme": "*",
"@stylexjs/babel-plugin": "^0.5.1",
- "@stylexjs/stylex": "^0.5.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-native": "^0.73.5",
@@ -34,8 +33,6 @@
},
"devDependencies": {
"@babel/core": "^7.20.0",
- "@babel/plugin-transform-logical-assignment-operators": "^7.20.0",
- "@babel/plugin-transform-nullish-coalescing-operator": "^7.20.0",
"@babel/preset-env": "^7.20.0",
"@babel/runtime": "^7.20.0",
"@react-native/babel-preset": "^0.73.0",
@@ -49,11 +46,10 @@
"@types/react": "^18.0.24",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.2.1",
- "core-js": "^3.8.2",
"eslint": "^8.19.0",
"jest": "^29.2.1",
"prettier": "^2.4.1",
- "react-native-test-app": "^3.2.15",
+ "react-native-test-app": "^3.3.1",
"react-test-renderer": "18.2.0",
"typescript": "4.8.4"
},
diff --git a/packages/react-components/react-platform-adapter/package.json b/packages/react-components/react-platform-adapter/package.json
index 182535c98c3f42..c0e66d2facc43b 100644
--- a/packages/react-components/react-platform-adapter/package.json
+++ b/packages/react-components/react-platform-adapter/package.json
@@ -30,7 +30,8 @@
"devDependencies": {
"@fluentui/eslint-plugin": "*",
"@fluentui/scripts-api-extractor": "*",
- "@fluentui/scripts-tasks": "*"
+ "@fluentui/scripts-tasks": "*",
+ "@stylexjs/stylex": "^0.5.1"
},
"dependencies": {
"@fluentui/react-shared-contexts": "^9.15.0",
diff --git a/yarn.lock b/yarn.lock
index bb01a91f2b22af..3fe89983f14d54 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1020,7 +1020,7 @@
dependencies:
"@babel/helper-plugin-utils" "^7.22.5"
-"@babel/plugin-transform-logical-assignment-operators@^7.20.0", "@babel/plugin-transform-logical-assignment-operators@^7.23.4":
+"@babel/plugin-transform-logical-assignment-operators@^7.23.4":
version "7.23.4"
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.23.4.tgz#e599f82c51d55fac725f62ce55d3a0886279ecb5"
integrity sha512-Mc/ALf1rmZTP4JKKEhUwiORU+vcfarFVLfcFiolKUo6sewoxSEgl36ak5t+4WamRsNr6nzjZXQjM35WsU+9vbg==
@@ -1085,7 +1085,7 @@
dependencies:
"@babel/helper-plugin-utils" "^7.22.5"
-"@babel/plugin-transform-nullish-coalescing-operator@^7.20.0", "@babel/plugin-transform-nullish-coalescing-operator@^7.23.4":
+"@babel/plugin-transform-nullish-coalescing-operator@^7.23.4":
version "7.23.4"
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.23.4.tgz#45556aad123fc6e52189ea749e33ce090637346e"
integrity sha512-jHE9EVVqHKAQx+VePv5LLGHjmHSJR76vawFPTdlxR/LVJPfOEGxREQwQfjuZEOPTwG92X3LINSh3M40Rv4zpVA==
@@ -21859,19 +21859,19 @@ react-native-macos@^0.73.0:
ws "^6.2.2"
yargs "^17.6.2"
-react-native-test-app@^3.2.15:
- version "3.2.15"
- resolved "https://registry.yarnpkg.com/react-native-test-app/-/react-native-test-app-3.2.15.tgz#db6d6a9e06db66b48196eaf9739993793b10d17f"
- integrity sha512-bVvbDF5LvulB2j8DEkFXiNVqurQbGB2jSjqcCWd9Xfu+B5kB7LKO6g8dJKdkZpcNi+watSUMK8fMdJBtk56Zgg==
+react-native-test-app@^3.3.1:
+ version "3.3.1"
+ resolved "https://registry.yarnpkg.com/react-native-test-app/-/react-native-test-app-3.3.1.tgz#8aa4af88e045676e101ecd4bf1724a8f22f65667"
+ integrity sha512-upMaqQmalxc7hsVvm0ioZ3b33gAC2DfA1MI6iqKr4paZKNNGxa5gbkD6fErVd1KN76z5HPDoBJyxIiD1f/SE9A==
dependencies:
"@rnx-kit/react-native-host" "^0.4.4"
ajv "^8.0.0"
- chalk "^4.1.0"
cliui "^8.0.0"
fast-xml-parser "^4.0.0"
prompts "^2.4.0"
semver "^7.3.5"
uuid "^8.3.2"
+ yoctocolors "^2.0.0"
react-native-windows@^0.73.0:
version "0.73.4"
@@ -27229,6 +27229,11 @@ yocto-queue@^1.0.0:
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-1.0.0.tgz#7f816433fb2cbc511ec8bf7d263c3b58a1a3c251"
integrity sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==
+yoctocolors@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/yoctocolors/-/yoctocolors-2.0.0.tgz#f6cd83f1fd0b211594810a6de413202d6d177075"
+ integrity sha512-esbDnt0Z1zI1KgvOZU90hJbL6BkoUbrP9yy7ArNZ6TmxBxydMJTYMf9FZjmwwcA8ZgEQzriQ3hwZ0NYXhlFo8Q==
+
z-schema@~5.0.2:
version "5.0.2"
resolved "https://registry.yarnpkg.com/z-schema/-/z-schema-5.0.2.tgz#f410394b2c9fcb9edaf6a7511491c0bb4e89a504"
From 68debe6bf57c298871929fcface637c2904fe20c Mon Sep 17 00:00:00 2001
From: Tommy Nguyen <4123478+tido64@users.noreply.github.com>
Date: Thu, 14 Mar 2024 21:50:33 +0100
Subject: [PATCH 3/3] fix: ensure package is tree-shakeable (#30776)
---
.../react-platform-adapter/.eslintrc.json | 15 +++++++++++-
.../src/XPlatProvider/index.ts | 2 --
.../react-platform-adapter/src/index.ts | 24 +++++++++----------
.../react-platform-adapter/src/jsx/index.ts | 1 -
.../src/jsx/jsxPlatformAdapter.native.ts | 5 ++--
.../src/jsx/jsxPlatformAdapter.ts | 2 +-
.../src/styling/index.ts | 8 -------
7 files changed, 29 insertions(+), 28 deletions(-)
delete mode 100644 packages/react-components/react-platform-adapter/src/XPlatProvider/index.ts
delete mode 100644 packages/react-components/react-platform-adapter/src/jsx/index.ts
delete mode 100644 packages/react-components/react-platform-adapter/src/styling/index.ts
diff --git a/packages/react-components/react-platform-adapter/.eslintrc.json b/packages/react-components/react-platform-adapter/.eslintrc.json
index ceea884c70dccc..3e768a4e52d20c 100644
--- a/packages/react-components/react-platform-adapter/.eslintrc.json
+++ b/packages/react-components/react-platform-adapter/.eslintrc.json
@@ -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"
+ }
+ ]
+ }
+ }
+ ]
}
diff --git a/packages/react-components/react-platform-adapter/src/XPlatProvider/index.ts b/packages/react-components/react-platform-adapter/src/XPlatProvider/index.ts
deleted file mode 100644
index e49ea051e5750b..00000000000000
--- a/packages/react-components/react-platform-adapter/src/XPlatProvider/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export { XPlatProvider, suppressCssVariableInsertion } from './XPlatProvider';
-export { type XPlatProviderProps } from './XPlatProvider.types';
diff --git a/packages/react-components/react-platform-adapter/src/index.ts b/packages/react-components/react-platform-adapter/src/index.ts
index 6a150c72b6b6d3..22355950f85048 100644
--- a/packages/react-components/react-platform-adapter/src/index.ts
+++ b/packages/react-components/react-platform-adapter/src/index.ts
@@ -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';
diff --git a/packages/react-components/react-platform-adapter/src/jsx/index.ts b/packages/react-components/react-platform-adapter/src/jsx/index.ts
deleted file mode 100644
index 784f1eb6398488..00000000000000
--- a/packages/react-components/react-platform-adapter/src/jsx/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './jsxPlatformAdapter';
diff --git a/packages/react-components/react-platform-adapter/src/jsx/jsxPlatformAdapter.native.ts b/packages/react-components/react-platform-adapter/src/jsx/jsxPlatformAdapter.native.ts
index c56ddf91853b94..ac247320176a97 100644
--- a/packages/react-components/react-platform-adapter/src/jsx/jsxPlatformAdapter.native.ts
+++ b/packages/react-components/react-platform-adapter/src/jsx/jsxPlatformAdapter.native.ts
@@ -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 = (
props: (P & { children?: React.ReactNode; className?: string; style?: React.CSSProperties }) | null,
diff --git a/packages/react-components/react-platform-adapter/src/jsx/jsxPlatformAdapter.ts b/packages/react-components/react-platform-adapter/src/jsx/jsxPlatformAdapter.ts
index b777ab5e232f78..aba2aa68e64d3b 100644
--- a/packages/react-components/react-platform-adapter/src/jsx/jsxPlatformAdapter.ts
+++ b/packages/react-components/react-platform-adapter/src/jsx/jsxPlatformAdapter.ts
@@ -1,4 +1,4 @@
-import { JSXRuntime } from './types';
+import type { JSXRuntime } from './types';
export const jsxPlatformAdapter = (reactJsx: JSXRuntime) => {
return reactJsx;
diff --git a/packages/react-components/react-platform-adapter/src/styling/index.ts b/packages/react-components/react-platform-adapter/src/styling/index.ts
deleted file mode 100644
index 5d23c3366482e1..00000000000000
--- a/packages/react-components/react-platform-adapter/src/styling/index.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-export * from './classNameMap';
-export * from './makeResetStyles';
-export * from './makeStyles';
-export * from './mergeClasses';
-export * from './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';