Skip to content

Conversation

@usualoma
Copy link
Member

@usualoma usualoma commented Oct 24, 2025

This refactoring aims to reduce the size of the code generated by minification.

  • e53a89c : This is simply an omission of redundant conditions.
  • 5d3ca90 : After placing it in an object, referencing it via key makes minify less effective, so I'll stop putting it in an object.
  • eeaf13d : Simplify conditional branching with ternary operators
    • Some people might find this a bit hard to read, but it's not overly complex, and considering the code reduction it achieves, I think it's a good approach.

before

$ npx esbuild --minify dist/utils/jwt/jwt.js | wc
      1     152    2885

after

% npx esbuild --minify dist/utils/jwt/jwt.js | wc
       1     150    2715

The author should do the following, if applicable

  • Add tests
  • Run tests
  • bun run format:fix && bun run lint:fix to format the code

@usualoma
Copy link
Member Author

@yusukebe
Would you please review this?

@usualoma usualoma force-pushed the refactor-jwt-middleware branch from eeaf13d to 445fd34 Compare October 24, 2025 12:56
@usualoma
Copy link
Member Author

Sorry, I had made a mistake, so I updated it.

@codecov
Copy link

codecov bot commented Oct 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.29%. Comparing base (5216117) to head (445fd34).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4480      +/-   ##
==========================================
- Coverage   91.30%   91.29%   -0.01%     
==========================================
  Files         173      173              
  Lines       11190    11180      -10     
  Branches     3228     3225       -3     
==========================================
- Hits        10217    10207      -10     
  Misses        972      972              
  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

@usualoma Looks good. Thank you!

@yusukebe yusukebe merged commit 95ae4d3 into honojs:main Oct 24, 2025
20 checks passed
@usualoma usualoma deleted the refactor-jwt-middleware branch October 24, 2025 23:51
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