-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 node 8 / yarn #4361
Switch to node 8 / yarn #4361
Conversation
We need version 2 instead of 3.
Use `files` attributes to whitelist files that should be in node package, instead of blacklisting in .npmignore. This helps avoiding any leaks in dotfiles or uploading any unwanted file.
The package can now be used with yarn v1.3, and scripts use yarn as default. Anyway, the package will still work with npm v4.
This ensures only one copy of `jquery` and `@types/jquery` are installed when using yarn.
@bernd already asked, and yes, the warnings are afaik "okay" because Yarn is warning that some of our required packages are coming through |
I also want to explain a bit more about what I saw during my tests with local modules for future reference. I hope I don't miss anything, but it's in the end a complex process and I only grasp some things that are done there. I hope it helps to understand what's going on, since we can't write comments in the npm v4.6Doing
Both Also all binaries installed are linked in the yarn v1.3Doing
As you can see, there's no call to Binaries are also linked in the npm v5.5This version has different behaviours when the local dependency is in a subfolder, or on a different tree. First for a subfolder, like when executing in
This case is quite similar to what Yarn v1.3 does, just using symlinks instead of copying folders. Now let's see what happens when installing a local module from a different subtree, like when executing
The little change on how dependencies are installed makes that our plugins will have very little dependencies, as most of them come through the (local) I haven't found a way of using the "old" behaviour, just some (mostly unanswered) questions in github. |
@bernd also saw another issue with |
Testing the production build worked well for me. The unmet peer dependencies are still there, of course, but other than that I did not notice anything unusual. |
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.
Please do!
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.
👍
Node 8.9.1 was released a few days ago and it is a LTS release. As we are still in an early stage for 3.0, we can switch to it and get some improvements in our builds while minimizing the risks of this update. This version comes along with npm 5, which made important changes in the way local dependencies are installed:
We are heavily affected by that change in npm 5, as our internal
graylog-web-plugin
andeslint-config-graylog
packages will be installed in a completely different way as before, and so will their dependencies.On the past few days I have been trying to find some solution, and in the end I decided to go with Yarn in the future. It is a drop-in replacement of npm, so we could still go back to npm if we are not satisfied, and we only need to do some small changes to keep our builds working as they were before.
This PR switches our builds to Node 8.9.1 and Yarn 1.3.2, adapts some configuration files to that change, and also fixes an issue in the way we ignored files in the
graylog-web-plugin
module. The build should still work in npm v4, as long as Yarn is also installed in the system.Before merging this change we should ensure it works for a couple of people, both in full rebuilds with maven, as in development builds.