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

[RFR] Component Inference #2376

Merged
merged 4 commits into from
Oct 11, 2018
Merged

[RFR] Component Inference #2376

merged 4 commits into from
Oct 11, 2018

Conversation

fzaninotto
Copy link
Member

@fzaninotto fzaninotto commented Oct 1, 2018

To improve the developer experience, react-admin can display content before developers choose which fields or input should be displayed inside a List or an Edit, based on inference on content.

This inference is then serialized to the console, to be copied/pasted directly into the code.

  • Add inference engine
  • Add support for Datagrid inference in <ListGuesser>
  • Add support for Filter inference in <ListGuesser> (v2)
  • Add support for SimpleForm inference in <EditGuesser>
  • Add support for SimpleShowLayout inference in <ShowGuesser>
  • Output inferred components as a string in the console
  • Make sure inferences work at least on the Demo example
  • Make sure inference does not force loading of all fields and inputs when cherry picking is enabled
  • Document inference in List, Show, and Edit chapters
  • Rewrite tutorial to show inference

Usage:

import { Admin, Resource, ListGuesser, EditGuesser } from 'react-admin';

const App = () => (
    <Admin dataProvider={...}/
        <Resource name="posts" list={ListGuesser} edit={EditGuesser} />
        <Resource name="comments" list={ListGuesser} edit={EditGuesser} />
    </Admin>
);

2018-10-05_0912

2018-10-06_2106

2018-10-05_0922

@fzaninotto fzaninotto changed the title [WIP] Component Inference [RFR] Component Inference Oct 11, 2018
@fzaninotto fzaninotto added this to the 2.4.0 milestone Oct 11, 2018
@fzaninotto
Copy link
Member Author

Finally, after squashing most of the commits of this PR (to avoid drowning future blamers with my hesitations), it's Ready For Review!

Copy link
Contributor

@djhi djhi left a comment

Choose a reason for hiding this comment

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

Awesome 👍

@Kmaschta Kmaschta merged commit 099bd46 into next Oct 11, 2018
@Kmaschta Kmaschta deleted the inference branch October 11, 2018 13:45
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.

None yet

3 participants