Skip to content

[BUGFIX] Improve debugger message for template-only components#21407

Open
olenderhub wants to merge 2 commits into
emberjs:mainfrom
olenderhub:bugfix-template-only-debugger-message
Open

[BUGFIX] Improve debugger message for template-only components#21407
olenderhub wants to merge 2 commits into
emberjs:mainfrom
olenderhub:bugfix-template-only-debugger-message

Conversation

@olenderhub
Copy link
Copy Markdown
Contributor

Fixes #17962

Updates the default {{debugger}} callback to show a template-only-friendly message when there is no backing context.

Adds a regression test for the template-only debugger message.

Tested with:

  • pnpm test:wip

} else {
// eslint-disable-next-line no-console
console.info(
"Use `get(<path>)` to debug this template. For named arguments, use `get('@argName')`."
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

are these instructions also valid for class-backed components?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point - yes, get('@argName') is valid for class-backed components too.

The distinction here is only whether context is available. I updated the class-backed message to include the named-argument hint as well, and added test coverage for that case.

@olenderhub
Copy link
Copy Markdown
Contributor Author

@NullVoxPopuli I pushed a follow-up commit that adds the named-argument hint to the class-backed debugger message too, and added test coverage for that case.

The current CI failure seems unrelated to this PR - it appears to fail during setup before tests run.

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.

{{debugger}} in template-only glimmer components has a misleading DX

2 participants