Skip to content

[RFR] Component Inference - #2376

Merged
Kmaschta merged 4 commits into
nextfrom
inference
Oct 11, 2018
Merged

Kmaschta merged 4 commits into
nextfrom
inference

Conversation

@fzaninotto

@fzaninotto fzaninotto commented Oct 1, 2018 •

Copy link
Copy Markdown
Member

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
Copy Markdown
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!

Comment thread packages/ra-core/package.json
Comment thread packages/ra-core/src/inference/assertions.js

@djhi djhi left a comment

Copy link
Copy Markdown
Contributor

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.

3 participants