@next-core/brick-kit 2.194.1 → 2.195.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.esm.js CHANGED
@@ -10,7 +10,7 @@ import { pipes } from '@next-core/pipes';
10
10
  import i18next, { getFixedT } from 'i18next';
11
11
  import React, { useState, useEffect, useMemo, useContext, createContext, useRef, useReducer, useCallback } from 'react';
12
12
  import { http, HttpResponseError, HttpAbortError, HttpFetchError } from '@next-core/brick-http';
13
- import { userAnalytics, apiAnalyzer } from '@next-core/easyops-analytics';
13
+ import { userAnalytics, apiAnalyzer, SkywalkingAnalysis } from '@next-core/easyops-analytics';
14
14
  import { Modal, message, Empty, ConfigProvider } from 'antd';
15
15
  import { ExclamationCircleOutlined } from '@ant-design/icons';
16
16
  import yaml from 'js-yaml';
@@ -6106,11 +6106,11 @@ function getApiArgsFromApiProfile(_ref, originalArgs, method) {
6106
6106
  }, ...args];
6107
6107
  }
6108
6108
  function getTransformedUriAndRestArgs(uri, originalArgs, name, namespace, serviceName, version) {
6109
- var prefix = version ? serviceName ? "api/gateway/".concat(serviceName) : "api/gateway/".concat(namespace, ".").concat(name, "@").concat(version) : "api/gateway/api_service.".concat(namespace, ".").concat(name);
6109
+ var prefix = version ? serviceName === "logic.api.gateway" ? "" : serviceName ? "api/gateway/".concat(serviceName) : "api/gateway/".concat(namespace, ".").concat(name, "@").concat(version) : "api/gateway/api_service.".concat(namespace, ".").concat(name);
6110
6110
  var restArgs = originalArgs.slice();
6111
6111
  var transformedUri = uri.replace(/:([^/]+)/g, () => restArgs.shift());
6112
6112
  return {
6113
- url: prefix + transformedUri,
6113
+ url: prefix ? prefix + transformedUri : transformedUri.replace(/^\//, ""),
6114
6114
  args: restArgs
6115
6115
  };
6116
6116
  }
@@ -9121,9 +9121,12 @@ class Kernel {
9121
9121
  var bricksMap = new Map();
9122
9122
 
9123
9123
  // bootstrapData 数据和 pubDeps 中可能同时存在同一个包名,需要过滤去重, 以 pubDeps 中的包为准
9124
- [...brickPackages, ...pubDeps].forEach(pkg => {
9124
+ [...pubDeps, ...brickPackages].forEach(pkg => {
9125
9125
  var pkgName = pkg.filePath.split("/")[1];
9126
- bricksMap.set(pkgName, pkg);
9126
+ // 始终将 pubDeps 放在前面
9127
+ if (!bricksMap.has(pkgName)) {
9128
+ bricksMap.set(pkgName, pkg);
9129
+ }
9127
9130
  });
9128
9131
  return Array.from(bricksMap.values());
9129
9132
  }
@@ -12027,6 +12030,9 @@ class Router {
12027
12030
  // Create the page tracker before page load.
12028
12031
  // And the API Analyzer maybe disabled.
12029
12032
  var tracePageEnd = (_apiAnalyzer$getInsta = apiAnalyzer.getInstance()) === null || _apiAnalyzer$getInsta === void 0 ? void 0 : _apiAnalyzer$getInsta.tracePage();
12033
+ SkywalkingAnalysis.setPerformance({
12034
+ pagePath: "".concat(location.pathname).concat(location.search)
12035
+ });
12030
12036
  var locationContext = _this3.locationContext = new LocationContext(_this3.kernel, location, renderId);
12031
12037
  if (window.DEVELOPER_PREVIEW) {
12032
12038
  return;
@@ -12585,12 +12591,9 @@ class LegacyErrorBoundary extends React.Component {
12585
12591
  error
12586
12592
  };
12587
12593
  }
12588
-
12589
- /* componentDidCatch(error, info) {
12590
- // You can also log the error to an error reporting service
12591
- logErrorToMyService(error, info);
12592
- } */
12593
-
12594
+ componentDidCatch(error) {
12595
+ SkywalkingAnalysis.reportFrameErrors(error);
12596
+ }
12594
12597
  render() {
12595
12598
  if (this.state.error) {
12596
12599
  // You can render any custom fallback UI