-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat: provide entity to onConsoleLog #8159
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
Conversation
✅ Deploy Preview for vitest-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Let's also update docs.
const task = log.taskId ? this.ctx.state.idMap.get(log.taskId) : undefined | ||
const entity = task && this.ctx.state.getReportedEntity(task) | ||
const shouldLog = this.ctx.config.onConsoleLog?.(log.content, log.type, entity) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick, but could avoid getReportedEntity
and idMap.get
calls:
let shouldLog = true;
if(this.ctx.config.onConsoleLog) {
const task = log.taskId ? this.ctx.state.idMap.get(log.taskId) : undefined
const entity = task && this.ctx.state.getReportedEntity(task)
shouldLog = this.ctx.config.onConsoleLog(log.content, log.type, entity)
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to decide in what version we will release this. Technically this is a feature, but I am not planning to have 3.3 (or I guess we can have a mini release?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just leave it for 4.0
Description
Fixes #8156
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yaml
unless you introduce a new test example.Tests
pnpm test:ci
.Documentation
pnpm run docs
command.Changesets
feat:
,fix:
,perf:
,docs:
, orchore:
.