@plasmicapp/loader-react 2.0.4 → 2.0.6

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
@@ -487,7 +487,7 @@ export declare class PlasmicComponentLoader {
487
487
  getActiveSplits(): Split[];
488
488
  clearCache(): void;
489
489
  getExecFuncModule(renderData: ComponentRenderData, fileNameKey: "serverQueriesExecFuncFileName"): any;
490
- unstable__getServerQueriesData(renderData: ComponentRenderData, $ctx: Record<string, any>): Promise<any>;
490
+ unstable__getServerQueriesData(renderData: ComponentRenderData, $ctx: Record<string, any>, $props?: Record<string, any>): Promise<any>;
491
491
  unstable__generateMetadata(renderData: ComponentRenderData, props: {
492
492
  params: Promise<ParamsRecord> | ParamsRecord;
493
493
  query: Promise<ParamsRecord> | ParamsRecord;
@@ -571,6 +571,11 @@ export declare function PlasmicRootProvider(props: {
571
571
  * /some/path?q=foo).
572
572
  */
573
573
  pageQuery?: Record<string, string | string[] | undefined>;
574
+ /**
575
+ * Defaults to false. If true, query params are derived from `location.search` sync
576
+ * with client-side history changes. `pageQuery` prop is used as a fallback during SSR.
577
+ */
578
+ trackQueryParams?: boolean;
574
579
  /**
575
580
  * Whether the internal Plasmic React.Suspense boundaries should be removed
576
581
  */
package/dist/index.esm.js CHANGED
@@ -295,6 +295,7 @@ function PlasmicRootProvider(props) {
295
295
  pageRoute,
296
296
  pageParams,
297
297
  pageQuery,
298
+ trackQueryParams,
298
299
  suspenseFallback,
299
300
  disableLoadingBoundary,
300
301
  disableRootLoadingBoundary,
@@ -400,7 +401,8 @@ function PlasmicRootProvider(props) {
400
401
  {
401
402
  route: pageRoute,
402
403
  params: pageParams,
403
- query: pageQuery
404
+ query: pageQuery,
405
+ trackQueryParams
404
406
  },
405
407
  /* @__PURE__ */ React2.createElement(
406
408
  MaybeWrap,
@@ -1155,7 +1157,7 @@ var PlasmicComponentLoader = class {
1155
1157
  }
1156
1158
  return this.__internal.loadServerQueriesModule(fileName);
1157
1159
  }
1158
- unstable__getServerQueriesData(renderData, $ctx) {
1160
+ unstable__getServerQueriesData(renderData, $ctx, $props) {
1159
1161
  return __async(this, null, function* () {
1160
1162
  var _a;
1161
1163
  const module = this.getExecFuncModule(
@@ -1167,7 +1169,7 @@ var PlasmicComponentLoader = class {
1167
1169
  (_a = renderData.entryCompMetas[0]) == null ? void 0 : _a.displayName
1168
1170
  );
1169
1171
  try {
1170
- const $serverQueries = yield module == null ? void 0 : module.executeServerQueries($ctx);
1172
+ const $serverQueries = yield module == null ? void 0 : module.executeServerQueries($ctx, $props);
1171
1173
  return $serverQueries;
1172
1174
  } catch (err) {
1173
1175
  console.error("Error executing server queries function", err);