@plasmicapp/loader-react 1.0.183 → 1.0.185

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/loader.d.ts CHANGED
@@ -84,7 +84,9 @@ export declare class InternalPlasmicComponentLoader {
84
84
  unsubscribePlasmicRoot(watcher: PlasmicRootWatcher): void;
85
85
  clearCache(): void;
86
86
  private maybeGetCompMetas;
87
+ maybeFetchComponentData(specs: ComponentLookupSpec[], opts?: FetchComponentDataOpts): Promise<ComponentRenderData | null>;
87
88
  maybeFetchComponentData(...specs: ComponentLookupSpec[]): Promise<ComponentRenderData | null>;
89
+ fetchComponentData(specs: ComponentLookupSpec[], opts?: FetchComponentDataOpts): Promise<ComponentRenderData>;
88
90
  fetchComponentData(...specs: ComponentLookupSpec[]): Promise<ComponentRenderData>;
89
91
  fetchPages(opts?: FetchPagesOpts): Promise<PageMeta[]>;
90
92
  fetchComponents(): Promise<ComponentMeta[]>;
@@ -188,4 +190,21 @@ export declare class PlasmicComponentLoader {
188
190
  trackConversion(value?: number): void;
189
191
  clearCache(): void;
190
192
  }
193
+ interface FetchComponentDataOpts {
194
+ /**
195
+ * Will fetch either code targeting SSR or browser hydration in the
196
+ * returned bundle.
197
+ *
198
+ * By default, the target is browser. That's okay, because even when
199
+ * doing SSR, as long as you are using the same instance of PlasmicLoader
200
+ * that was used to fetch component data, it will still know how to get at
201
+ * the server code.
202
+ *
203
+ * But, if you are building your own SSR solution, where fetching and rendering
204
+ * are using different instances of PlasmicLoader, then you'll want to make
205
+ * sure that when you fetch, you are fetching the right one to be used in the
206
+ * right environment for either SSR or browser hydration.
207
+ */
208
+ target?: 'server' | 'browser';
209
+ }
191
210
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plasmicapp/loader-react",
3
- "version": "1.0.183",
3
+ "version": "1.0.185",
4
4
  "module": "dist/loader-react.esm.js",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -23,9 +23,9 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "@plasmicapp/host": "1.0.81",
26
- "@plasmicapp/loader-core": "1.0.83",
26
+ "@plasmicapp/loader-core": "1.0.84",
27
27
  "@plasmicapp/loader-splits": "1.0.15",
28
- "@plasmicapp/query": "0.1.54",
28
+ "@plasmicapp/query": "0.1.55",
29
29
  "pascalcase": "^1.0.0",
30
30
  "react-is": "^17.0.2",
31
31
  "react-ssr-prepass": "^1.4.0"
@@ -74,5 +74,5 @@
74
74
  "typescript": "^4.3.2"
75
75
  },
76
76
  "license": "MIT",
77
- "gitHead": "78326673261a8594b38d1525339a2bb837d0eb3d"
77
+ "gitHead": "0fd37b85a0227c1ff756fd50de68a1bdc0878e87"
78
78
  }