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

refactor(hono-base): remove unneeded processes and variables #3649

Merged
merged 1 commit into from
Nov 9, 2024

Conversation

EdamAme-x
Copy link
Contributor

@EdamAme-x EdamAme-x commented Nov 9, 2024

  1. remove unneeded process
    https://github.com/honojs/hono/pull/3649/files#diff-f42b11987a9538ff250a31ba4eb66ee557f7512860fae88c5020a83b5e97c28cL136-L138

  2. Inline grouping of variables that are used only once
    https://github.com/honojs/hono/pull/3649/files#diff-f42b11987a9538ff250a31ba4eb66ee557f7512860fae88c5020a83b5e97c28cL492-L500

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

@EdamAme-x EdamAme-x marked this pull request as draft November 9, 2024 04:56
Copy link

codecov bot commented Nov 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.68%. Comparing base (8a8a576) to head (c2a7cbf).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3649   +/-   ##
=======================================
  Coverage   91.68%   91.68%           
=======================================
  Files         159      159           
  Lines       10135    10135           
  Branches     2878     2837   -41     
=======================================
  Hits         9292     9292           
  Misses        841      841           
  Partials        2        2           

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

@EdamAme-x EdamAme-x marked this pull request as ready for review November 9, 2024 04:59
@yusukebe
Copy link
Member

yusukebe commented Nov 9, 2024

Hi @EdamAme-x

  1. remove unneeded process

I think "1" is good. I welcome this change.

  1. Inline grouping of variables that are used only once

But I don't welcome "2" so eagerly because it will lose readability, and it's unnecessary for optimization for the request method. Or will this change reduce the bundled/minified size?

@EdamAme-x
Copy link
Contributor Author

EdamAme-x commented Nov 9, 2024

  1. Inline grouping of variables that are used only once

But I don't welcome "2" so eagerly because it will lose readability, and it's unnecessary for optimization for the request method. Or will this change reduce the bundled/minified size?

image
Playground

Inlining prevents unnecessary variables from being created and reduces bundle size.
But, as you say, readability will suffer...

Related: evanw/esbuild#3568

@yusukebe
Copy link
Member

yusukebe commented Nov 9, 2024

@EdamAme-x

Thanks! It reduces the file size, actually. Okay, let's merge this PR!

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 yusukebe merged commit 61bee9f into honojs:main Nov 9, 2024
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