Esri / calcite-design-system

A monorepo containing the packages for Esri's Calcite Design System
https://developers.arcgis.com/calcite-design-system/
Other
290 stars 75 forks source link

Add a way to disable console warnings #10038

Open maxpatiiuk opened 3 months ago

maxpatiiuk commented 3 months ago

Check existing issues

Description

https://github.com/Esri/calcite-design-system/pull/9739 added console messages for current calcite version. These are useful in production for ensuring calcite is not loaded twice.

However, these console messages are adding noise in development. In e2e tests, it's even worse since the message is logged for each test file:

image

Acceptance Criteria

  1. A way to disable the console warnings when they are not necessary. For example, Lit package refers to this set on the global to decide whether warning should be emitted - https://github.com/lit/lit/blob/619449b84cb63d9c00e4316551246957c939a64b/packages/reactive-element/src/reactive-element.ts#L83-L85 - an app can define that set before importing Lit to supress the warning
  2. Have Calcite ship separate production and dev mode bundles, with dev only checks in the dev bundle and production only checks in the production bundle. For example, how Lit has this configured: https://github.com/lit/lit/blob/619449b84cb63d9c00e4316551246957c939a64b/packages/reactive-element/package.json#L22-L25

Relevant Info

No response

Which Component

*

Example Use Case

No response

Priority impact

impact - p3 - not time sensitive

Calcite package

Esri team

ArcGIS Maps SDK for JavaScript

jcfranco commented 1 month ago

Blocked by #10310.