-
-
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
Fixed date/color knobs by forcing a single version of react #1345
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1345 +/- ##
=======================================
Coverage 13.76% 13.76%
=======================================
Files 202 202
Lines 4621 4621
Branches 598 618 +20
=======================================
Hits 636 636
+ Misses 3473 3462 -11
- Partials 512 523 +11
Continue to review full report at Codecov.
|
@@ -58,6 +58,7 @@ storiesOf('Button', module) | |||
|
|||
// NOTE: color picker is currently broken |
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 if it's fixed, please remove this 😄
@@ -20,9 +20,6 @@ | |||
"type": "git", | |||
"url": "https://github.com/storybooks/storybook.git" | |||
}, | |||
"scripts": { |
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 remove opencollective deps?
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 the postinstall was messing with hoisting which I experimented with, When refactoring the cli I will add a opencollective notice during first run or something like it.
@@ -9,11 +9,15 @@ shell.echo(chalk.bold(`${packageJson.name}@${packageJson.version}`)); | |||
shell.echo(chalk.gray('\n=> Clean dist.')); | |||
shell.rm('-rf', 'dist'); | |||
|
|||
const pwd = shell.pwd(); | |||
shell.echo(`pwd = ${pwd}`); | |||
shell.cd(path.join(__dirname, '..')); |
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 what's this for?
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 WAS run inside each folder, using the babel binary from root, but presets from package folders.
This changes so the directory where babel is run from IS root, so presets are taken from there. This will allow us to clean up the babel presets dependencies in packages a bit.
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 you explain this a bit more? Doesn't babel end up looking for the preset in root if it doesn't find it in the package anyway (w/ standard node_modules
resolution algorithm).
Generated by 🚫 dangerJS |
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 this is beautiful. i don't understand what's going on, so some comments would help, and see my other comments as well, but this is a great fix. thanks for figuring it out! WIZARD.
Wouldn't it be better to sort out the actual problem? Why are there multiple instances of 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.
I think this PR should be split up into different parts, it seems to be doing a few things at once that should be discussed separately
@@ -1,17 +1,20 @@ | |||
node_modules | |||
*.log | |||
.idea | |||
|
|||
package-lock.json |
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 we should be ignoring these files (also yarn.lock
)
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.
I guess that makes sense but it certainly feels weird to be ignoring a file that npm tells you to check in. We should open an issue about this I guess
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.
@@ -9,11 +9,15 @@ shell.echo(chalk.bold(`${packageJson.name}@${packageJson.version}`)); | |||
shell.echo(chalk.gray('\n=> Clean dist.')); | |||
shell.rm('-rf', 'dist'); | |||
|
|||
const pwd = shell.pwd(); | |||
shell.echo(`pwd = ${pwd}`); | |||
shell.cd(path.join(__dirname, '..')); |
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 you explain this a bit more? Doesn't babel end up looking for the preset in root if it doesn't find it in the package anyway (w/ standard node_modules
resolution algorithm).
If my understanding is correct, this issue is caused by multiple loading problems due to npm linking. Is it an issue that affects actual apps (i.e. w/o linking)? If not, we should NOT be changing the behaviour of the library to serve our testing purposes IMO. There are two ways forward w/o this change:
|
@ndelangen Date/color knobs seem to be working again, independent of this change. OK if I close this? |
@ndelangen can we close this now? |
Issue: broken UI widgets caused by multiple instances of react during development
What I did
Add a webpack resolve for react so it's always loaded from a single place
How to test