-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Fix slow build issue #2543
Fix slow build issue #2543
Conversation
New, updated, and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: npm/[email protected], npm/[email protected], npm/[email protected] |
group-income
|
Project |
group-income
|
Branch Review |
fix-slow-build-issue
|
Run status |
|
Run duration | 10m 52s |
Commit |
|
Committer | Snowteamer |
View all properties for this run ↗︎ |
Test results | |
---|---|
|
0
|
|
0
|
|
10
|
|
0
|
|
112
|
View all changes introduced in this branch ↗︎ |
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.
Nice work @snowteamer tracking this down!
Left one question for you + some questions here:
- Is there any way to track down the specific dependency that is causing this and only alter that?
- Regarding the instructions, I don't quite understand them, because they both say to run
npm i
and not to runnpm i
:
"To patch lockfile, run [...] npm i"
[..]
If testing locally, please make sure to do npm ci once rather than npm i before grunt commands, to avoid the lockfile being altered.
Can you explain?
(What does npm ci do?)
- And what happens if you delete the
package-lock.json
file and create it afresh? Ideally we'd want the latest of everything, with the minimal number of changes to it.
b1f60db is really far back in the history, so I'd like to leave as many of the dependencies at their later version as possible, but this PR makes over 12k changes to the package-lock.json
file, making it hard to review and figure out what's going on.
@@ -119,7 +119,7 @@ export const subscriptionInfoWrapper = (subcriptionId: string, subscriptionInfo: | |||
let salt | |||
let uaPublic | |||
|
|||
return function (this: Object) { | |||
return function (/* this: Object */) { |
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.
Why was this commented out? 🤔
(I think @corrideat added this for some specific reason)
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.
It caused a syntax error, complaining about function (this)
being invalid code, like if only the : Object
part had been removed when transpiling JS with Flow annotations to plain JS.
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.
@snowteamer What complained about a syntax error? It's definitely a JavaScript syntax error (this
isn't allowed as an identifier), but it's not a Flow (or TypeScript syntax error), and this annotation is used to represent the type of this
.
For example:
type Foo = {
bar: number
}
function usesFoo(this: Foo) {
// Ok, because we've declared `this` should be of type `Foo`
alert(this.bar)
}
function usesFoo() {
// Not ok, because this is assumed to be `window` / `self` / `globalThis`,
// and `.bar` is an invalid property of the global object.
alert(this.bar)
}
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.
Replying to myself, if the error is Flow-related, it could be because packages such as @babel/plugin-syntax-flow
are being downgraded with this PR, and the older version maybe didn't have support for these this
annotations.
I would like to. For now I don't know. The first That old lockfile specified some different dependencies, so I've used On the other hand,
That's why I've shared how to generate the file, rather than just submitting it. Granted, this still doesn't make clear which node modules have changed though. |
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.
@snowteamer based on everything you've said I decided to follow your instructions and re-created the package-lock.json
file locally.
Perhaps because I was the one who created it originally, my recreation of it appears to have resulted in a significantly smaller set of changes to the file. I'm guessing it's because the file is OS-dependent.
In my tests this does seem to have fixed the issue, and it didn't require changes to the source either.
So I've pushed these changes here and have credited you:
Could you please try pulling master
locally and let me know if the new lock file fixes the build times for you too?
@taoeffect Did you do |
@snowteamer I deleted my entire Does it work for you? |
Summary of changes
Additional information
The lockfile in this PR has been patched by doing the following:
If testing locally, please make sure to do
npm ci
once rather than anothernpm i
before grunt commands, to avoid the lockfile being altered.