@xuda.io/runtime-bundle 1.0.1418 → 1.0.1420

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.
@@ -28079,6 +28079,9 @@ func.runtime.ui.get_meta = function (xu_ui_id, key) {
28079
28079
  return key ? entry[key] : entry;
28080
28080
  };
28081
28081
  func.runtime.ui.delete_meta = function (xu_ui_id) {
28082
+ if (func.runtime.ui._meta_store[xu_ui_id]) {
28083
+ console.info('[xu-render-debug] delete_meta called for', xu_ui_id, new Error().stack?.split('\n').slice(1, 4).join(' <- '));
28084
+ }
28082
28085
  delete func.runtime.ui._meta_store[xu_ui_id];
28083
28086
  // clean reverse lookup
28084
28087
  for (const id in func.runtime.ui._element_id_to_xu_ui_id) {
@@ -30511,6 +30514,7 @@ func.UI.worker.execute = async function (SESSION_ID, queue_obj) {
30511
30514
  const perf_end = func.runtime?.perf?.start?.(SESSION_ID, 'execute_xu_render_attributes');
30512
30515
  const live_context = fx.get_live_element_context(queue_obj.paramsP?.elem_key, queue_obj.elementP || queue_obj.paramsP?.elem_val?.$elm, queue_obj.paramsP);
30513
30516
  const _data = live_context.data;
30517
+ console.info('[xu-render-debug] execute_xu_render_attributes', { elem_key: queue_obj.paramsP?.elem_key, has_live_elm: !!live_context.$elm?.length, has_data: !!_data, has_xuData: !!_data?.xuData, has_paramsP: !!_data?.xuData?.paramsP, attr_value: queue_obj.paramsP?.attr_value, elm_tag: func.runtime.ui.get_first_node(live_context.$elm)?.tagName, data_keys: Object.keys(_data || {}), xuData_keys: Object.keys(_data?.xuData || {}) });
30514
30518
  try {
30515
30519
  if (_data?.xuData?.paramsP) {
30516
30520
  const live_xu_data = _data.xuData;
@@ -31868,13 +31872,15 @@ func.runtime.ui.copy_runtime_state = function ($source, $target) {
31868
31872
  const xu_data_keys = Object.keys(source_data.xuData);
31869
31873
  for (let index = 0; index < xu_data_keys.length; index++) {
31870
31874
  const key = xu_data_keys[index];
31871
- target_data.xuData[key] = structuredClone(source_data.xuData[key]);
31875
+ const val = source_data.xuData[key];
31876
+ try { target_data.xuData[key] = structuredClone(val); } catch (_) { target_data.xuData[key] = val; }
31872
31877
  }
31873
31878
 
31874
31879
  const xu_attribute_keys = Object.keys(source_data.xuAttributes);
31875
31880
  for (let index = 0; index < xu_attribute_keys.length; index++) {
31876
31881
  const key = xu_attribute_keys[index];
31877
- target_data.xuAttributes[key] = structuredClone(source_data.xuAttributes[key]);
31882
+ const val = source_data.xuAttributes[key];
31883
+ try { target_data.xuAttributes[key] = structuredClone(val); } catch (_) { target_data.xuAttributes[key] = val; }
31878
31884
  }
31879
31885
  return $target;
31880
31886
  };
@@ -33760,6 +33766,7 @@ func.runtime.ui.refresh_xu_attributes = async function (options) {
33760
33766
  const attr_value = await func.common.get_cast_val(options.SESSION_ID, 'refresh xu-attributes', 'xu-render', 'bool', res.result);
33761
33767
 
33762
33768
  const _elm_node = func.runtime.ui.get_first_node($elm);
33769
+ console.info('[xu-render-debug] refresh has_xu_exp_render', { elem_key, attr_value, elm_tag: _elm_node?.tagName, exp_value: xuAttributes['xu-exp:xu-render'], result: res.result });
33763
33770
  if (!attr_value && _elm_node?.tagName === 'XURENDER') continue;
33764
33771
 
33765
33772
  if (attr_value && _elm_node?.tagName !== 'XURENDER') {
@@ -36655,6 +36662,8 @@ func.runtime.widgets = func.runtime.widgets || {};
36655
36662
 
36656
36663
  func.runtime.render.handle_legacy_xu_render = async function (options) {
36657
36664
  const value = await func.common.get_cast_val(options.SESSION_ID, 'common fx', 'xu-render', 'bool', options.val.value);
36665
+ const _xu_ui_id_dbg = func.runtime.ui.get_attr(options.$elm, 'xu-ui-id');
36666
+ console.info('[xu-render-debug] handle_legacy_xu_render called', { value, is_init: options.is_init, xu_ui_id: _xu_ui_id_dbg, elm_tag: func.runtime.ui.get_first_node(options.$elm)?.tagName });
36658
36667
 
36659
36668
  const init_render = function () {
36660
36669
  if (!value) {
@@ -36668,15 +36677,20 @@ func.runtime.render.handle_legacy_xu_render = async function (options) {
36668
36677
  parent_nodeP: options.parent_nodeP,
36669
36678
  $root_container: options.$root_container,
36670
36679
  });
36671
- // Snapshot xuData before remove deletes the meta store entry (shared xu-ui-id)
36680
+ // Snapshot xuData while meta store still holds the entry
36672
36681
  const snapshot_xuData = func.runtime.ui.get_data(cloned_div).xuData;
36673
36682
  const snapshot_xuAttributes = options.nodeP.attributes || {};
36674
36683
  const xu_ui_id = func.runtime.ui.get_attr(options.$elm, 'xu-ui-id');
36675
36684
 
36676
- // Remove original element first (clears _meta_store for this xu-ui-id)
36677
- func.runtime.ui.remove(options.$elm);
36685
+ console.info('[xu-render-debug] init_render hiding', { xu_ui_id, has_snapshot_xuData: !!snapshot_xuData, has_paramsP: !!snapshot_xuData?.paramsP, has_original_data_obj: !!original_data_obj, snapshot_xuAttributes_keys: Object.keys(snapshot_xuAttributes) });
36686
+
36687
+ // Remove original element from DOM WITHOUT deleting _meta_store.
36688
+ const _elm_node = func.runtime.ui.get_first_node(options.$elm);
36689
+ if (_elm_node?.remove) {
36690
+ _elm_node.remove();
36691
+ }
36678
36692
 
36679
- // Then create XURENDER placeholder (writes fresh meta store entry)
36693
+ // Create XURENDER placeholder (overwrites meta store entry for this xu-ui-id)
36680
36694
  func.runtime.render.create_xu_render_placeholder(xu_ui_id, options.$container, {
36681
36695
  hidden: true,
36682
36696
  xuData: snapshot_xuData,
@@ -36685,6 +36699,10 @@ func.runtime.render.handle_legacy_xu_render = async function (options) {
36685
36699
  xuAttributes: snapshot_xuAttributes,
36686
36700
  });
36687
36701
 
36702
+ // Verify data was written correctly
36703
+ const verify_meta = func.runtime.ui._meta_store[xu_ui_id];
36704
+ console.info('[xu-render-debug] init_render DONE', { xu_ui_id, meta_exists: !!verify_meta, has_xuData: !!verify_meta?.xuData, has_paramsP: !!verify_meta?.xuData?.paramsP, has_original_data_obj: !!verify_meta?.xuData?.original_data_obj, has_xuAttributes: !!verify_meta?.xuAttributes });
36705
+
36688
36706
  return { abort: true };
36689
36707
  }
36690
36708
  return {};
@@ -36716,12 +36734,18 @@ func.runtime.render.handle_legacy_xu_render = async function (options) {
36716
36734
  if (value) {
36717
36735
  try {
36718
36736
  const elm_node = func.runtime.ui.get_first_node(options.$elm);
36737
+ const _post_xu_ui_id = func.runtime.ui.get_attr(options.$elm, 'xu-ui-id');
36738
+ const _post_meta = func.runtime.ui._meta_store[_post_xu_ui_id];
36739
+ const _post_data = func.runtime.ui.get_data(options.$elm);
36740
+ console.info('[xu-render-debug] post_render value=true', { xu_ui_id: _post_xu_ui_id, elm_tag: elm_node?.tagName, meta_exists: !!_post_meta, has_xuData: !!_post_data?.xuData, has_paramsP: !!_post_data?.xuData?.paramsP, has_original_data_obj: !!_post_data?.xuData?.original_data_obj, xuData_keys: Object.keys(_post_data?.xuData || {}), data_keys: Object.keys(_post_data || {}) });
36719
36741
  if (elm_node?.tagName !== 'XURENDER' && elm_node) {
36742
+ console.info('[xu-render-debug] post_render SKIP: not XURENDER tag', elm_node?.tagName);
36720
36743
  return func.events.delete_job(options.SESSION_ID, options.jobNoP);
36721
36744
  }
36722
36745
 
36723
36746
  const original_data_obj = func.runtime.ui.get_data(options.$elm).xuData.original_data_obj;
36724
36747
  if (!original_data_obj) {
36748
+ console.info('[xu-render-debug] post_render SKIP: no original_data_obj');
36725
36749
  func.events.delete_job(options.SESSION_ID, options.jobNoP);
36726
36750
  return { delete_job: options.jobNoP };
36727
36751
  }
@@ -37630,10 +37654,8 @@ func.datasource.create = async function (
37630
37654
 
37631
37655
  var run_at = _prog_obj?.properties?.runAt;
37632
37656
 
37633
- if (!['live_preview', 'miniapp'].includes(_session.engine_mode)) {
37634
- if (_session.opt.app_computing_mode === 'main') {
37635
- run_at = 'client';
37636
- }
37657
+ if (_session.opt.app_computing_mode === 'main') {
37658
+ run_at = 'client';
37637
37659
  }
37638
37660
 
37639
37661
  if (_prog_obj?.properties.menuType === 'globals') {