diff --git a/docs/index.html b/docs/index.html index 30eb2ad02..b13a7352c 100644 --- a/docs/index.html +++ b/docs/index.html @@ -4175,6 +4175,7 @@
The method z.dehydrate(func, inputData)
has two required arguments:
func
- the function to call to fetch the extra data. Can be any raw function
, defined in the file doing the dehydration or imported from another part of your app. You must also register the function in the app's hydrators
property. Note that since v10.1.0, the maximum payload size to pass to z.dehydrate
/ z.dehydrateFile
is 6KB.inputData
- this is an object that contains things like a path
or id
- whatever you need to load data on the other sideinputData
within that timeframe. To workaround this cache for records triggering hydration in close succession, include a unique value in the inputData
, for example a timestamp
in addition to the record id
. Why do I need to register my functions? Because of how JavaScript works with its module system, we need an explicit handle on the function that can be accessed from the App definition without trying to "automagically" (and sometimes incorrectly) infer code locations.
Here is an example that pulls in extra data for a movie:
diff --git a/packages/cli/README-source.md b/packages/cli/README-source.md index 6c5ab867d..0774d3e24 100644 --- a/packages/cli/README-source.md +++ b/packages/cli/README-source.md @@ -1421,6 +1421,7 @@ The method `z.dehydrate(func, inputData)` has two required arguments: * `func` - the function to call to fetch the extra data. Can be any raw `function`, defined in the file doing the dehydration or imported from another part of your app. You must also register the function in the app's `hydrators` property. Note that since v10.1.0, the maximum payload size to pass to `z.dehydrate` / `z.dehydrateFile` is 6KB. * `inputData` - this is an object that contains things like a `path` or `id` - whatever you need to load data on the other side +* A known limitation of hydration is a 5 minute cache if the hydration call is made with identical `inputData` within that timeframe. To workaround this cache for records triggering hydration in close succession, include a unique value in the `inputData`, for example a `timestamp` in addition to the record `id`. > **Why do I need to register my functions?** Because of how JavaScript works with its module system, we need an explicit handle on the function that can be accessed from the App definition without trying to "automagically" (and sometimes incorrectly) infer code locations. diff --git a/packages/cli/README.md b/packages/cli/README.md index db3e89a4a..3fc10e970 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -2573,6 +2573,7 @@ The method `z.dehydrate(func, inputData)` has two required arguments: * `func` - the function to call to fetch the extra data. Can be any raw `function`, defined in the file doing the dehydration or imported from another part of your app. You must also register the function in the app's `hydrators` property. Note that since v10.1.0, the maximum payload size to pass to `z.dehydrate` / `z.dehydrateFile` is 6KB. * `inputData` - this is an object that contains things like a `path` or `id` - whatever you need to load data on the other side +* A known limitation of hydration is a 5 minute cache if the hydration call is made with identical `inputData` within that timeframe. To workaround this cache for records triggering hydration in close succession, include a unique value in the `inputData`, for example a `timestamp` in addition to the record `id`. > **Why do I need to register my functions?** Because of how JavaScript works with its module system, we need an explicit handle on the function that can be accessed from the App definition without trying to "automagically" (and sometimes incorrectly) infer code locations. diff --git a/packages/cli/docs/index.html b/packages/cli/docs/index.html index 30eb2ad02..b13a7352c 100644 --- a/packages/cli/docs/index.html +++ b/packages/cli/docs/index.html @@ -4175,6 +4175,7 @@The method z.dehydrate(func, inputData)
has two required arguments:
func
- the function to call to fetch the extra data. Can be any raw function
, defined in the file doing the dehydration or imported from another part of your app. You must also register the function in the app's hydrators
property. Note that since v10.1.0, the maximum payload size to pass to z.dehydrate
/ z.dehydrateFile
is 6KB.inputData
- this is an object that contains things like a path
or id
- whatever you need to load data on the other sideinputData
within that timeframe. To workaround this cache for records triggering hydration in close succession, include a unique value in the inputData
, for example a timestamp
in addition to the record id
. Why do I need to register my functions? Because of how JavaScript works with its module system, we need an explicit handle on the function that can be accessed from the App definition without trying to "automagically" (and sometimes incorrectly) infer code locations.
Here is an example that pulls in extra data for a movie: