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

Better addon apis & devkits for addons #6759

Merged
merged 45 commits into from
Jun 5, 2019
Merged

Conversation

ndelangen
Copy link
Member

Issue: creating addons is too complicated

What I did

With some new apis based on react hooks, this can be made much easier!

Our addons in the monorepo have grown to quite some complexity over time, because of backwards compatibility, feature creep of just because of "shit happens".

Because of this, it can be hard to point to one of our addons as an example on how to write addons.

This PR introduces "devkits", which are like tiny featureless addons that demonstrate a particular variant/type of addon.

We could move those devkits into their own repo as well, to make it easier for users to begin development of their own addon.

…deleting them

This DOES NOT set them to the URL, they are STILL REMOVED as always from main URL.
…e matches

if the name AND type match, it's very likely the same knob, checking the value was slower & caused and issue for me
when loading the value from url the first time. Open to other solutions too.
# Conflicts:
#	addons/backgrounds/src/containers/BackgroundSelector.tsx
#	addons/knobs/package.json
#	addons/knobs/src/KnobManager.js
#	addons/knobs/src/components/Panel.js
#	lib/ui/src/components/preview/preview.js
# Conflicts:
#	addons/backgrounds/src/containers/BackgroundSelector.tsx
#	lib/api/src/modules/addons.ts
@github-actions
Copy link
Contributor

github-actions bot commented May 16, 2019

Fails
🚫 PR is marked with "do not merge" label.

Generated by 🚫 dangerJS against 88ec8de

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

Looks great. Left a bunch of comments inline, none of them particularly crucial other than the documentation issues, which I believe is what this is supposed to address.

Are you ok with delaying merge until after 5.1 ships?

addons/design-assets/package.json Outdated Show resolved Hide resolved
addons/design-assets/src/panel.tsx Show resolved Hide resolved
dev-kits/addon-parameter/package.json Outdated Show resolved Hide resolved
dev-kits/addon-parameter/README.md Outdated Show resolved Hide resolved
examples/dev-kits/addons.js Outdated Show resolved Hide resolved
examples/dev-kits/README.md Show resolved Hide resolved
examples/dev-kits/config.js Show resolved Hide resolved
lib/api/src/index.tsx Outdated Show resolved Hide resolved
@vercel vercel bot temporarily deployed to staging May 20, 2019 22:34 Inactive
# Conflicts:
#	.teamcity/OpenSourceProjects_Storybook/buildTypes/OpenSourceProjects_Storybook_Bootstrap.kt
#	docs/src/pages/addons/writing-addons/index.md
#	docs/yarn.lock
#	examples/official-storybook/package.json
#	lib/ui/src/containers/preview.js
#	package.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants