Interface specifying how to fetch a remote chunk. It represents the output of RemoteChunkResolver function used by ChunkManager.
• Optional absolute: boolean
Flag indicating whether the URL is an absolute FileSystem URL on a target device.
Useful if you're using custom code to download the chunk and you want ChunkManager to
execute it only from a custom FileSystem path.
Defaults to false.
• Optional body: null | string | URLSearchParams | FormData
HTTP body for a remote chunk's fetch request.
When passing body, make sure the method is set to POST and a correct
content-type header is provided.
Changing this field for the same chunk, will cause cache invalidation for that chunk and a fresh version will be downloaded.
• Optional excludeExtension: boolean
Whether not to add chunk's default extension by default. If your chunk has different
extension than .chunk.bundle you should set this flag to true and add extension to the url.
• Optional headers: Record<string, string> | Headers
Headers to pass to a remote chunk's fetch request.
When passing body, make sure add content content-type header, otherwise text/plain
will be used.
Changing this field for the same chunk, will cause cache invalidation for that chunk and a fresh version will be downloaded.
• Optional method: "GET" | "POST"
HTTP method used to fetch remote chunk.
Passing body with method GET is a no-op. Use POST to send body data.
Changing this field for the same chunk, will cause cache invalidation for that chunk and a fresh version will be downloaded.
• Optional query: string | Record<string, string> | URLSearchParams
Query params to append when building the final URL.
Changing this field for the same chunk, will cause cache invalidation for that chunk and a fresh version will be downloaded.
• Optional timeout: number
Custom timeout for chunk fetch requests. Defaults to 30s.
On iOS this timeout is used as a timeoutInterval
On Android this timeout is used as a readTimeout and connectionTimeout.
• url: string
A path-only URL to remote location, where to download a chunk from.
Changing this field for the same chunk, will cause cache invalidation for that chunk and a fresh version will be downloaded.
Example: for chunkId: 'TeacherModule' the url can look like this:
https://myapp.com/assets/TeacherModule.
Passing query params might lead to unexpected results. To pass query params use query field.