-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(deps-dev): downgrade all Storybook breakage from dependabot et al (…
…#567) * fix(deps): downgrade all breakage from dependabot et al - go back to Storybook v6 addons, matching the `storybook` dep - the addons were partially auto-upgraded to breaking versions by dependabot - go back to Webpack v4, matching Storybook v6 - this was also auto-upgraded to a breaking version by dependabot - go back to `ts-loader` v8, matching Webpack v4 - and this too had a breaking dependabot upgrade Signed-off-by: Anton Gilgur <[email protected]> * revert unrelated dep changes Signed-off-by: Anton Gilgur <[email protected]> * revert the yarn.lock semver compatible changes as well Signed-off-by: Anton Gilgur <[email protected]> * and once more Signed-off-by: Anton Gilgur <[email protected]> * attempt to revert more unnecessary auto-made yarn.lock changes Signed-off-by: Anton Gilgur <[email protected]> * some more Signed-off-by: Anton Gilgur <[email protected]> * more Signed-off-by: Anton Gilgur <[email protected]> * set all storybook deps to 6.5.14 and ensure yarn.lock follows it - the latter took some manual editing and resolutions until it got it, and now it reproduces the minimal variant Signed-off-by: Anton Gilgur <[email protected]> * more yarn.lock diff reduction Signed-off-by: Anton Gilgur <[email protected]> * more babel reduction Signed-off-by: Anton Gilgur <[email protected]> * more babel reduction Signed-off-by: Anton Gilgur <[email protected]> * more Signed-off-by: Anton Gilgur <[email protected]> * couple more iterations on that Signed-off-by: Anton Gilgur <[email protected]> * migrate from `@dump247/storybook-state` to `useState` hook - as per its archived docs - tried to make the diff as small as possible Signed-off-by: Anton Gilgur <[email protected]> * import individual components from dir - same as downstream in Workflows, in order to code split properly, can't use the `src/` or `src/components/` imports as they have side effects (and therefore can't be tree-shaken) - instead have to do individual component imports to tree shake properly - this seems to substantially improve performance from lethargic minutes of loading on first page load to seconds - I believe Storybook tries to code split things itself, so maybe it was making a giant bundle for each story file? Signed-off-by: Anton Gilgur <[email protected]> * remove not working CSS test - it was tested with and without the comment, to be specific - as well as several other ways Signed-off-by: Anton Gilgur <[email protected]> * downgrade to storybook 6.5.0-beta.1 to get around telemetry bug - per, well, my own SO answer: https://stackoverflow.com/a/78770854/3431180 - also remove old, no longer unused `@types/storybook*` deps - Storybook has types built-in now (and is written in TS, not sure if it wasn't before or something) Signed-off-by: Anton Gilgur <[email protected]> --------- Signed-off-by: Anton Gilgur <[email protected]>
- Loading branch information
Showing
13 changed files
with
1,494 additions
and
3,745 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,36 @@ | ||
import { Store, withState } from '@dump247/storybook-state'; | ||
import { storiesOf } from '@storybook/react'; | ||
import * as React from 'react'; | ||
|
||
import { Select } from '../src/components'; | ||
import { Select } from '../src/components/select/select'; | ||
|
||
storiesOf('Select', module) | ||
.add('default', withState({ selected: 'option1' })(({store}: { store: Store<any> }) => ( | ||
() => ( | ||
.add('default', () => { | ||
const [selected, setSelected] = React.useState('option1'); | ||
return ( | ||
<div> | ||
<h4> | ||
Selected option value: {store.state.selected} | ||
<button className='argo-button argo-button--base' onClick={() => store.set({ selected: 'option2' })} >Select option 2</button> | ||
Selected option value: {selected} | ||
<button className='argo-button argo-button--base' onClick={() => setSelected('option2')} >Select option 2</button> | ||
</h4> | ||
<Select | ||
value={store.state.selected} | ||
value={selected} | ||
placeholder='Select something' | ||
options={['option1', { value: 'option2', title: 'Option 2' }]} | ||
onChange={(option) => store.set({ selected: option.value })} | ||
onChange={(option) => setSelected(option.value)} | ||
/> | ||
</div> | ||
))), | ||
).add('multi-select', withState({ selected: 'option1' })(({store}: { store: Store<any> }) => ( | ||
() => ( | ||
)}, | ||
).add('multi-select', () => { | ||
const [selected, setSelected] = React.useState(['option1']); | ||
return ( | ||
<div> | ||
<Select | ||
value={store.state.selected} | ||
value={selected} | ||
multiSelect={true} | ||
placeholder='Select something' | ||
options={['option1', { value: 'option2', title: 'Option 2' }]} | ||
onMultiChange={(options) => store.set({ selected: options.map((item) => item.value) })} | ||
onMultiChange={(options) => setSelected(options.map((item) => item.value))} | ||
/> | ||
</div> | ||
))), | ||
)}, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.