Skip to content

refactor: standardize console diagnostics on the [Tasty] prefix - #249

Merged
tenphi merged 1 commit into
mainfrom
fix-unify-console-messages
Jul 30, 2026
Merged

refactor: standardize console diagnostics on the [Tasty] prefix#249
tenphi merged 1 commit into
mainfrom
fix-unify-console-messages

Conversation

@tenphi

@tenphi tenphi commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Warnings were emitted under six different prefix conventions ("Tasty: ", "[tasty] ", "tasty: ", "tastyDebug: ", "[Tasty] " and no prefix at all), which made tasty output impossible to filter reliably in a browser console. Everything now uses "[Tasty] ".

Non-fatal diagnostics that still fired in production are now gated behind process.env.NODE_ENV !== 'production' so a consumer's bundler can strip them: the #current color-token warning, invalid custom style definitions, unparseable function tokens, ignored scrollbar="none" tokens, and the default pipeline warning handler. The gate lives in defaultWarningHandler rather than emitWarning, so custom handlers registered via setWarningHandler still receive warnings in production.

Dot-access NODE_ENV is used for the new gates rather than isDevEnv(), which deliberately uses bracket access to defeat bundler inlining and so cannot be stripped. Existing isDevEnv()/devMode gates are left untouched; converting them would flip them to true under NODE_ENV=test and change test behavior.

Error reporting in SheetManager stays unconditional and only gains the prefix: the seven catch blocks that swallow an exception, plus the two style-element-detached reports (the second reworded off its "CRITICAL DEBUG" phrasing).

Warnings were emitted under six different prefix conventions ("Tasty: ",
"[tasty] ", "tasty: ", "tastyDebug: ", "[Tasty] " and no prefix at all),
which made tasty output impossible to filter reliably in a browser
console. Everything now uses "[Tasty] ".

Non-fatal diagnostics that still fired in production are now gated behind
process.env.NODE_ENV !== 'production' so a consumer's bundler can strip
them: the #current color-token warning, invalid custom style definitions,
unparseable function tokens, ignored scrollbar="none" tokens, and the
default pipeline warning handler. The gate lives in defaultWarningHandler
rather than emitWarning, so custom handlers registered via
setWarningHandler still receive warnings in production.

Dot-access NODE_ENV is used for the new gates rather than isDevEnv(),
which deliberately uses bracket access to defeat bundler inlining and so
cannot be stripped. Existing isDevEnv()/devMode gates are left untouched;
converting them would flip them to true under NODE_ENV=test and change
test behavior.

Error reporting in SheetManager stays unconditional and only gains the
prefix: the seven catch blocks that swallow an exception, plus the two
style-element-detached reports (the second reworded off its "CRITICAL
DEBUG" phrasing).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L1Ck25U5JmFhVV1ShYd7rm
@github-actions

Copy link
Copy Markdown
Contributor

📦 Snapshot release

Published 0.0.0-snapshot.2ac692d.

pnpm add @tenphi/tasty@0.0.0-snapshot.2ac692d

@tenphi
tenphi merged commit 252c1de into main Jul 30, 2026
6 of 7 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 30, 2026
tenphi added a commit that referenced this pull request Aug 3, 2026
Resolves src/utils/warnings.ts: takes main's `[Tasty]` PREFIX from #249 (the
point of that change) while keeping this branch's removal of the dead
`deprecationWarning`, which had zero callers. The `eslint-disable no-console`
goes with it — only `console.warn` remains, which the repo's no-console config
already allows.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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