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

fix(perf): avoid using klona for postcss options #658

Merged
merged 2 commits into from Jun 9, 2023

Conversation

alexander-akait
Copy link
Member

This PR contains a:

  • bugfix
  • new feature
  • code refactor
  • test update
  • typo fix
  • metadata update

Motivation / Use-Case

Do not use klona - better perf and less deps

Breaking Changes

No

Additional Info

No

@codecov
Copy link

codecov bot commented Jun 9, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.07 ⚠️

Comparison is base (69446c3) 88.76% compared to head (71ec9be) 88.70%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #658      +/-   ##
==========================================
- Coverage   88.76%   88.70%   -0.07%     
==========================================
  Files           3        3              
  Lines         356      354       -2     
  Branches      115      115              
==========================================
- Hits          316      314       -2     
  Misses         37       37              
  Partials        3        3              
Impacted Files Coverage Δ
src/index.js 95.45% <100.00%> (ø)
src/utils.js 86.41% <100.00%> (-0.11%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@alexander-akait alexander-akait merged commit e754c3f into master Jun 9, 2023
17 checks passed
@alexander-akait alexander-akait deleted the fix-avoid-using-clone branch June 9, 2023 23:35
@@ -185,11 +184,9 @@ async function loadConfig(loaderContext, config, postcssOptions) {
options: postcssOptions || {},
};

result.config = result.config(api);
return { ...result, config: result.config(api) };

Choose a reason for hiding this comment

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

Very uninformed questions, but this is not the same as a deep clone :

  • Will it not create issue ?
  • Was a deep clone here an overkill in the first place ?

Thank you for your time ! You are a pillar of the Webpack ecosystem !

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, it is not deep clone, but here result, contains only path, so we can use to use ..., just to avoid mutable result

Will it not create issue ?
Was a deep clone here an overkill in the first place ?

As I said above, there is no deep only, here the config property from require and path (it just a string)

Choose a reason for hiding this comment

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

Ok thank you so mush for the details and your time. Have a nice day !

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.

None yet

2 participants