Skip to content

Add worker-related conditions#479

Merged
bvaughn merged 1 commit into
bvaughn:mainfrom
Andarist:worker-bundles
May 3, 2025
Merged

Add worker-related conditions#479
bvaughn merged 1 commit into
bvaughn:mainfrom
Andarist:worker-bundles

Conversation

@Andarist
Copy link
Copy Markdown
Contributor

@Andarist Andarist commented May 2, 2025

This should improve support for Cloudflare Workers and Vercel Functions. Bundlers for workers often, annoyingly, prefer browser conditions over node/default - so when we include a browser condition, we, almost always, have to specify the worker conditions first in the context of React.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 2, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-resizable-panels ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 2, 2025 6:28am

Comment on lines +23 to +25
"edge-light": "./dist/react-resizable-panels.development.edge-light.js",
"worker": "./dist/react-resizable-panels.development.edge-light.js",
"workerd": "./dist/react-resizable-panels.development.edge-light.js",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Notice those are the same as the one for node - the bundle itself is reused. Those keys here are just listed in order of preference (remember those keys here are ordered - despite being just object keys)

Copy link
Copy Markdown
Owner

@bvaughn bvaughn left a comment

Choose a reason for hiding this comment

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

"workerd" 😮‍💨 Whew, the JS toolchain can be exhausting sometimes

@bvaughn bvaughn merged commit 17295b3 into bvaughn:main May 3, 2025
7 checks passed
@bvaughn
Copy link
Copy Markdown
Owner

bvaughn commented May 3, 2025

Published in 3.0.1

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants