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

reduce npm run invocations #893

Merged

Conversation

romainmenke
Copy link
Member

@romainmenke romainmenke commented Mar 19, 2023

npm run apparently has a high invocation cost. See : https://marvinh.dev/blog/speeding-up-javascript-ecosystem-part-4/

We had a lot of scripts that we didn't call directly but only existed to have some structure. e.g. "script-foo": "npm run script-foo:a && script-foo:b"

Unwrapping those and calling the scripts/functions directly resulted in a nice speedup.


The same principles could be applied to eslint.
Linting our code base individual packages doesn't make much sense because the linter doesn't do any whole program analysis. It only enforces a coding style.

We can run eslint from the root on all source files which is much faster because we save on startup costs.

@romainmenke romainmenke merged commit e243fa1 into main Mar 19, 2023
@romainmenke romainmenke deleted the reduce-npm-run-invocations--impartial-pied-tamarin-0603b84d45 branch March 19, 2023 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli common-tools experimental plugin-packs/postcss-preset-env plugins/css-blank-pseudo plugins/css-has-pseudo plugins/css-prefers-color-scheme plugins/media-queries-aspect-ratio-number-values plugins/postcss-media-queries-aspect-ratio-number-values plugins/postcss-attribute-case-insensitive plugins/postcss-cascade-layers plugins/postcss-color-function plugins/postcss-color-functional-notation plugins/postcss-color-hex-alpha plugins/postcss-color-rebeccapurple plugins/postcss-conditional-values plugins/postcss-custom-media plugins/postcss-custom-properties plugins/postcss-custom-selectors plugins/postcss-design-tokens plugins/postcss-dir-pseudo-class plugins/postcss-double-position-gradients plugins/postcss-env-function plugins/postcss-extract plugins/postcss-focus-visible plugins/postcss-focus-within plugins/postcss-font-format-keywords plugins/postcss-gap-properties plugins/postcss-global-data plugins/postcss-gradients-interpolation-method plugins/postcss-hwb-function plugins/postcss-ic-unit plugins/postcss-image-set-function plugins/postcss-is-pseudo-class plugins/postcss-lab-function plugins/postcss-logical plugins/postcss-logical-float-and-clear plugins/postcss-logical-resize plugins/postcss-logical-viewport-units plugins/postcss-nested-calc plugins/postcss-nesting plugins/postcss-normalize-display-values plugins/postcss-oklab-function plugins/postcss-overflow-shorthand plugins/postcss-place plugins/postcss-progressive-custom-properties plugins/postcss-pseudo-class-any-link plugins/postcss-scope-pseudo-class plugins/postcss-selector-not plugins/postcss-stepped-value-functions PostCSS Stepped Value Functions plugins/postcss-text-decoration-shorthand plugins/postcss-trigonometric-functions PostCSS Trigonometric Functions plugins/postcss-unset-value
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant