Conversation
99a870c to
c7de861
Compare
c7de861 to
d0eea10
Compare
package.json
Outdated
There was a problem hiding this comment.
By loosening our required versions (in package.json, yarn.lock makes them strict) we allow yarn to flatten our node_modules more. This is good for efficiency, but also necessary for some of our dependencies
With strict versions in Kibana yarn was installing 12 copies of moment.
# find node_modules -path '*node_modules/moment'
node_modules/moment-timezone/node_modules/moment
node_modules/statehood/node_modules/moment
node_modules/moment
node_modules/hapi/node_modules/moment
node_modules/libesvm/node_modules/moment
node_modules/grunt-esvm/node_modules/moment
node_modules/inert/node_modules/moment
node_modules/bunyan/node_modules/moment
node_modules/vision/node_modules/moment
node_modules/h2o2/node_modules/moment
node_modules/even-better/node_modules/moment
node_modules/makelogs/node_modules/momentThis caused bugs and test failures because we rely on moment having the same internal state everywhere, especially in moment-timezone, but moment-timezone depends on moment@^2.6.0. With npm this a satisfied by our dependency on moment@2.13.0, but yarn attempts to get the latest version of moment it can for moment-timezone, causing it to install moment@2.19.3 into moment-timezone/node_modules. When Kibana and moment-timezone depend on a ^ version of moment they both get the most recent version, installed once in the root node_modules directory.
With looser versions, yarn installs one version of moment
node_modules/moment
Overall, with strict versions kibana installs 2521 modules (88k files) and with looser versions kibana installs 2296 modules (82k files). A decent win.
d0eea10 to
55a0a79
Compare
1a193d4 to
00aa707
Compare
|
I've got a PR in to fix the blocker: yarnpkg/yarn#5059. Let's see if it's accepted. |
|
@spalger, un-assigning myself until the yarn PR is merged. |
d6df8d9 to
2f0c85c
Compare
|
NOTE: need to verify that |
|
I made some review fixes, plus I locked some versions specifically in the yarn.lock file so we don't have several versions of angular, moment, etc |
|
Discussed with @spalger, went with e.g. because of the outdated React packages right now we get this warning because of forcing this: |
|
jenkins, test this |
tasks/vendor/README.md
Outdated
| The currently vendored version of Yarn contains the bugfix in | ||
| https://github.com/yarnpkg/yarn/pull/5059, which handles optional dependencies. | ||
|
|
||
| To build a new Yarn bundle, check out that pull requst and run: |
tasks/vendor/README.md
Outdated
| To build a new Yarn bundle, check out that pull requst and run: | ||
|
|
||
| ``` | ||
| yarn run build-bundle |
src/dev/ci_setup/setup.sh
Outdated
| ### | ||
| ### downloading yarn | ||
| ### | ||
| yarnVersion="$(node -e "console.log(String(require('./package.json').engines.yarn || '').replace(/^[^\d]+/,''))")" |
There was a problem hiding this comment.
Shouldn't we be using tasks/vendor/yarn-1.3.2-with-ignore-fix.js or am I missing something?
There was a problem hiding this comment.
Yeah, we should probably do that. I'll fix.
There was a problem hiding this comment.
We're going to need to put this back once yarnpkg/yarn#5059 is merged but 🤷♂️
|
Some more pros, like we need more...
|
* switch to yarn * cleanup misc references to npm * [yarn] loosen dependency ranges so yarn will merge more deps * fix linting error now that moment uses ESM * [licenses] font-awesome changed the format of its license id * Use local yarn * Misc fixes * eslintignore built yarn file * Remove mkdir which doesn't do what it should do * Check build without upgrading lots of versions * Fix license check * too many moments * Better description * Review fixes * Lock to angular@1.6.5 * More specific version locks * Revert "More specific version locks" This reverts commit 11ef811. * Revert "Lock to angular@1.6.5" This reverts commit 3ade68c. * rm yarn.lock; yarn * Forcing a specific version of React, Angular, Moment * Using vendored version of yarn in ci * Use --frozen-lockfile * fixes
* Switch to Yarn (#15485) * switch to yarn * cleanup misc references to npm * [yarn] loosen dependency ranges so yarn will merge more deps * fix linting error now that moment uses ESM * [licenses] font-awesome changed the format of its license id * Use local yarn * Misc fixes * eslintignore built yarn file * Remove mkdir which doesn't do what it should do * Check build without upgrading lots of versions * Fix license check * too many moments * Better description * Review fixes * Lock to angular@1.6.5 * More specific version locks * Revert "More specific version locks" This reverts commit 11ef811. * Revert "Lock to angular@1.6.5" This reverts commit 3ade68c. * rm yarn.lock; yarn * Forcing a specific version of React, Angular, Moment * Using vendored version of yarn in ci * Use --frozen-lockfile * fixes * Update lockfile
|
6.2/6.x: a817517 |
Resubmission of #8621
Closes #8621
This PR includes a vendored version of Yarn built from yarnpkg/yarn#5059.