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(deps): update dependency hono to ~3.3.0 #6501

Merged
merged 2 commits into from
Jul 11, 2023
Merged

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jul 11, 2023

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
hono (source) ~3.2.5 -> ~3.3.0 age adoption passing confidence

Release Notes

honojs/hono (hono)

v3.3.0

Compare Source

v3.3.0 is now available. This release includes two new features. Let's explore them.

Server-Timing Middleware

Performance measurement is important. We're introducing the Server-Timing Middleware. This middleware allows you to measure the performance of processes in handlers using the Server-Timing API.

import { Hono } from 'hono'
import { endTime, setMetric, startTime, timing } from 'hono/timing'

const app = new Hono()

app.use('*', timing())

app.get('/', async (c) => {
  // add custom metrics
  setMetric(c, 'region', 'europe-west3')

  // add custom metrics with timing, must be in milliseconds
  setMetric(c, 'custom', 23.8, 'My custom Metric')

  // start a new timer
  startTime(c, 'db')
  const data = ['foo'] // DB process
  endTime(c, 'db')

  return c.json({ response: data })
})

export default app

You can view the results in tools like Chrome DevTools.

SS

Thanks to @​PassiDel for contributing!

Lambda@Edge Adapter (Experimental)

We already have an AWS Lambda adapter, but it did not support Lambda@Edge. Now, the Lambda@Edge Adapter is available, although it's experimental. It's easy to use.

import { Hono } from 'hono'
import { handle } from 'hono/lambda-edge'

const app = new Hono()

app.get('/', (c) => c.text('Hello Hono!'))

export const handler = handle(app)

If you want to add Basic Auth and continue with request processing after verification, you can use c.env.callback()

import { Callback, CloudFrontRequest, handle } from 'hono/lambda-edge'

type Bindings = {
  callback: Callback
  request: CloudFrontRequest
}

const app = new Hono<{ Bindings: Bindings }>()

app.get(
  '*',
  basicAuth({
    username: 'a',
    password: 'b'
  })
)

app.get('/index.html', async (c, next) => {
  await next()
  c.env.callback(null, c.env.request)
})

export const handler = handle(app)

Special thanks to @​watany-dev for this feature!

All Updates

New Contributors

Full Changelog: honojs/hono@v3.2.7...v3.3.0


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot requested a review from waghanza as a code owner July 11, 2023 01:35
@waghanza waghanza merged commit 87e16bf into master Jul 11, 2023
3 checks passed
@waghanza waghanza deleted the renovate/hono-3.x branch July 11, 2023 06:58
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.

1 participant