-
Notifications
You must be signed in to change notification settings - Fork 3.4k
fix: remove extra bundled electron in 10.0 binary #20932
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
Changes from all commits
66edbe0
95e6c8d
4d72fac
8446c36
72d06c0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,7 +23,6 @@ | |
| "minimist": "1.2.6" | ||
| }, | ||
| "devDependencies": { | ||
| "electron": "15.3.5", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we are back to relying on the magic of hoisting to make our dependencies resolve 😢
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I noted this in the PR comment:
It's not magic, it's the node module resolution. At least in this case it's explicitly hoisted at the root
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems more correct to me to put the electron dependency in @packages/electron since the purpose of that package is to expose it, and not put it in root because it's more convenient, have some separation of concerns. Yarn also explicitly discourages adding deps to the root workspace. This is just being done this way because it's convenient 😛
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I hear that. And if that's what we want then we'd prob need to scope that out a bit, b/c that'd be a decent change as it's not how importing It's also not adding as a dep, it's a just a devDep, since
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just looking, isn't it weird that we listed Edit: I suppose it was due to // ensure we have an electronVersion set in package.json
if (!(electronVersion = pkg.devDependencies.electron)) {
throw new Error('Missing \'electron\' devDependency in ./package.json')
}or the fact we have I don't fully understand why it's weird to put it at the top level, considering it's a hard dependency across multiple packages. What exactly makes workplace root dependencies a bad practice? I haven't worked with complex monorepos before Cypress, so I don't fully understand the implications - asking for my own understanding, as opposed to a review of this part of the PR.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I personally think it's fine to have it at the root, it actually avoids hoisting, where hoisting is defined as a peer By putting it in the root as a devDependency, you're basically saying "this is needed in multiple places in the repo during development, so keep a single copy here". I actually kind of wish we did that with more dev only things like
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah was thinking the same thing, we definitely need to have a centralised mocha/chai for consistency across the mono repo. |
||
| "electron-packager": "15.4.0", | ||
| "execa": "4.1.0", | ||
| "mocha": "3.5.3", | ||
|
|
||

Uh oh!
There was an error while loading. Please reload this page.
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.
Should we not leave it as a
devDependencyhere, since it's imported indata-context? (if only for types withimport type)? Or is this the same thing as what @flotwig mentioned above, where we now rely on rootpackage.jsonto have the dependency via hoisting?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 it's possible if we have it defined in multiple places as devDependencies someone will update & forget to update in all places and have an extra electron installed locally. For packages like this that need to be enforced as singletons, I find it's simples to keep it explicitly defined in a single place at the root.
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 might have broke the
ELECTRON_RUN_AS_NODEfeature. docs: https://docs.cypress.io/guides/continuous-integration/introduction#Running-headless-tests-without-Xvfb#23636