Skip to content
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

feat(builder): add cacheStrategy option #520

Merged

Conversation

rafaelss95
Copy link
Member

@rafaelss95 rafaelss95 commented May 29, 2021

@rafaelss95 rafaelss95 force-pushed the feat/builder-cache-strategy branch 2 times, most recently from 64aee5b to 46c96a9 Compare May 29, 2021 01:21
@nx-cloud
Copy link

nx-cloud bot commented May 29, 2021

Nx Cloud Report

CI ran the following commands for commit fabd4ee. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch

Status Command
#000000 nx run-many --target=build --all --parallel
#000000 nx run-many --target=check-configs --all --parallel
#000000 nx run-many --target=test --all --parallel
#000000 nx run-many --target=typecheck --all --parallel

Sent with 💌 from NxCloud.

@@ -10,6 +10,7 @@ export interface Schema extends JsonObject {
fix: boolean;
cache: boolean;
cacheLocation: string | null;
cacheStrategy: 'content' | 'metadata' | null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't null be undefined here? Same as cacheLocation above.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that the Schema extends JsonObject, which doesn't accept undefined.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can optional property ?: be used?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, because it has the same effect of | undefined.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean add it into JsonObject.

fix: !!options.fix,
cache: !!options.cache,
cacheLocation: options.cacheLocation || undefined,
ignorePath: options.ignorePath ?? undefined,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change these to use ?? instead of ||?

|| was already doing everything we needed it to, and now technically with your change 0, NaN and '' will be set preferentially to undefined for these values, which is not desired. It may be unlikely that those values make their way through the code paths here, but there needs to be an objective reason to make this change in the first place IMO, and it seems objectively less desirable to me.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. I'll revert this 😃

@rafaelss95 rafaelss95 force-pushed the feat/builder-cache-strategy branch 6 times, most recently from 2217a4f to 2fedb53 Compare June 1, 2021 23:30
@rafaelss95 rafaelss95 force-pushed the feat/builder-cache-strategy branch from 2fedb53 to b5f4c62 Compare June 1, 2021 23:38
@codecov
Copy link

codecov bot commented Jun 1, 2021

Codecov Report

Merging #520 (fabd4ee) into master (9743b7b) will increase coverage by 1.47%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #520      +/-   ##
==========================================
+ Coverage   70.39%   71.86%   +1.47%     
==========================================
  Files          17       15       -2     
  Lines         689      654      -35     
  Branches      141      131      -10     
==========================================
- Hits          485      470      -15     
+ Misses        139      120      -19     
+ Partials       65       64       -1     
Impacted Files Coverage Δ
.../template-parser/src/convert-source-span-to-loc.ts

@rafaelss95 rafaelss95 marked this pull request as ready for review June 1, 2021 23:46
@JamesHenry
Copy link
Member

Thanks @rafaelss95!

@JamesHenry JamesHenry merged commit 427a9f5 into angular-eslint:master Jun 7, 2021
@rafaelss95 rafaelss95 deleted the feat/builder-cache-strategy branch June 7, 2021 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support to --cache-strategy option
3 participants