Skip to content

Update fake-indexeddb 4.0.2 → 5.0.2 (major)#4877

Merged
canova merged 3 commits into
mainfrom
depfu/update/yarn/fake-indexeddb-5.0.2
May 30, 2024
Merged

Update fake-indexeddb 4.0.2 → 5.0.2 (major)#4877
canova merged 3 commits into
mainfrom
depfu/update/yarn/fake-indexeddb-5.0.2

Conversation

@depfu

@depfu depfu Bot commented Jan 6, 2024

Copy link
Copy Markdown
Contributor

Here is everything you need to know about this upgrade. Please take a good look at what changed and the test results before merging this pull request.

What changed?

✳️ fake-indexeddb (4.0.2 → 5.0.2) · Repo · Changelog

Release Notes

5.0.2

  • #94 - Improved performance of IDBObjectStore.count and IDBIndex.count.

5.0.1

  • #89 - Fixed bug where ArrayBuffer views were not being correctly handled when used as keys.

  • #88 - Added explanation to README.md about how to use fake-indexeddb v5+ with jsdom, since a structuredClone polyfill is not included anymore.

5.0.0

  • Dropped support for Node.js 16, which allows me to get rid of the structuredClone polyfill, which reduces the package size by roughly 50%.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 16 commits:


Depfu Status

Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.

All Depfu comment commands
@​depfu rebase
Rebases against your default branch and redoes this update
@​depfu recreate
Recreates this PR, overwriting any edits that you've made to it
@​depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@​depfu cancel merge
Cancels automatic merging of this PR
@​depfu close
Closes this PR and deletes the branch
@​depfu reopen
Restores the branch and reopens this PR (if it's closed)
@​depfu pause
Ignores all future updates for this dependency and closes this PR
@​depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@​depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)

┆Issue is synchronized with this Jira Task

@depfu depfu Bot added the dependencies Pull requests that update a dependency file label Jan 6, 2024
@depfu depfu Bot requested review from canova and julienw January 6, 2024 17:25
@julienw

julienw commented Jan 8, 2024

Copy link
Copy Markdown
Contributor

see #4796 (comment)

@depfu depfu Bot force-pushed the depfu/update/yarn/fake-indexeddb-5.0.2 branch from 821d5dd to 33a29ca Compare February 6, 2024 16:50
@canova

canova commented Feb 26, 2024

Copy link
Copy Markdown
Member

@​depfu rebase

@depfu depfu Bot force-pushed the depfu/update/yarn/fake-indexeddb-5.0.2 branch from 33a29ca to 5a83218 Compare February 26, 2024 11:04
@canova canova removed their request for review February 26, 2024 11:41
@canova

canova commented Feb 26, 2024

Copy link
Copy Markdown
Member

@julienw hey, I've updated the PR to import the structuredClone polyfill. Could you take a look at it? I also added core-js libdef, that's why it shows a large number on the added lines section.

@codecov

codecov Bot commented Feb 26, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.47%. Comparing base (720a43b) to head (434ef51).

Current head 434ef51 differs from pull request most recent head b0f490f

Please upload reports for the commit b0f490f to get more accurate results.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4877      +/-   ##
==========================================
- Coverage   88.48%   88.47%   -0.02%     
==========================================
  Files         304      304              
  Lines       27392    27249     -143     
  Branches     7400     7350      -50     
==========================================
- Hits        24239    24108     -131     
+ Misses       2931     2925       -6     
+ Partials      222      216       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@julienw julienw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks good to me, thanks.

I wonder if we can use this opportunity to use autoMockIndexedDB everywhere we need it. I'm fine doing it in a separate PR though. What do you think?

// fake-indexeddb no longer includes a structuredClone polyfill, so we need to
// import it explicitly.
import 'core-js/stable/structured-clone';
import { indexedDB, IDBKeyRange } from 'fake-indexeddb';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we use autoMockIndexedDB here and in the tests below instead of defining the polyfill manually?

@canova

canova commented May 30, 2024

Copy link
Copy Markdown
Member

Oops I forgot this PR 😅

@julienw

I wonder if we can use this opportunity to use autoMockIndexedDB everywhere we need it. I'm fine doing it in a separate PR though. What do you think?

That was my first instinct as well while looking at this PR back then. But turns out it's not possible to use autoMockIndexedDB in these tests because these tests are a bit different.

autoMockIndexedDB resets the mock indexedDB with beforeEach and afterEach between each subtests. But these tests use beforeAll and afterAll because each subtests actually use the same database and they require the DB not to be reset in between them. That's why it's not possible to use autoMockIndexedDB for them.

depfu Bot and others added 3 commits May 30, 2024 16:39
Since fake-indexeddb version 5, it doesn't include the structuredClone
polyfill. That's why we need to import that where needed.
@canova canova force-pushed the depfu/update/yarn/fake-indexeddb-5.0.2 branch from 434ef51 to b0f490f Compare May 30, 2024 14:43
@canova

canova commented May 30, 2024

Copy link
Copy Markdown
Member

(Rebased and fixed the merge conflict)

@canova canova merged commit 579e273 into main May 30, 2024
@depfu depfu Bot deleted the depfu/update/yarn/fake-indexeddb-5.0.2 branch May 30, 2024 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants