@refraction-ui/react 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -13736,6 +13736,10 @@ function createTelemetry(config) {
13736
13736
  }
13737
13737
 
13738
13738
  // ../react-logger/dist/index.js
13739
+ var noopTelemetry = null;
13740
+ function getNoopTelemetry() {
13741
+ return noopTelemetry ??= createNoopTelemetry();
13742
+ }
13739
13743
  var TelemetryContext = React11.createContext(null);
13740
13744
  function TelemetryProvider({ children, ...config }) {
13741
13745
  const telemetryRef = React11.useRef(null);
@@ -13753,9 +13757,9 @@ function useTelemetry() {
13753
13757
  if (!ctx) {
13754
13758
  devWarn(
13755
13759
  "react-logger/use-telemetry-outside-provider",
13756
- "useTelemetry() (or useSpan(), which depends on it) was called outside a <TelemetryProvider>. Wrap your app (or the consuming subtree) in <TelemetryProvider> so the telemetry context is available."
13760
+ "useTelemetry() (or useLogger()/useSpan(), which depend on it) was called outside a <TelemetryProvider>. Telemetry is a no-op here; wrap your app (or the consuming subtree) in <TelemetryProvider> to enable it."
13757
13761
  );
13758
- throw new Error("useTelemetry must be used within a <TelemetryProvider>");
13762
+ return getNoopTelemetry();
13759
13763
  }
13760
13764
  return ctx.telemetry;
13761
13765
  }