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

(3rd review round) riot integration (good luck) #4070

Merged
merged 45 commits into from Aug 30, 2018

Conversation

libetl
Copy link
Member

@libetl libetl commented Aug 24, 2018

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"]

@libetl libetl changed the title riot integration [NOT READY, NOT ABLE TO JEST] riot integration Aug 24, 2018
ndelangen
ndelangen previously approved these changes Aug 24, 2018
Copy link
Member

@ndelangen ndelangen left a 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?

@@ -0,0 +1,3 @@
docs
Copy link
Member

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

@@ -0,0 +1,24 @@
{
Copy link
Member

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",
Copy link
Member

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
Copy link
Member

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';
Copy link
Member

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

Copy link
Member Author

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).

@ndelangen ndelangen dismissed their stale review August 24, 2018 18:53

I meant to request changes

@libetl libetl force-pushed the task/riot-integration branch 8 times, most recently from 8631568 to cc21438 Compare August 25, 2018 22:25
@libetl libetl changed the title [NOT READY, NOT ABLE TO JEST] riot integration [NOT READY, JEST'ing] riot integration Aug 25, 2018
@libetl libetl force-pushed the task/riot-integration branch 3 times, most recently from 30a05ba to 6ceb89c Compare August 26, 2018 10:35
@codecov
Copy link

codecov bot commented Aug 26, 2018

Codecov Report

Merging #4070 into master will decrease coverage by 0.03%.
The diff coverage is 36.69%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
lib/cli/bin/index.js 0% <ø> (ø) ⬆️
lib/cli/bin/generate.js 0% <0%> (ø) ⬆️
...hots/storyshots-core/src/frameworks/riot/loader.js 0% <0%> (ø)
app/riot/src/server/options.js 0% <0%> (ø)
app/riot/src/client/preview/compileNow.js 0% <0%> (ø)
app/riot/src/server/wrapInitialConfig.js 0% <0%> (ø)
app/riot/bin/index.js 0% <0%> (ø)
app/riot/src/server/build.js 0% <0%> (ø)
app/riot/src/client/preview/globals.js 0% <0%> (ø)
app/riot/bin/build.js 0% <0%> (ø)
... and 22 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fb2396b...eda3f40. Read the comment docs.

@libetl libetl force-pushed the task/riot-integration branch 6 times, most recently from 0cc3a41 to d561c64 Compare August 26, 2018 15:59
@libetl libetl changed the title [NOT READY, JEST'ing] riot integration (ready for review) riot integration Aug 26, 2018
@libetl libetl requested a review from shilman as a code owner August 26, 2018 16:32
Copy link
Member

@igor-dv igor-dv left a comment

Choose a reason for hiding this comment

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

Few more questions =)

docs/src/pages/basics/guide-riot/index.md Outdated Show resolved Hide resolved
import { action } from '@storybook/addon-actions';
import ButtonRaw from './Button.txt';

compileNow(tag, ButtonRaw);
Copy link
Member

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?

Copy link
Member Author

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

Copy link
Member Author

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/generators/RIOT/template/stories/index.stories.js Outdated Show resolved Hide resolved
@@ -17,6 +17,9 @@ export async function getVersion(npmOptions, packageName, constraint) {
} else if (/storybook/.test(packageName)) {
current = devDependencies[packageName];
}
if (packageName === '@storybook/riot') {
Copy link
Member

Choose a reason for hiding this comment

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

Why is this needed ?

Copy link
Member Author

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"
Copy link
Member

Choose a reason for hiding this comment

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

babel-loader

package.json Show resolved Hide resolved
@libetl libetl changed the title (to review, again) riot integration (good luck) (3rd review round) riot integration (good luck) Aug 30, 2018
@@ -0,0 +1,4675 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
Copy link
Member

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"
Copy link
Member

Choose a reason for hiding this comment

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

😱

Copy link
Member Author

Choose a reason for hiding this comment

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

my bad

Copy link
Member Author

Choose a reason for hiding this comment

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

sorry

@igor-dv
Copy link
Member

igor-dv commented Aug 30, 2018

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.

@igor-dv
Copy link
Member

igor-dv commented Aug 30, 2018

I don't mind =)

@libetl
Copy link
Member Author

libetl commented Aug 30, 2018

@igor-dv : render-riot is now fixed.

@Hypnosphi @ndelangen @shilman @igor-dv don't hesitate to review when you get the chance.

@Hypnosphi Hypnosphi merged commit 5676863 into storybookjs:master Aug 30, 2018
@libetl
Copy link
Member Author

libetl commented Aug 31, 2018

🔥 🚀 let's start and maintain this project together. Thanks for your good reactivity.

@igor-dv
Copy link
Member

igor-dv commented Aug 31, 2018

Join our Slak

@Hypnosphi
Copy link
Member

Released as 4.0.0-alpha.20

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.

None yet

4 participants