@liner-fe/icon 0.0.49 → 0.0.50

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @liner-fe/icon
2
2
 
3
+ ## 0.0.50
4
+
5
+ ### Patch Changes
6
+
7
+ - 4a3d20f: icon error boundary에서 없으면 로깅하게 변경
8
+
3
9
  ## 0.0.49
4
10
 
5
11
  ### Patch Changes
package/index.tsx CHANGED
@@ -1,6 +1,6 @@
1
1
  import React, { forwardRef } from 'react';
2
2
  import { BasicColorType } from '@liner-fe/design-token-primitive';
3
- import { ErrorBoundary } from '@sentry/nextjs';
3
+ import { captureException } from '@sentry/nextjs';
4
4
  import { ArrowUpward } from './assets/arrow-upward';
5
5
  import { ArrowDownward } from './assets/arrow-downward';
6
6
  import { ArrowBack } from './assets/arrow-back';
@@ -402,9 +402,11 @@ export interface IconProps {
402
402
 
403
403
  export const Icon = forwardRef<SVGSVGElement, IconProps>(({name, size = "m", ...props}, ref) => {
404
404
  const IconComponent = IconMap[name];
405
- return (
406
- <ErrorBoundary fallback={<></>}>
407
- <IconComponent {...props} ref={ref} size={iconSizeMap[size]} />
408
- </ErrorBoundary>
409
- );
405
+
406
+ if (!IconComponent) {
407
+ captureException(new Error(`Icon ${name} not found`));
408
+ return null;
409
+ }
410
+
411
+ return <IconComponent {...props} ref={ref} size={iconSizeMap[size]} />;
410
412
  });
package/lib/index.js CHANGED
@@ -8259,7 +8259,11 @@ var iconSizeMap = {
8259
8259
  };
8260
8260
  var Icon = (0, import_react188.forwardRef)(({ name, size = "m", ...props }, ref) => {
8261
8261
  const IconComponent = IconMap[name];
8262
- return /* @__PURE__ */ (0, import_jsx_runtime188.jsx)(import_nextjs.ErrorBoundary, { fallback: /* @__PURE__ */ (0, import_jsx_runtime188.jsx)(import_jsx_runtime188.Fragment, {}), children: /* @__PURE__ */ (0, import_jsx_runtime188.jsx)(IconComponent, { ...props, ref, size: iconSizeMap[size] }) });
8262
+ if (!IconComponent) {
8263
+ (0, import_nextjs.captureException)(new Error(`Icon ${name} not found`));
8264
+ return null;
8265
+ }
8266
+ return /* @__PURE__ */ (0, import_jsx_runtime188.jsx)(IconComponent, { ...props, ref, size: iconSizeMap[size] });
8263
8267
  });
8264
8268
  /*! Bundled license information:
8265
8269
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liner-fe/icon",
3
- "version": "0.0.49",
3
+ "version": "0.0.50",
4
4
  "scripts": {
5
5
  "build": "yarn tsup --config ./config/tsup/tsup.config.ts"
6
6
  },