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

Monorepo: Update lru-cache dependencies (ESM) / Switch Browser Test Provider #2804

Merged
merged 19 commits into from
Jun 21, 2023

Conversation

holgerd77
Copy link
Member

@holgerd77 holgerd77 commented Jun 21, 2023

This PR updates different require-using dependencies, in particular the lru-cache dependency.

I've now "solved" the undefined/null-now-forbidden question for lru-cache by just using @ts-ignore, see also comment on trie library for some reasing, also opened this issue isaacs/node-lru-cache#308 on the lru-cache library, since - while also having some intuition why restricting on undefined and null makes sense - I also feel that e.g. for our use case this is still the cleanest way to do things.

Update: @ts-ignore doesn't work since it is stripped in the declaration files in the dist folder. I am now using any for this. Still feel this is the better solution than using an "UNDEFINED" string or whatever one could come up with.

@codecov
Copy link

codecov bot commented Jun 21, 2023

Codecov Report

Merging #2804 (dccc4e5) into master (005595c) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

Flag Coverage Δ
block 89.56% <ø> (ø)
blockchain 92.85% <ø> (ø)
client 87.08% <ø> (+0.01%) ⬆️
common 97.09% <ø> (ø)
devp2p 86.58% <ø> (ø)
ethash ∅ <ø> (∅)
evm 66.63% <ø> (ø)
rlp ∅ <ø> (∅)
statemanager 86.35% <ø> (ø)
trie 90.02% <100.00%> (-0.01%) ⬇️
tx 95.87% <ø> (ø)
util 85.31% <ø> (ø)
vm 77.15% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@holgerd77 holgerd77 changed the title Monorepo: Update lru-cache and other dependencies (ESM) Monorepo: Update lru-cache dependencies (ESM) / Switch Browser Test Provider Jun 21, 2023
@@ -19,6 +19,7 @@
"contributors": [
"Alex Beregszaszi <alex@rtfs.hu>"
],
"type": "commonjs",
Copy link
Member Author

Choose a reason for hiding this comment

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

I would want to keep this for now. It is generally not yet 100% clear what setting is appropriate here and on the VM browser tests work better when setting here to "commonjs"(lol).

// be some not so clean workaround.
//
// (note that @ts-ignore doesn't work since stripped on declaration (.d.ts) files)
protected _cache?: LRUCache<string, any>
Copy link

Choose a reason for hiding this comment

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

Suggested change
protected _cache?: LRUCache<string, any>
protected _cache?: LRUCache<string, Uint8Array>

Is this enough in your case?

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, we need undefined as a potential value within the current code setup, this is not allowed anymore by the lru-cache library, therefore the any typing as some kind of hack here.

acolytec3
acolytec3 previously approved these changes Jun 21, 2023
Copy link
Contributor

@acolytec3 acolytec3 left a comment

Choose a reason for hiding this comment

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

LGTM, as a starting point for getting browser tests running again.

Copy link
Contributor

@acolytec3 acolytec3 left a comment

Choose a reason for hiding this comment

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

LGTM

@acolytec3 acolytec3 merged commit a37f51f into master Jun 21, 2023
@acolytec3 acolytec3 deleted the update-lru-and-other-deps branch June 21, 2023 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants