diff --git a/.changeset/flat-schools-crash.md b/.changeset/flat-schools-crash.md new file mode 100644 index 000000000..52411b8b4 --- /dev/null +++ b/.changeset/flat-schools-crash.md @@ -0,0 +1,5 @@ +--- +'@emotion/react': patch +--- + +Shorten the path of the "private" `isolated-hoist-non-react-statics-do-not-use-this-in-your-code` entrypoint to avoid exeeding path limitations on Windows. diff --git a/packages/react/_isolated-hnrs/package.json b/packages/react/_isolated-hnrs/package.json new file mode 100644 index 000000000..33a92e72b --- /dev/null +++ b/packages/react/_isolated-hnrs/package.json @@ -0,0 +1,13 @@ +{ + "main": "dist/emotion-react-_isolated-hnrs.cjs.js", + "module": "dist/emotion-react-_isolated-hnrs.esm.js", + "umd:main": "dist/emotion-react-_isolated-hnrs.umd.min.js", + "browser": { + "./dist/emotion-react-_isolated-hnrs.cjs.js": "./dist/emotion-react-_isolated-hnrs.browser.cjs.js", + "./dist/emotion-react-_isolated-hnrs.esm.js": "./dist/emotion-react-_isolated-hnrs.browser.esm.js" + }, + "sideEffects": false, + "preconstruct": { + "umdName": "emotionHoistNonReactStatics" + } +} diff --git a/packages/react/isolated-hoist-non-react-statics-do-not-use-this-in-your-code/package.json b/packages/react/isolated-hoist-non-react-statics-do-not-use-this-in-your-code/package.json deleted file mode 100644 index ba8cb819c..000000000 --- a/packages/react/isolated-hoist-non-react-statics-do-not-use-this-in-your-code/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "main": "dist/emotion-react-isolated-hoist-non-react-statics-do-not-use-this-in-your-code.cjs.js", - "module": "dist/emotion-react-isolated-hoist-non-react-statics-do-not-use-this-in-your-code.esm.js", - "umd:main": "dist/emotion-react-isolated-hoist-non-react-statics-do-not-use-this-in-your-code.umd.min.js", - "browser": { - "./dist/emotion-react-isolated-hoist-non-react-statics-do-not-use-this-in-your-code.cjs.js": "./dist/emotion-react-isolated-hoist-non-react-statics-do-not-use-this-in-your-code.browser.cjs.js", - "./dist/emotion-react-isolated-hoist-non-react-statics-do-not-use-this-in-your-code.esm.js": "./dist/emotion-react-isolated-hoist-non-react-statics-do-not-use-this-in-your-code.browser.esm.js" - }, - "sideEffects": false, - "preconstruct": { - "umdName": "emotionHoistNonReactStatics" - } -} diff --git a/packages/react/package.json b/packages/react/package.json index abfccac2a..cb7feec3d 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -13,7 +13,7 @@ "dist", "jsx-runtime", "jsx-dev-runtime", - "isolated-hoist-non-react-statics-do-not-use-this-in-your-code", + "_isolated-hnrs", "types/*.d.ts", "macro.js", "macro.d.ts", @@ -68,7 +68,7 @@ "./index.js", "./jsx-runtime.js", "./jsx-dev-runtime.js", - "./isolated-hoist-non-react-statics-do-not-use-this-in-your-code.js" + "./_isolated-hnrs.js" ], "umdName": "emotionReact" } diff --git a/packages/react/src/isolated-hoist-non-react-statics-do-not-use-this-in-your-code.js b/packages/react/src/_isolated-hnrs.js similarity index 100% rename from packages/react/src/isolated-hoist-non-react-statics-do-not-use-this-in-your-code.js rename to packages/react/src/_isolated-hnrs.js diff --git a/packages/react/src/theming.js b/packages/react/src/theming.js index 16c6d91cd..972b5b5d7 100644 --- a/packages/react/src/theming.js +++ b/packages/react/src/theming.js @@ -1,7 +1,7 @@ // @flow import * as React from 'react' import weakMemoize from '@emotion/weak-memoize' -import hoistNonReactStatics from './isolated-hoist-non-react-statics-do-not-use-this-in-your-code' +import hoistNonReactStatics from './_isolated-hnrs' export const ThemeContext = /* #__PURE__ */ React.createContext({}) if (process.env.NODE_ENV !== 'production') { diff --git a/packages/react/src/utils.js b/packages/react/src/utils.js index 165eb7c68..8f03da492 100644 --- a/packages/react/src/utils.js +++ b/packages/react/src/utils.js @@ -1,4 +1,4 @@ // @flow export let isBrowser = typeof document !== 'undefined' -export const hasOwnProperty = Object.prototype.hasOwnProperty +export const hasOwnProperty = {}.hasOwnProperty