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
[NDS-629] Clean up console warnings #282
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Getting the following errors when trying to test this branch:
|
clemensp
approved these changes
Apr 25, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The problem
We had a very noisy console when interacting with Yarn.
These warnings were caused by several different issues, outlined below:
Unmet peer depdencies
NPM/Yarn doesn't automatically install peer dependencies anymore as of version 3. This means when something specifies a peer dependency, you have to also add it to your project's dev dependencies.
Plugins are now starting to include this in their installation instructions, e.g Airbnb's eslint config (More info on dependencies)
These need to be solved two ways:
In packages we're using
In packages we're using directly, we need to include their peer deps in our dev deps. The majority of our warnings came from Airbnb and Babel's React preset and loader so I installed those dependencies to the appropriate project.
In peer dependencies in packages we're using
Warnings in nested packages need to be fixed by package authors.
They are both currently being fixed by package authors:
Gatsby incorrect peer dependencies
These were an issue with the version of Gatsby we were using and were solved with an upgrade.
The engine sketch appears to be invalid
This is a relic from the story2sketch prototyping we did a long time ago. I removed all of those dependencies as we aren't using that.
Root React dependency
Yarn gave us this warning until I added react and react-dom to the root
package.json
. I'm not confident this was the right solution, but it didn't seem to break anything. Would like some feedback here if there's a better way to accomplish this.Expected current state
When using a yarn command you should only see the following warnings:
One warning should go away with the next minor version update, and the other will go away when we upgrade to Storybook v5.
To prevent in the future
We just need to pay attention when adding new plugins to see if there's additional work to include their peer dependencies and add those at the same time. It only got so noisy because we weren't doing this and so a few things added up.