-
-
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
SWITCH to circleci over travisCI && CHANGE lerna bootstrap procedure: #1486
Conversation
- Use yarn for installation - Hoist all dependencies to root - Hoist known packages to root - Test storyshots in cra-kitchen-sink
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 we separate these? The circle script seems awesome, but it seems an orthogonal concern to "true hoisting"+testing cra-kitchen-sink
@@ -20,3 +20,5 @@ function loadStories() { | |||
} | |||
|
|||
configure(loadStories, module); | |||
|
|||
export { getStorybook }; |
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.
What's going on with this change?
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.
getStorybook returns a hash-table of stories.
If the config would export this, we can make storyshots framework agnostic 🎉
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 seems great, although can you explain a bit more why? Should this be part of this PR? It sounds like a seperate thing
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 does exporting getStorybook
help exactly? i'm already familiar with the function.
8abffd8
to
ca112c0
Compare
ca112c0
to
9faced5
Compare
Codecov Report
@@ Coverage Diff @@
## master #1486 +/- ##
==========================================
+ Coverage 14.54% 14.54% +<.01%
==========================================
Files 202 202
Lines 4649 4647 -2
Branches 502 497 -5
==========================================
Hits 676 676
Misses 3549 3549
+ Partials 424 422 -2
Continue to review full report at Codecov.
|
No we cannot split this, TravisCI fails and I just don't see a good reason to spend time on fixing it. What's your reason for splitting? is it too big to review? Is there any other way to get this approved? I'm interested in doing a demo video anyway, would that help? |
Could you not first do the circle changes and then a second pr targeting the first with the cra-ks changes. Yes, I'll admit I have a lot of trouble properly reviewing these big PRs. There are some important subtleties around this symlinking stuff that it is hard enough to keep straight in my head without also needing to figure out if any given change is relevant to the fix. Small PRs=non-linearly better imo |
addons/storyshots/src/index.js
Outdated
filename: configPath, | ||
dirname: configDirPath, | ||
}; | ||
// const babelConfig = loadBabelConfig(configDirPath); |
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.
Well correct me if I'm wrong: jest can do babel transpilation, why are we doing it?
I don't understand why we're using require.requireActual either
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 we're not using it, why comment it out? why not just delete it?
@@ -19,4 +19,5 @@ setTimeout( | |||
); | |||
|
|||
AppRegistry.registerComponent('ReactNativeVanilla', () => StorybookUI); | |||
export default StorybookUI; | |||
|
|||
export { StorybookUI as default, getStorybook }; |
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.
same question here
package.json
Outdated
"bootstrap:docs": "cd docs && yarn install", | ||
"bootstrap:react-native-vanilla": "lerna exec --scope react-native-vanilla -- yarn install", | ||
"bootstrap:test-cra": "npm run build-packs && lerna exec --scope test-cra -- yarn install", | ||
"build": "npm run bootstrap:docs && npm run docs:build", |
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 we need this? bootstrap:docs
alone should be fine?
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 don't think I'm calling this script anywhere, will remove.
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 you can get rid of docs:build
too
package.json
Outdated
@@ -25,15 +27,14 @@ | |||
"lint:js": "eslint . --cache --cache-location=.cache/eslint --ext .js,.jsx,.json", | |||
"lint:md": "remark .", | |||
"publish": "lerna publish", | |||
"start": "serve ./docs/out --single", |
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.
add serve
as dev dependency? i think you are mixing in some of your docsv2 stuff 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.
will remove
scripts/hoist-internals.js
Outdated
.then(() => { | ||
shell.echo(chalk.green('COMPLETE'), chalk.gray('=> Hoisting internal packages')); | ||
}) | ||
.catch(() => { |
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.
print error
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.
commented but did not test yet
🎉 |
@@ -2,7 +2,7 @@ export class AddonStore { | |||
constructor() { | |||
this.loaders = {}; | |||
this.panels = {}; | |||
this.channel = null; | |||
this.channel = { on() {}, emit() {} }; |
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.
Hmm, I think this change is going to just make it harder to debug problems with multiple loading. Why did you add it @ndelangen ?
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.
Great point. Let's take this out unless it's necessary!
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 giving us so much grief, I thought we could do without?
To the best of my abilities, everything actually works, there's no multiple loading going on.
It should never occur to not have set the channel.
Having said that, I think it's just really wrong to have a setup where side effects have such a major impact on whether a test can be run.
The channels is completely unneeded to run the snapshots for example, yet they have caused a lot of pain for a lot of users.
I just want people to be able to use and develop this. I think this code facilitates that better then without.
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 completely disagree. if this doesn't get overwritten it will cause an error to fail silently! having been bit by this bug before, it will be even harder to debug when there is a problem!
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 have to agree with @shilman here, it's better that our or even a user's tests fail than they can't actually run storybook or an addon in the first place and can't figure out why (it's hard enough with the channel undefined error in the first place).
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 we want to have a way to "ignore" the error, maybe that's a feature worth adding, if it's sometimes impossible to avoid the multi-loading problem. Something like initStoryshots({ nullChannel: true})
?
Issue:
Because of this modules are not singletons during development.
This leads to a list of problems, like duplicate react, no channel in
lib/addons
..What I did
--hoist
How to test
example/cra-kitchen-sink
should be successful