Skip to content

fix(client): Support browsers without Array.prototype.at #4057

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

Merged
merged 1 commit into from
Apr 8, 2025

Conversation

isnifer
Copy link
Contributor

@isnifer isnifer commented Apr 7, 2025

The author should do the following, if applicable

  • Add tests
  • Run tests
  • bun run format:fix && bun run lint:fix to format the code
  • Add TSDoc/JSDoc to document the code

Today I launched my project and found that people with old devices do not have Array.prototype.at in their browsers.
I don't use this method at all and hono/client uses it only in one place.
If it possible, please accept this change to avoid at(). I changed it to slice + reverse.
This change will help me to remove polyfill for Array.prototype.at

Copy link

codecov bot commented Apr 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.28%. Comparing base (882e75a) to head (14ca30d).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4057      +/-   ##
==========================================
- Coverage   91.32%   91.28%   -0.04%     
==========================================
  Files         168      168              
  Lines       10684    10769      +85     
  Branches     3032     3063      +31     
==========================================
+ Hits         9757     9831      +74     
- Misses        926      937      +11     
  Partials        1        1              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@yusukebe yusukebe left a comment

Choose a reason for hiding this comment

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

LGTM!

@yusukebe
Copy link
Member

yusukebe commented Apr 8, 2025

Hi @isnifer

Looks good. The client should support old browsers. Thank you for your contribution!

@yusukebe yusukebe merged commit 76a3c50 into honojs:main Apr 8, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants