-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Storybook for hyperapp components #3767
Conversation
WOW awesome @Zmoki !!! |
Indeed adding an example will allow us to test it 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 👍
"@storybook/hyperapp": "4.0.0-alpha.9", | ||
"babel-core": "^6.26.3", | ||
"babel-preset-env": "^1.7.0", | ||
"parcel": "^1.9.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have to bundle it with parcel?
"picostyle": "^2.0.1" | ||
}, | ||
"devDependencies": { | ||
"@storybook/addon-actions": "4.0.0-alpha.9", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you going to add examples for the addons support in this PR? If not, let's remove unneeded deps. Anyway please try to add addon-storysource, it will help with the live examples.
After the weekend I'll continue to work on this PR |
@@ -0,0 +1,3 @@ | |||
docs | |||
src | |||
.babelrc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this file actually needed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nah it shouldn't I think
@@ -0,0 +1 @@ | |||
export default config => config; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrapInitialConfig
is optional, you can omit it if it's not needed
"pragma": "h" | ||
} | ||
] | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you feel about adding it automatically like @storybook/react
does?
Things left to do here:
For now, there's nothing on https://storybooks-hyperapp.netlify.com because it's deployed from master. Examples for this branch are available on https://deploy-preview-3767--storybooks-hyperapp.netlify.com |
'react/jsx-uses-vars': 2, | ||
'react/react-in-jsx-scope': 0, | ||
}, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of this, you can add /** @jsx Foo.bar */
pragma to files that use jsx
See https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/react-in-jsx-scope.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use this approach for mithril, and it works well for us
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that sounds like a good suggestion!
.add('welcome', () => <Welcome />); | ||
|
||
storiesOf('Demo', module).add('button', () => ( | ||
<Button onclick={() => action('button-click')}>Click me</Button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
action(name)
returns a function, so this should be onclick={action('button-click')}
instead
@@ -0,0 +1 @@ | |||
module.exports = require('./dist/server/options'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is already unneeded.
Please apply changes from #3744 |
Hey @Zmoki what do you need from me to be able to finish this? |
Sorry for the delay. I'll is given work time next week and I will be able to finish it. |
Awesome! |
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
@Zmoki are you interested in finishing this so all the tests pass? No worries if you need more time! |
I've temporarily disabled netlify for hyperapp. Will return it back when it's relevant |
Happy to re-open when there's interest! |
Issue:
Hyperapp is a JavaScript micro-framework that uses JSX.
I started using hyperapp in a new project and I want to use storybook with it.
What I did
I added hyperapp to
app
and to gerenerators.How to test
Ok, I'll add example soon and update main docs.
Do I need add test? How I can do it?