-
-
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
(3rd review round) riot integration (good luck) #4070
Conversation
a5fcd8f
to
f7821e2
Compare
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.
Super cool!, Left some comments, let me know if you need help?
app/riot/.npmignore
Outdated
@@ -0,0 +1,3 @@ | |||
docs |
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 should not be necessary
app/riot/.babelrc
Outdated
@@ -0,0 +1,24 @@ | |||
{ |
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 these configs very different from the one in the root?
Can we use the root's .babelrc ?
"@storybook/addon-storysource": "4.0.0-alpha.16", | ||
"@storybook/addon-viewport": "4.0.0-alpha.16", | ||
"@storybook/addons": "4.0.0-alpha.16", | ||
"@storybook/riot": "../../app/riot", |
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.
should be a version as well, as the above packages, yarn workspaces makes this work.
@@ -0,0 +1,6 @@ | |||
import riot from 'riot'; | |||
// eslint-disable-next-line |
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 disable eslint? if you're going to disable something, only disable specific rules.
@@ -0,0 +1,27 @@ | |||
import { storiesOf } from '@storybook/riot'; | |||
import { withBackgrounds } from '@storybook/addon-backgrounds'; | |||
import ButtonRaw from 'raw-loader!./Button.tag'; |
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.
If loading .tag as raw, we should add it to the default webpack config for riot
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.
The tag can be loaded as a component or as a string,
depends on developer's experience.
Some of them will instantiate the component with "mount" (with the riot-tag-loader)
And some of them will prefer to instantiate using a jsx-like notation (therefore with the raw-loader).
8631568
to
cc21438
Compare
30a05ba
to
6ceb89c
Compare
Codecov Report
@@ Coverage Diff @@
## master #4070 +/- ##
==========================================
- Coverage 40.58% 40.55% -0.04%
==========================================
Files 469 483 +14
Lines 5642 5750 +108
Branches 749 771 +22
==========================================
+ Hits 2290 2332 +42
- Misses 2984 3045 +61
- Partials 368 373 +5
Continue to review full report at Codecov.
|
0cc3a41
to
d561c64
Compare
d561c64
to
42c6070
Compare
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.
Few more questions =)
import { action } from '@storybook/addon-actions'; | ||
import ButtonRaw from './Button.txt'; | ||
|
||
compileNow(tag, ButtonRaw); |
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.
Can compileNow
get something that is not a tag
?
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.
sorry that is a bug will fix that right away
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.
thanks for pointing that out.
lib/cli/lib/helpers.js
Outdated
@@ -17,6 +17,9 @@ export async function getVersion(npmOptions, packageName, constraint) { | |||
} else if (/storybook/.test(packageName)) { | |||
current = devDependencies[packageName]; | |||
} | |||
if (packageName === '@storybook/riot') { |
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 is this needed ?
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.
oops, should have deleted that. Was there to make the build pass
"babel-register": "latest" | ||
}, | ||
"peerDependencies": { | ||
"babel-core": "^7.0.0 || ^8.0.0 || ^8.0.0-beta.6" |
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.
babel-loader
lib/cli/test/fixtures/riot/yarn.lock
Outdated
@@ -0,0 +1,4675 @@ | |||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. |
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 think yarn.lock is not needed in cli tests.
package.json
Outdated
@@ -187,5 +192,8 @@ | |||
"dependencies": "Dependency Upgrades", | |||
"other": "Other" | |||
} | |||
}, | |||
"dependencies": { | |||
"yarn": "^1.9.4" |
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.
😱
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.
my bad
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.
sorry
I would like also understand the problem you have with tests. I think we should solve this and remove all the riot things from context. |
I don't mind =) |
@igor-dv : render-riot is now fixed. @Hypnosphi @ndelangen @shilman @igor-dv don't hesitate to review when you get the chance. |
🔥 🚀 let's start and maintain this project together. Thanks for your good reactivity. |
Join our Slak |
Released as |
Issue:
What I did
Egencia (my company) decided a while ago to use riot.js as its only web component framework.
Since no support is possible yet on storybook for that framework,
I tried to write a POC to be able to use storybook with the riot components
How to test
Is this testable with Jest or Chromatic screenshots?
I have written the kitchen-sink project in riot.js, and some jest tests
Does this need a new example in the kitchen sink apps?
Done. (alpha version)
Does this need an update to the documentation?
yes
If your answer is yes to any of these, please make sure to include it in your PR.
For maintainers only: Please tag your pull request with at least one of the following:
["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]