Interface: RemoteChunkLocation

Interface specifying how to fetch a remote chunk. It represents the output of RemoteChunkResolver function used by ChunkManager.

Table of contents

Properties

Properties

absolute

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.

Defined in

types.ts:80


body

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.

Defined in

types.ts:65


excludeExtension

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.

Defined in

types.ts:25


headers

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.

Defined in

types.ts:44


method

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.

Defined in

types.ts:54


query

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.

Defined in

types.ts:33


timeout

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.

Defined in

types.ts:72


url

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.

Defined in

types.ts:19