-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
WIP - add vue support #1267
WIP - add vue support #1267
Conversation
Codecov Report
@@ Coverage Diff @@
## release/3.2 #1267 +/- ##
===============================================
- Coverage 15.29% 14.35% -0.95%
===============================================
Files 202 234 +32
Lines 4706 4919 +213
Branches 627 686 +59
===============================================
- Hits 720 706 -14
- Misses 3456 3624 +168
- Partials 530 589 +59
Continue to review full report at Codecov.
|
app/vue/package.json
Outdated
"babel-core": "^6.24.1", | ||
"babel-loader": "^7.0.0", | ||
"babel-plugin-react-docgen": "^1.5.0", | ||
"babel-preset-es2015": "^6.24.1", |
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.
It's unnecessary to have es2015, es2016 here and in .babelrc (I noticed this for all the apps (react/react-native) - can switch to preset-env instead.
"es2015", "es2016"
-> "env"
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.
Yeah that's on my todolist 😅
I made some of the examples work but still a few issues to fix.
Waiting for some feedback before continuing |
@@ -52,7 +52,7 @@ export default function() { | |||
// Based on this CRA feature: https://github.com/facebookincubator/create-react-app/issues/253 | |||
modules: ['node_modules'].concat(nodePaths), | |||
alias: { | |||
'vue$': 'vue/dist/vue.esm.js' | |||
'vue': path.resolve(path.join(__dirname, '../../../node_modules', 'vue/dist/vue.esm.js')) |
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 needs a explanatory comment
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.
why do you change it? 🤔
I think 'vue$': 'vue/dist/vue.esm.js'
is correct.
See the docs:
https://vuejs.org/v2/guide/installation.html#Runtime-Compiler-vs-Runtime-only
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.
Not correct in our case because of webpack being in storybook/vue and not ine the example app.
Not pointing to the correct dep will have webpack load 2 times vie and thus make it impossible to ise extension or global custom components
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.
@kazupon I fyou could try to run the example s storybook and see if all the stories are working :)
examples/vue/package.json
Outdated
@@ -4,11 +4,11 @@ | |||
"private": true, | |||
"devDependencies": { | |||
"react-scripts": "0.9.5", | |||
"@storybook/vue": "^3.0.0", | |||
"@storybook/vue": "3.0.0-alpha.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.
@ndelangen @alexandrebodin If these deps are filled in by bootstrap, can we use *
?
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.
I'll try to see if that works ;)
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.
@shilman Ok so. Semver will not match a prerelease tag with *. Wee need to specify -tag
I will use ^3.0.0-alpha.0 to match any of the next versions until we up app/vue version to 3.x ;)
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.
@alexandrebodin can you explain a little more? i'm wondering if this is related to my problems on the kitchen-sink project.
@@ -31,7 +31,8 @@ module.exports = latestVersion('@storybook/react-native').then(version => { | |||
packageJson.devDependencies['@storybook/react-native'] = `^${version}`; | |||
|
|||
if (!packageJson.dependencies['react-dom'] && !packageJson.devDependencies['react-dom']) { | |||
packageJson.devDependencies['react-dom'] = '^15.5.4'; | |||
const reactVersion = packageJson.dependencies.react; |
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 did this get in here?
@@ -15,7 +15,8 @@ module.exports = latestVersion('@storybook/react-native').then(version => { | |||
packageJson.devDependencies['@storybook/react-native'] = `^${version}`; | |||
|
|||
if (!packageJson.dependencies['react-dom'] && !packageJson.devDependencies['react-dom']) { | |||
packageJson.devDependencies['react-dom'] = '^15.5.4'; | |||
const reactVersion = packageJson.dependencies.react; |
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 did this get in 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.
This was merged from master, no?
@ndelangen @alexandrebodin I took a first pass through the code and was surprised—it looks really good! My biggest concern at this point is addons. As far as a I can tell in the code above, when a Furthermore, I worry about changing the addon API with this release (e.g. cc @tmeasday |
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.
Looks great guys! Let's get a preview alpha out!
expect(storyWrapperProps.context).toEqual(testContext); | ||
}); | ||
}); | ||
}); |
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.
It's great to have some tests for knobs! Even better would be more tests that fully exercised it. I think we can do this later: #1355
@tmeasday alpha is already live AFAIK |
@kazupon @ndelangen @alexandrebodin mind fixing the conflicts so we can merge this and I can release an |
@shilman Will do in a few hours ;) |
Issue: #1262
What we did
storiesOf('myComponent').add()
How to test
After checkout out the branch locally run the commands:
TODO