Skip to content

Commit

Permalink
Added edge-light and workerd conditions (#3215)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist authored Jul 20, 2024
1 parent d8ff8a5 commit a9f6912
Show file tree
Hide file tree
Showing 7 changed files with 228 additions and 49 deletions.
10 changes: 10 additions & 0 deletions .changeset/whiny-lemons-lay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@emotion/use-insertion-effect-with-fallbacks': minor
'@emotion/primitives': minor
'@emotion/styled': minor
'@emotion/cache': minor
'@emotion/react': minor
'@emotion/utils': minor
---

Added `edge-light` and `workerd` conditions to `package.json` manifest to better serve users using Vercel Edge and Cloudflare Workers.
34 changes: 28 additions & 6 deletions packages/cache/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,20 @@
"default": "./dist/emotion-cache.cjs.js"
},
"development": {
"edge-light": {
"module": "./dist/emotion-cache.development.edge-light.esm.js",
"import": "./dist/emotion-cache.development.edge-light.cjs.mjs",
"default": "./dist/emotion-cache.development.edge-light.cjs.js"
},
"worker": {
"module": "./dist/emotion-cache.development.worker.esm.js",
"import": "./dist/emotion-cache.development.worker.cjs.mjs",
"default": "./dist/emotion-cache.development.worker.cjs.js"
"module": "./dist/emotion-cache.development.edge-light.esm.js",
"import": "./dist/emotion-cache.development.edge-light.cjs.mjs",
"default": "./dist/emotion-cache.development.edge-light.cjs.js"
},
"workerd": {
"module": "./dist/emotion-cache.development.edge-light.esm.js",
"import": "./dist/emotion-cache.development.edge-light.cjs.mjs",
"default": "./dist/emotion-cache.development.edge-light.cjs.js"
},
"browser": {
"module": "./dist/emotion-cache.browser.development.esm.js",
Expand All @@ -25,10 +35,20 @@
"import": "./dist/emotion-cache.development.cjs.mjs",
"default": "./dist/emotion-cache.development.cjs.js"
},
"edge-light": {
"module": "./dist/emotion-cache.edge-light.esm.js",
"import": "./dist/emotion-cache.edge-light.cjs.mjs",
"default": "./dist/emotion-cache.edge-light.cjs.js"
},
"worker": {
"module": "./dist/emotion-cache.worker.esm.js",
"import": "./dist/emotion-cache.worker.cjs.mjs",
"default": "./dist/emotion-cache.worker.cjs.js"
"module": "./dist/emotion-cache.edge-light.esm.js",
"import": "./dist/emotion-cache.edge-light.cjs.mjs",
"default": "./dist/emotion-cache.edge-light.cjs.js"
},
"workerd": {
"module": "./dist/emotion-cache.edge-light.esm.js",
"import": "./dist/emotion-cache.edge-light.cjs.mjs",
"default": "./dist/emotion-cache.edge-light.cjs.js"
},
"browser": {
"module": "./dist/emotion-cache.browser.esm.js",
Expand All @@ -47,6 +67,8 @@
"default": "./src/conditions/false.js"
},
"#is-browser": {
"edge-light": "./src/conditions/false.js",
"workerd": "./src/conditions/false.js",
"worker": "./src/conditions/false.js",
"browser": "./src/conditions/true.js",
"default": "./src/conditions/is-browser.js"
Expand Down
1 change: 0 additions & 1 deletion packages/primitives/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"./package.json": "./package.json",
"./macro": "./macro.js"
},
"imports": {},
"preconstruct": {
"exports": {
"extra": {
Expand Down
130 changes: 106 additions & 24 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,20 @@
"default": "./dist/emotion-react.cjs.js"
},
"development": {
"edge-light": {
"module": "./dist/emotion-react.development.edge-light.esm.js",
"import": "./dist/emotion-react.development.edge-light.cjs.mjs",
"default": "./dist/emotion-react.development.edge-light.cjs.js"
},
"worker": {
"module": "./dist/emotion-react.development.worker.esm.js",
"import": "./dist/emotion-react.development.worker.cjs.mjs",
"default": "./dist/emotion-react.development.worker.cjs.js"
"module": "./dist/emotion-react.development.edge-light.esm.js",
"import": "./dist/emotion-react.development.edge-light.cjs.mjs",
"default": "./dist/emotion-react.development.edge-light.cjs.js"
},
"workerd": {
"module": "./dist/emotion-react.development.edge-light.esm.js",
"import": "./dist/emotion-react.development.edge-light.cjs.mjs",
"default": "./dist/emotion-react.development.edge-light.cjs.js"
},
"browser": {
"module": "./dist/emotion-react.browser.development.esm.js",
Expand All @@ -24,10 +34,20 @@
"import": "./dist/emotion-react.development.cjs.mjs",
"default": "./dist/emotion-react.development.cjs.js"
},
"edge-light": {
"module": "./dist/emotion-react.edge-light.esm.js",
"import": "./dist/emotion-react.edge-light.cjs.mjs",
"default": "./dist/emotion-react.edge-light.cjs.js"
},
"worker": {
"module": "./dist/emotion-react.worker.esm.js",
"import": "./dist/emotion-react.worker.cjs.mjs",
"default": "./dist/emotion-react.worker.cjs.js"
"module": "./dist/emotion-react.edge-light.esm.js",
"import": "./dist/emotion-react.edge-light.cjs.mjs",
"default": "./dist/emotion-react.edge-light.cjs.js"
},
"workerd": {
"module": "./dist/emotion-react.edge-light.esm.js",
"import": "./dist/emotion-react.edge-light.cjs.mjs",
"default": "./dist/emotion-react.edge-light.cjs.js"
},
"browser": {
"module": "./dist/emotion-react.browser.esm.js",
Expand All @@ -44,10 +64,20 @@
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js"
},
"development": {
"edge-light": {
"module": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.edge-light.esm.js",
"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.edge-light.cjs.mjs",
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.edge-light.cjs.js"
},
"worker": {
"module": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.worker.esm.js",
"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.worker.cjs.mjs",
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.worker.cjs.js"
"module": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.edge-light.esm.js",
"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.edge-light.cjs.mjs",
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.edge-light.cjs.js"
},
"workerd": {
"module": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.edge-light.esm.js",
"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.edge-light.cjs.mjs",
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.edge-light.cjs.js"
},
"browser": {
"module": "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.development.esm.js",
Expand All @@ -58,10 +88,20 @@
"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.cjs.mjs",
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.cjs.js"
},
"edge-light": {
"module": "./jsx-runtime/dist/emotion-react-jsx-runtime.edge-light.esm.js",
"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.edge-light.cjs.mjs",
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.edge-light.cjs.js"
},
"worker": {
"module": "./jsx-runtime/dist/emotion-react-jsx-runtime.worker.esm.js",
"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.worker.cjs.mjs",
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.worker.cjs.js"
"module": "./jsx-runtime/dist/emotion-react-jsx-runtime.edge-light.esm.js",
"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.edge-light.cjs.mjs",
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.edge-light.cjs.js"
},
"workerd": {
"module": "./jsx-runtime/dist/emotion-react-jsx-runtime.edge-light.esm.js",
"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.edge-light.cjs.mjs",
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.edge-light.cjs.js"
},
"browser": {
"module": "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js",
Expand All @@ -78,10 +118,20 @@
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.js"
},
"development": {
"edge-light": {
"module": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.edge-light.esm.js",
"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.edge-light.cjs.mjs",
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.edge-light.cjs.js"
},
"worker": {
"module": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.worker.esm.js",
"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.worker.cjs.mjs",
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.worker.cjs.js"
"module": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.edge-light.esm.js",
"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.edge-light.cjs.mjs",
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.edge-light.cjs.js"
},
"workerd": {
"module": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.edge-light.esm.js",
"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.edge-light.cjs.mjs",
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.edge-light.cjs.js"
},
"browser": {
"module": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.development.esm.js",
Expand All @@ -92,10 +142,20 @@
"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.cjs.mjs",
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.cjs.js"
},
"edge-light": {
"module": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.edge-light.esm.js",
"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.edge-light.cjs.mjs",
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.edge-light.cjs.js"
},
"worker": {
"module": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.worker.esm.js",
"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.worker.cjs.mjs",
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.worker.cjs.js"
"module": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.edge-light.esm.js",
"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.edge-light.cjs.mjs",
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.edge-light.cjs.js"
},
"workerd": {
"module": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.edge-light.esm.js",
"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.edge-light.cjs.mjs",
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.edge-light.cjs.js"
},
"browser": {
"module": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js",
Expand All @@ -112,10 +172,20 @@
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.js"
},
"development": {
"edge-light": {
"module": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.edge-light.esm.js",
"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.edge-light.cjs.mjs",
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.edge-light.cjs.js"
},
"worker": {
"module": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.worker.esm.js",
"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.worker.cjs.mjs",
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.worker.cjs.js"
"module": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.edge-light.esm.js",
"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.edge-light.cjs.mjs",
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.edge-light.cjs.js"
},
"workerd": {
"module": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.edge-light.esm.js",
"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.edge-light.cjs.mjs",
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.edge-light.cjs.js"
},
"browser": {
"module": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.development.esm.js",
Expand All @@ -126,10 +196,20 @@
"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.cjs.mjs",
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.cjs.js"
},
"edge-light": {
"module": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.edge-light.esm.js",
"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.edge-light.cjs.mjs",
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.edge-light.cjs.js"
},
"worker": {
"module": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.worker.esm.js",
"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.worker.cjs.mjs",
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.worker.cjs.js"
"module": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.edge-light.esm.js",
"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.edge-light.cjs.mjs",
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.edge-light.cjs.js"
},
"workerd": {
"module": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.edge-light.esm.js",
"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.edge-light.cjs.mjs",
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.edge-light.cjs.js"
},
"browser": {
"module": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js",
Expand All @@ -156,6 +236,8 @@
"default": "./src/conditions/false.js"
},
"#is-browser": {
"edge-light": "./src/conditions/false.js",
"workerd": "./src/conditions/false.js",
"worker": "./src/conditions/false.js",
"browser": "./src/conditions/true.js",
"default": "./src/conditions/is-browser.js"
Expand Down
66 changes: 54 additions & 12 deletions packages/styled/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,20 @@
"default": "./base/dist/emotion-styled-base.cjs.js"
},
"development": {
"edge-light": {
"module": "./base/dist/emotion-styled-base.development.edge-light.esm.js",
"import": "./base/dist/emotion-styled-base.development.edge-light.cjs.mjs",
"default": "./base/dist/emotion-styled-base.development.edge-light.cjs.js"
},
"worker": {
"module": "./base/dist/emotion-styled-base.development.worker.esm.js",
"import": "./base/dist/emotion-styled-base.development.worker.cjs.mjs",
"default": "./base/dist/emotion-styled-base.development.worker.cjs.js"
"module": "./base/dist/emotion-styled-base.development.edge-light.esm.js",
"import": "./base/dist/emotion-styled-base.development.edge-light.cjs.mjs",
"default": "./base/dist/emotion-styled-base.development.edge-light.cjs.js"
},
"workerd": {
"module": "./base/dist/emotion-styled-base.development.edge-light.esm.js",
"import": "./base/dist/emotion-styled-base.development.edge-light.cjs.mjs",
"default": "./base/dist/emotion-styled-base.development.edge-light.cjs.js"
},
"browser": {
"module": "./base/dist/emotion-styled-base.browser.development.esm.js",
Expand All @@ -65,10 +75,20 @@
"import": "./base/dist/emotion-styled-base.development.cjs.mjs",
"default": "./base/dist/emotion-styled-base.development.cjs.js"
},
"edge-light": {
"module": "./base/dist/emotion-styled-base.edge-light.esm.js",
"import": "./base/dist/emotion-styled-base.edge-light.cjs.mjs",
"default": "./base/dist/emotion-styled-base.edge-light.cjs.js"
},
"worker": {
"module": "./base/dist/emotion-styled-base.worker.esm.js",
"import": "./base/dist/emotion-styled-base.worker.cjs.mjs",
"default": "./base/dist/emotion-styled-base.worker.cjs.js"
"module": "./base/dist/emotion-styled-base.edge-light.esm.js",
"import": "./base/dist/emotion-styled-base.edge-light.cjs.mjs",
"default": "./base/dist/emotion-styled-base.edge-light.cjs.js"
},
"workerd": {
"module": "./base/dist/emotion-styled-base.edge-light.esm.js",
"import": "./base/dist/emotion-styled-base.edge-light.cjs.mjs",
"default": "./base/dist/emotion-styled-base.edge-light.cjs.js"
},
"browser": {
"module": "./base/dist/emotion-styled-base.browser.esm.js",
Expand All @@ -85,10 +105,20 @@
"default": "./dist/emotion-styled.cjs.js"
},
"development": {
"edge-light": {
"module": "./dist/emotion-styled.development.edge-light.esm.js",
"import": "./dist/emotion-styled.development.edge-light.cjs.mjs",
"default": "./dist/emotion-styled.development.edge-light.cjs.js"
},
"worker": {
"module": "./dist/emotion-styled.development.worker.esm.js",
"import": "./dist/emotion-styled.development.worker.cjs.mjs",
"default": "./dist/emotion-styled.development.worker.cjs.js"
"module": "./dist/emotion-styled.development.edge-light.esm.js",
"import": "./dist/emotion-styled.development.edge-light.cjs.mjs",
"default": "./dist/emotion-styled.development.edge-light.cjs.js"
},
"workerd": {
"module": "./dist/emotion-styled.development.edge-light.esm.js",
"import": "./dist/emotion-styled.development.edge-light.cjs.mjs",
"default": "./dist/emotion-styled.development.edge-light.cjs.js"
},
"browser": {
"module": "./dist/emotion-styled.browser.development.esm.js",
Expand All @@ -99,10 +129,20 @@
"import": "./dist/emotion-styled.development.cjs.mjs",
"default": "./dist/emotion-styled.development.cjs.js"
},
"edge-light": {
"module": "./dist/emotion-styled.edge-light.esm.js",
"import": "./dist/emotion-styled.edge-light.cjs.mjs",
"default": "./dist/emotion-styled.edge-light.cjs.js"
},
"worker": {
"module": "./dist/emotion-styled.worker.esm.js",
"import": "./dist/emotion-styled.worker.cjs.mjs",
"default": "./dist/emotion-styled.worker.cjs.js"
"module": "./dist/emotion-styled.edge-light.esm.js",
"import": "./dist/emotion-styled.edge-light.cjs.mjs",
"default": "./dist/emotion-styled.edge-light.cjs.js"
},
"workerd": {
"module": "./dist/emotion-styled.edge-light.esm.js",
"import": "./dist/emotion-styled.edge-light.cjs.mjs",
"default": "./dist/emotion-styled.edge-light.cjs.js"
},
"browser": {
"module": "./dist/emotion-styled.browser.esm.js",
Expand All @@ -128,6 +168,8 @@
"default": "./src/conditions/false.js"
},
"#is-browser": {
"edge-light": "./src/conditions/false.js",
"workerd": "./src/conditions/false.js",
"worker": "./src/conditions/false.js",
"browser": "./src/conditions/true.js",
"default": "./src/conditions/is-browser.js"
Expand Down
Loading

0 comments on commit a9f6912

Please sign in to comment.