Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fields] Play with the Base UI DX #14679

Draft
wants to merge 67 commits into
base: master
Choose a base branch
from

Conversation

flaviendelangle
Copy link
Member

@flaviendelangle flaviendelangle commented Sep 20, 2024

Not planning to merge this one before a long long time.
The will likely be released after v8 stable (we need Base UI to be stable).

Exploration of #14496 (comment)

Goals of the POC

  • Get more familiar with the Base UI DX to better understand the DX choices and ongoing discussions.
  • See how the Base UI DX could help us improve visual customization at the field level (e.g: allow people to build fields that keep our editing mechanism but using their design system, which can be in-house or a third party library).
  • See how the removal of enableAccessibleFieldDOMStructure will help us simplify the typing and the logic of the fields.

TypeScript

I'm exploring some improvements in this PR, they would be extracted to a standalone PR if we decide to apply them.

  • Move some basic pro interfaces in the community package (DateRange, RangePosition and RangeFieldSection to allow interfaces to infer TValue and TSection from TDate. A lot of our interfaces have tons of generics, which is a pain, it would simplify a lot of things if we could infer those:

    -interface MyInterface<TValue, TDate extends PickersValidDate, TSection, TError> { ... }
    
    // At a component level, `TIsRange` is always defined, only `TDate` depends of the app it's being used in
    +interface MyInterface<TDate extends PickersValidDate, TIsRange extends boolean, TError> { ... }

    Not entirely sure how much it improves the logic. It feels good to remove the need for people to import FieldSection, RangeFieldSection and DateRange and instead rely on a TIsRange extends boolean that they will easily understand how to use. I'll keep playing with this change, this is clearly something we could extract and apply v8 if we decide to.

Questions

Package structures

  • From where should the Base UI-DX component be exported?
    • @mui/x-date-pickers/base/PickersField => require to handle depth 2 imports
    • @mui/x-date-pickers/PickersField => no way to know which components are using material and which one are not (unless we add a @mui/x-date-pickers/material endpoint and everything outside of it is unstyled).
    • @base-ui/x-date-pickers/PickersField
    • something else?

@flaviendelangle flaviendelangle self-assigned this Sep 20, 2024
@flaviendelangle flaviendelangle added component: pickers This is the name of the generic UI component, not the React module! proof of concept Studying and/or experimenting with a to be validated approach labels Sep 20, 2024
@mui-bot
Copy link

mui-bot commented Sep 20, 2024

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Oct 4, 2024
Copy link

github-actions bot commented Oct 4, 2024

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Oct 4, 2024
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Oct 7, 2024
Copy link

github-actions bot commented Oct 7, 2024

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Oct 9, 2024
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Oct 16, 2024
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Oct 16, 2024
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: pickers This is the name of the generic UI component, not the React module! PR: out-of-date The pull request has merge conflicts and can't be merged proof of concept Studying and/or experimenting with a to be validated approach
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants