This repository was archived by the owner on Jan 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
This repository was archived by the owner on Jan 31, 2023. It is now read-only.
Bring back QuickStart #315
Copy link
Copy link
Open
Labels
Description
QuickStart was an API for initializing a contexture tree using react components, with no config object necessary. It was taken before its time 😢
The API relied on mobx-react's Provider (now deprecated) to inject the contexture tree into the components, along with functionality in the old injectTreeNode HOC (now contexturify) that would automatically generate tree nodes if certain parameters were given. That functionality was only useful for QuickStart, and is being removed in 2.0 along with Provider support.
To restore QuickStart, we'll need to:
- reimplement the tree injection using React context, and
- add a new HOC to handle the auto-add functionality (should be composable with
withLoader).
Here is the old story to illustrate how the API worked:
export default () => (
<ContextureProvider schema="movies" types={types} service={service}>
<DarkBox>
<SpacedList>
<Query field="title" />
<Grid gap="5px" columns="1fr 4fr">
<div>
<SpacedList>
<div>
<b>MetaScore</b>
<Number field="metaScore" min={0} max={100} />
</div>
<div>
<b>Genre</b>
<Facet field="genres" />
</div>
<div>
<b>Actors</b>
<Facet field="actors" />
</div>
</SpacedList>
</div>
<div>
<DateHistogram
key_field="released"
value_field="imdbVotes"
interval="3650d"
format={formatYear}
/>
<Flex style={{ justifyContent: 'space-around' }}>
<h3>
<ResultCount pageSize={6} />
</h3>
</Flex>
<IMDBCards path={['root', 'results']} />
<Flex style={{ justifyContent: 'space-around' }}>
<Pager path={['root', 'results']} />
</Flex>
</div>
</Grid>
</SpacedList>
</DarkBox>
</ContextureProvider>
)Reactions are currently unavailable