Skip to content

Commit b052b25

Browse files
committed
no longer log in common situations
1 parent 3cc3692 commit b052b25

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

chartlets.js/CHANGES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## Version 0.1.4 (in development)
2+
3+
* In `chartlets.js` we no longer emit warnings an errors in common
4+
situations to avoid too much spam in the browser console.
5+
16
## Version 0.1.3 (from 2025/01/28)
27

38
* **Chore:** Version bump to align CI process with GitHub release flow.

chartlets.js/packages/lib/src/actions/helpers/getInputValues.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,18 @@ export function getInputValue(
4444
} else if (isHostChannel(input) && hostStore) {
4545
inputValue = getInputValueFromHostStore(hostStore, property);
4646
} else {
47-
console.warn(`input with unknown data source:`, input);
47+
// We no longer log, as the situation is quite common if a
48+
// component has not yet been rendered.
49+
// Enable logging for debugging only:
50+
// console.warn(`input with unknown data source:`, input);
4851
}
4952
if (inputValue === undefined || inputValue === noValue) {
5053
// We use null, because undefined is not JSON-serializable.
5154
inputValue = null;
52-
console.warn(`value is undefined for input`, input);
55+
// We no longer log, as the situation is quite common if a
56+
// component has not yet been rendered.
57+
// Enable logging for debugging only:
58+
// console.warn(`value is undefined for input`, input);
5359
}
5460
return inputValue;
5561
}

chartlets.js/packages/lib/src/components/Component.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@ export function Component(props: ComponentProps) {
1212
if (typeof ActualComponent === "function") {
1313
return <ActualComponent {...props} />;
1414
} else {
15-
console.error(
16-
`chartlets: invalid component type encountered: ${componentType}`,
17-
);
15+
// We no longer log, as the situation is quite common
16+
// and users can not do anything against it.
17+
// Enable error logging for debugging only:
18+
// console.error(
19+
// `chartlets: invalid component type encountered: ${componentType}`,
20+
// );
1821
return null;
1922
}
2023
}

0 commit comments

Comments
 (0)