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

fix: allow readonly array input for table data #218

Merged
merged 1 commit into from
Dec 3, 2024

Conversation

bmish
Copy link
Contributor

@bmish bmish commented Mar 19, 2023

This is the minimum set of changes needed to allow a readonly array to be passed as input to the public table() function, in addition to regular arrays (backward compatible).

Some users may prefer to declare their arrays as readonly, or use functions/libraries that return readonly arrays when generating the table data. This change improves compatibility for such users.

It's also generally good practice for us to enforce that we do not modify input parameters.

Potential follow-up changes:

  • There's a public spanningCells option that could be changed to use a readonly array. This would require a minor change to avoid mutating the input array by cloning it first.
  • There are dozens of other private/internal places throughout the codebase where additional readonly array types could be used as a best practice if desired. In some cases, this would require rewriting code to avoid mutating arrays.

References:

@coveralls
Copy link

coveralls commented Mar 23, 2023

Pull Request Test Coverage Report for Build 4461649881

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 3374277795: 0.0%
Covered Lines: 642
Relevant Lines: 642

💛 - Coveralls

@nam-hle
Copy link
Collaborator

nam-hle commented Mar 29, 2023

Hi @bmish, thanks for contributing!

So this change is a kind of breaking change, isn't it?

@bmish
Copy link
Contributor Author

bmish commented Mar 29, 2023

Nope, not a breaking change. It allows read-only arrays but does not require them. It expands the allowed input.

@bmish
Copy link
Contributor Author

bmish commented May 11, 2023

Ping? Again, this is not a breaking change.

@bmish
Copy link
Contributor Author

bmish commented Dec 7, 2023

Ping?

@gajus gajus merged commit 8b85bc8 into gajus:master Dec 3, 2024
@gajus
Copy link
Owner

gajus commented Dec 3, 2024

Never seen these notifications. Sorry for missing it.

Copy link

github-actions bot commented Dec 3, 2024

🎉 This PR is included in version 6.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants