faency icon indicating copy to clipboard operation
faency copied to clipboard

[RFC] `as` design pattern is deprecated on Radix-UI

Open seedy opened this issue 4 years ago • 5 comments

Description

Radix deprecated as design pattern and Polymorphic in favor of asChild design pattern.

Their Slot lib component handles internal logic for the asChild pattern.

There's recommendations to reuse it, even if they deprecated it to drop support.

I think we should prepare for dropping of as design pattern and follow the asChild one.

WDYT?

https://www.radix-ui.com/docs/primitives/utilities/slot

Tasks

  • Integrate Slot component
  • Update components who could be using asChild pattern:
    • Box
    • Heading
    • Text
    • Button
    • Flex
    • Badge
    • Card

seedy avatar Dec 02 '21 18:12 seedy

It seems making sense 👍

matthieuh avatar Dec 10 '21 14:12 matthieuh

Yes, I agree

paulocfjunior avatar Dec 15 '21 18:12 paulocfjunior

@seedy Handle the update either by listing tasks in issue description or pushing separate issues

Then see if it can be handled quickly or not

seedy avatar Dec 15 '21 20:12 seedy

Components already relying on the as behavior:

  • [x] Badge
  • [x] Heading ~~- [ ] Box~~ behavior makes sense ~~- [ ] Text~~ behavior makes sense
  • [x] Button ~~- [ ] Card~~ behavior makes sense ~~- [ ] Flex~~ behavior makes sense

seedy avatar Apr 11 '22 16:04 seedy

Related issues:

  • https://github.com/traefik/faency/issues/351
  • https://github.com/traefik/faency/issues/107

seedy avatar Apr 11 '22 16:04 seedy