@plasmicapp/loader-react 1.0.352 → 1.0.354

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.d.ts CHANGED
@@ -574,11 +574,15 @@ export declare function PlasmicRootProvider(props: {
574
574
  */
575
575
  pageQuery?: Record<string, string | string[] | undefined>;
576
576
  /**
577
- * Whether the React.Suspense boundaries should be removed
577
+ * Whether the internal Plasmic React.Suspense boundaries should be removed
578
578
  */
579
579
  disableLoadingBoundary?: boolean;
580
580
  /**
581
- * Fallback value for the root-level React.Suspense
581
+ * Whether the root React.Suspense boundary should be removed
582
+ */
583
+ disableRootLoadingBoundary?: boolean;
584
+ /**
585
+ * Fallback value for React.Suspense boundary
582
586
  */
583
587
  suspenseFallback?: React_2.ReactNode;
584
588
  } & PlasmicDataSourceContextValue): React_2.JSX.Element;
package/dist/index.esm.js CHANGED
@@ -300,7 +300,8 @@ function PlasmicRootProvider(props) {
300
300
  pageParams,
301
301
  pageQuery,
302
302
  suspenseFallback,
303
- disableLoadingBoundary
303
+ disableLoadingBoundary,
304
+ disableRootLoadingBoundary
304
305
  } = props;
305
306
  const loader = props.loader.__internal;
306
307
  if (prefetchedData) {
@@ -394,6 +395,7 @@ function PlasmicRootProvider(props) {
394
395
  });
395
396
  }, [loader, value]);
396
397
  const reactMajorVersion = +React2.version.split(".")[0];
398
+ const shouldDisableRootLoadingBoundary = disableRootLoadingBoundary != null ? disableRootLoadingBoundary : loader.getBundle().disableRootLoadingBoundaryByDefault;
397
399
  return /* @__PURE__ */ React2.createElement(
398
400
  PlasmicQueryDataProvider,
399
401
  {
@@ -417,7 +419,7 @@ function PlasmicRootProvider(props) {
417
419
  /* @__PURE__ */ React2.createElement(
418
420
  MaybeWrap,
419
421
  {
420
- cond: !disableLoadingBoundary && reactMajorVersion >= 18,
422
+ cond: !shouldDisableRootLoadingBoundary && reactMajorVersion >= 18,
421
423
  wrapper: (contents) => /* @__PURE__ */ React2.createElement(React2.Suspense, { fallback: suspenseFallback != null ? suspenseFallback : "Loading..." }, contents)
422
424
  },
423
425
  children
@@ -568,7 +570,7 @@ function prepComponentData(bundle, compMetas, opts) {
568
570
  };
569
571
  }
570
572
  function mergeBundles(target, from) {
571
- var _a, _b, _c, _d, _e;
573
+ var _a, _b, _c, _d, _e, _f, _g;
572
574
  const existingProjects = new Set(target.projects.map((p) => p.id));
573
575
  const newProjects = from.projects.filter((p) => !existingProjects.has(p.id));
574
576
  if (newProjects.length > 0) {
@@ -647,6 +649,7 @@ function mergeBundles(target, from) {
647
649
  }
648
650
  target.bundleKey = (_c = (_b = target.bundleKey) != null ? _b : from.bundleKey) != null ? _c : null;
649
651
  target.deferChunksByDefault = (_e = (_d = target.deferChunksByDefault) != null ? _d : from.deferChunksByDefault) != null ? _e : false;
652
+ target.disableRootLoadingBoundaryByDefault = (_g = (_f = target.disableRootLoadingBoundaryByDefault) != null ? _f : from.disableRootLoadingBoundaryByDefault) != null ? _g : false;
650
653
  return target;
651
654
  }
652
655
  var convertBundlesToComponentRenderData = (bundles, compMetas) => {
@@ -763,6 +766,7 @@ var BaseInternalPlasmicComponentLoader = class {
763
766
  activeSplits: [],
764
767
  bundleKey: null,
765
768
  deferChunksByDefault: false,
769
+ disableRootLoadingBoundaryByDefault: false,
766
770
  filteredIds: {}
767
771
  };
768
772
  this.opts = args.opts;
@@ -902,6 +906,7 @@ ${this.bundle.bundleKey}`
902
906
  activeSplits: [],
903
907
  bundleKey: null,
904
908
  deferChunksByDefault: false,
909
+ disableRootLoadingBoundaryByDefault: false,
905
910
  filteredIds: {}
906
911
  };
907
912
  this.registry.clear();