@lark-apaas/miaoda-core 0.1.0-alpha.18 → 0.1.0-alpha.19

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.
@@ -16,7 +16,6 @@ var IframeBridge_RouteMessageType = /*#__PURE__*/ function(RouteMessageType) {
16
16
  function isRouteMessageType(type) {
17
17
  return Object.values(IframeBridge_RouteMessageType).includes(type);
18
18
  }
19
- function listenHot() {}
20
19
  async function connectParent() {
21
20
  const connection = connectToParent({
22
21
  parentOrigin: getPreviewParentOrigin(),
@@ -26,10 +25,6 @@ async function connectParent() {
26
25
  });
27
26
  await connection.promise;
28
27
  }
29
- if ('production' !== process.env.NODE_ENV) {
30
- listenHot();
31
- connectParent();
32
- }
33
28
  function IframeBridge() {
34
29
  const location = useLocation();
35
30
  const navigate = useNavigate();
@@ -61,6 +56,7 @@ function IframeBridge() {
61
56
  type: 'PreviewReady',
62
57
  data: {}
63
58
  });
59
+ connectParent();
64
60
  }, []);
65
61
  useEffect(()=>{
66
62
  if (isActive.current) {
@@ -23,9 +23,9 @@ const createDataLoomClient = (url, pat)=>{
23
23
  let dataloom = null;
24
24
  async function getDataloom() {
25
25
  if (dataloom) return dataloom;
26
- const { app_runtime_extra } = await getInitialInfo();
27
- const DATALOOM_CLIENT_URL = app_runtime_extra?.url;
28
- const DATALOOM_PAT = app_runtime_extra?.token;
26
+ const info = await getInitialInfo();
27
+ const DATALOOM_CLIENT_URL = info?.app_runtime_extra?.url;
28
+ const DATALOOM_PAT = info?.app_runtime_extra?.token;
29
29
  dataloom = createDataLoomClient(DATALOOM_CLIENT_URL, DATALOOM_PAT);
30
30
  return dataloom;
31
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/miaoda-core",
3
- "version": "0.1.0-alpha.18",
3
+ "version": "0.1.0-alpha.19",
4
4
  "types": "./lib/index.d.ts",
5
5
  "main": "./lib/index.js",
6
6
  "files": [