discord.js icon indicating copy to clipboard operation
discord.js copied to clipboard

feat(collection): return entries instead of values in toJSON method

Open Shiva953 opened this issue 1 year ago • 6 comments

Please describe the changes this PR makes and why it should be merged: This PR modifies the toJSON method in the collection package to return entries instead of just values. Currently, the toJSON method only returns values from the collection, which makes it impossible to create a new collection from the JSON output.

To fix this issue, this PR modifies the toJSON method to return entries instead of just values. This will preserve the keys and allow the creation of a new collection/map from the returned data. (FIXES #9310 ).

Status and versioning classification: - Code changes have been tested against the Discord API, or there are no code changes - This PR changes the library's interface (methods or parameters added) - (Status Classification) This PR includes breaking changes (method(s) removed or renamed, parameters moved or removed)

Please review this PR and let me know if any changes are required.

Shiva953 avatar Apr 08 '23 06:04 Shiva953

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
discord-js ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 8, 2023 1:27am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
discord-js-guide ⬜️ Ignored (Inspect) Visit Preview Nov 8, 2023 1:27am

vercel[bot] avatar Apr 08 '23 06:04 vercel[bot]

@Shiva953 is attempting to deploy a commit to the discordjs Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Apr 08 '23 06:04 vercel[bot]

Well it's a braking change, so you should mention about it

jaw0r3k avatar Apr 08 '23 08:04 jaw0r3k

Well it's a braking change, so you should mention about it

Can you please Elaborate on what I should mention?

Shiva953 avatar Apr 08 '23 08:04 Shiva953

Can you please Elaborate on what I should mention?

The status classification - This PR includes breaking changes (methods removed or renamed, parameters moved or removed)

jaw0r3k avatar Apr 08 '23 10:04 jaw0r3k

Can you please Elaborate on what I should mention?

The status classification - This PR includes breaking changes (methods removed or renamed, parameters moved or removed)

Done👍

Shiva953 avatar Apr 08 '23 10:04 Shiva953

@Shiva953 your branch update missed updating toJSON()'s tests, CI is reporting errors:

image

kyranet avatar Oct 09 '23 07:10 kyranet

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟠 Performance 78
🟢 Accessibility 98
🟠 Best practices 83
🟠 SEO 86
🟠 PWA 67

Lighthouse ran on https://discord-js-guide-git-fork-shiva953-feature-discordjs.vercel.app/guide/home/introduction

github-actions[bot] avatar Oct 09 '23 12:10 github-actions[bot]

Codecov Report

Merging #9345 (1169412) into main (6b9f906) will not change coverage. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #9345   +/-   ##
=======================================
  Coverage   60.14%   60.14%           
=======================================
  Files         234      234           
  Lines       16241    16241           
  Branches     1234     1234           
=======================================
  Hits         9768     9768           
  Misses       6429     6429           
  Partials       44       44           
Flag Coverage Δ
collection 99.28% <100.00%> (ø)
next ∅ <ø> (∅)
proxy 75.00% <ø> (ø)
rest 92.77% <ø> (ø)
ws 52.63% <ø> (ø)

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

Files Coverage Δ
packages/collection/src/collection.ts 99.28% <100.00%> (ø)

:mega: Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today!

codecov[bot] avatar Nov 07 '23 23:11 codecov[bot]