tailwindlabs / headlessui

Completely unstyled, fully accessible UI components, designed to integrate beautifully with Tailwind CSS.
https://headlessui.com
MIT License
25.81k stars 1.07k forks source link

Extract assert #3226

Closed pvorona closed 4 months ago

pvorona commented 4 months ago

Extract assert utility to reduce duplication and simplify the code. Similar changes can be made in vue package.

This PR does not introduce any new functionality and does not fix any issues.

vercel[bot] commented 4 months ago

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

Name Status Preview Comments Updated (UTC)
headlessui-react ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 22, 2024 7:07am
headlessui-vue ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 22, 2024 7:07am
RobinMalfait commented 4 months ago

Hey!

I appreciate the PR, but going to close it for now because I'm not sure if the additional level of indirection is really worth it.

While the assert function can be useful, it also deviates from typical assert implementations (where you don't pass through the parent function to improve the stack trace).

So again I appreciate the PR, but going to close this for now.