Comments (6)
Thanks for the PR!
It doesn't seem to cause any performance issues. At least, the test suite doesn't slow down on your PR branch.
But once people start messing with the Node.js internals, it's hard to say what implications a change like this could have. So this would probably be a semver major change. Unfortunate timing that I just did a semver major release 2 weeks ago, it would have been nice to roll this into that! I'm not sure I want to do another so fast, unless there are more people affected by this issue.
So for now, could you just use your branch, or use patch-package to apply your patch? And then I will hopefully remember to put this in the next semver major release.
from fakeindexeddb.
yeah for now we've patched this locally so as long as it eventually™ gets merged/released, we'll be happy! Ty for the quick response!
from fakeindexeddb.
Just so that I understand fully: does it make fakeIndexedDB use a mocked setImmediate
, or does it make always use the non-mocked setImmediate
?
If this is the former, I wonder if this is the right tool: I understand you'd like to control better when fakeIndexedDB returns or something like that, but doesn't this export too much the internals (that fakeIndexedDB uses setImmediate for example)?
I'm not sure, just asking to get more opinions too :-)
from fakeindexeddb.
Just so that I understand fully: does it make fakeIndexedDB use a mocked
setImmediate
, or does it make always use the non-mockedsetImmediate
?
I'm updating the code to always fetch the current value for setImmediate
, whether that's mocked or not. So if some other code (like jest's fake timers) updates that, then fakeIndexedDB will use the updated version. I.e. our test initialization ordering won't be quite so fragile, if fakeIndexedDB happens to initialize before we mock the timers.
So... I think the answer to your question is "neither".
If this is the former, I wonder if this is the right tool: I understand you'd like to control better when fakeIndexedDB returns or something like that, but doesn't this export too much the internals (that fakeIndexedDB uses setImmediate for example)?
I'm not necessarily trying to get more control over fakeIndexedDB, just trying to make it behave like the rest of the code being tested. I.e. if we've mocked timers so that we can better control when time progresses, it was problematic that fakeIndexedDB would just continue chugging along because it was using the original setImmediate
, and thus it got out of sync with other code and broke some assumptions.
from fakeindexeddb.
@dumbmatter now that some months have passed, would it make sense to merge #93 and create another major release for it?
from fakeindexeddb.
It's in v6.0.0. I am still a little scared about this one!
from fakeindexeddb.
Related Issues (20)
- Add observation for Dexie users HOT 3
- [BUG] Context loosing for `FakeDOMStringList` members while wrapping IDB
- [BUG] Invalid behavior for concurrent insertion data HOT 1
- Ref of Observable from liveQuery is not reactive HOT 7
- fake-indexeddb fails when happy-dom is loaded prior to fake-indexeddb HOT 3
- Running this in Chrome throws "Cannot set property indexedDB of #<Window> which has only a getter" HOT 3
- Release new version to npm with latest types fix HOT 3
- DataCloneError: The data being stored could not be cloned by the internal structured cloning algorithm. HOT 2
- Problem storing and retrieving CryptoKeys HOT 2
- structuredClone and jsdom HOT 7
- `Uint8Array` keys don't respect offsets from underlying ArrayBuffers HOT 3
- Serializing (and restoring) the state of Fake IDB HOT 2
- `IDBObjectStore.count` is `O(n^2)` HOT 3
- Try using built-in Node.js Blob HOT 1
- How to read one of the chrome database HOT 1
- A value which is actually Date, but instanceOf Date equals false when use with jest+jsdom. HOT 5
- Index on Date type does not work HOT 7
- File support HOT 2
- Can I use this for a in memory only data view as a prod drop-in replacement? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fakeindexeddb.