Skip to content

Commit 79c43fc

Browse files
authored
Merge pull request #104 from bcdev/forman-dont_log_in_common_situations
Don't log in common situations
2 parents edd3136 + b2ef93a commit 79c43fc

File tree

5 files changed

+21
-7
lines changed

5 files changed

+21
-7
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 and 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/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chartlets.js/packages/lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "chartlets",
3-
"version": "0.1.3",
3+
"version": "0.1.4-dev.0",
44
"description": "An experimental library for integrating interactive charts into existing JavaScript applications.",
55
"type": "module",
66
"files": [

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)