You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 17, 2023. It is now read-only.
This commit refactors the entire codebase, using less of a `C`
style and moves hopefully towards a more idiomatic Rust style.
The motivations for the refactor were to reduce duplicated code
(pulling code away from the call-site and into shared `impl`s) and
to improve the readability in the implementations of each sub-command.
This commit includes minor performance optimizations, namely through
reduced cloning, leading to ~10% faster runtimes on the `pin` and
`link` sub-commands.
Non-Breaking Changes
====================
crate `regex` has been replaced with `rsplit_once`, bringing runtime
and compile-time improvements.
This commit builds on the findings of the previous commit, in which
use of the top-level `dist` directory introduced a race condition
when invoking multiple make targets in parallel.
After refactoring to avoid the race condition, it became apparent
that the top-level `dist` directory was reduced to a pointless
indirection. We reduce complexity in this commit by entirely removing
the top-level `dist` directory as an endpoint for `npm pack`-ed
archives.
Instead, we let `npm pack` place each archive directly in the
package directory containing that package's source code, and
then hardlink the archive into the required dependent package's
`.internal-npm-dependencies` directory. This implementation removes
the desire to use npm 7's `--pack-destination` flag, which means we
will not have to eventually break support for npm 6 and earlier.
Breaking changes
================
BREAKING CHANGE: drop support for the `--ignore` flag
We drop support for the `--ignore` flag as it was poorly documented,
not widely used, and adding a bit of complexity in the code that
wasn't justified by the utility it added.
Future Work
===========
While this refactor does bring some marginal performance improvements,
we will need to break out of the nearby local maximum by refactoring
again to utilize multiple CPU cores. This refactor will again have
wide-reaching diffs and implications, so we shouldn't spend too much
time with the current architecture and instead look forward to a more
parallel-iterators based approach. We can map-reduce reading of the
package manifests and then work with the data once all results are in.
Each sub-command currently runs in about 80 milliseconds on my humble
i7 for a 60-package project, so I do not anticipate that this refactor
will be required on a wall-clock basis any time soon.
0 commit comments