GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||
GeezerVison is showing github.com — replace `lru-cache` dependency by mbtools · Pull Request #697 · npm/node-semver Conversation
Contributor
This change removes the dependency on the Performance looks to be very similar. However, it needs a realistic test case that pushes the limits of the cache. I will leave it to more experts to judge. References
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. lru-cache dependencylru-cache dependency
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
wraithgar
reviewed
Uh oh!
There was an error while loading. Please reload this page.
wraithgar
reviewed
Uh oh!
There was an error while loading. Please reload this page.
Closed
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
ljharb
reviewed
Uh oh!
There was an error while loading. Please reload this page.
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
lukekarrys
reviewed
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm in favor of this PR and converting our If we do land this, I think we should remove any functionality that we aren't currently using in
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page.
lukekarrys
reviewed
Uh oh!
There was an error while loading. Please reload this page.
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. lru-cache dependencylru-cache dependency
lru-cache dependencylru-cache dependency
|
There was an error while loading. Please reload this page.
|
@lukekarrys the title of this PR is intentionally not conventional so that we remember to rebase it into two commits: one for the deps change and one for the feat |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sounds good. We can certainly reduce the cache functions to a minimum. I just had them in there to prove to myself that it's working like lru-cache. If we're convinced the cache is fine, I suggest removing The cache is transparent to the outside of range parse. Showing that semver uses it properly, is / should be visible only using runtime measurements. Not sure how you prefer to implement those. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Here's a proof of concept showing how we could assure that subsequent const Semver = require('.') const cached = Symbol('cached') const r1 = new Semver.Range('1.0.0') r1.set[0][cached] = true const r2 = new Semver.Range('1.0.0') console.log(r1.set[0][cached]) // Will be true console.log(r2.set[0][cached]) // Will be true, showing it's cached. We can test this all inside a |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
This still runs the risk that we have code in there we never use and don't need. If we aren't using the code from I think the cache size is the only thing left right? Can we loop through 1001 versions to test that the first one dropped out of the cache? Can the max size be hard set in lru-cache for now? There's no need to pass it in if we never set it to anything else. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@wraithgar We still use a coverage map in this repo. I'm think that will require testing the cache directly to get full coverage, right? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
We can edit that file. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Here's an example of how we did it in npm itself when we wanted to test a component of all the commands in a new test file: https://github.com/npm/cli/blob/21b823edf7b3095ce1f53da7befda2b41296afe4/test/coverage-map.js |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I think that we should fix the tests but also not block this PR on "perfect" code. I'm good w/ this as-is (pending an actual review of the code at this point). We can clean it up on our own time. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
We have not forgotten about this PR. The big npm display layer refactor is almost done and then we can come back to things like this PR. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.