-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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(node): Remove lru_map
dependency
#9300
feat(node): Remove lru_map
dependency
#9300
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, good change!
}, | ||
"devDependencies": { | ||
"@rollup/plugin-commonjs": "^25.0.5", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was this this just there for lru_map
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep!
public values(): Array<V> { | ||
const values: V[] = []; | ||
this._cache.forEach(value => values.push(value)); | ||
return values; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this over Array.from(this._cache.values())
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That triggers a lint:
ES6 methods not allowed: valueseslint(@sentry-internal/sdk/no-unsupported-es6-methods)
This method is currently only used by some tests...
Ref #9199
This PR:
LRUMap
to utilslru_map
Map.prototype.keys()
returns an iterator in order of insertion so the oldest entry key iskeys().next().value
lru_map
We could add
LRUMap
to@sentry/node
but it might be useful elsewhere and it's required in the Electron SDK and it would be better not to add an export to a public API.