@assetlib/sdk-core 0.7.6-preview.1 → 0.7.8-preview.1
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/README.md +3 -3
- package/dist/telemetry.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -86,7 +86,7 @@ App-owned catalog placements may include `bundledAccessibility` with the same sh
|
|
|
86
86
|
|
|
87
87
|
## Image formats and sizes
|
|
88
88
|
|
|
89
|
-
Preview 0.2 accepts the optional signed `renditionSchemaVersion: 1` extension. Existing schema-1 manifests still work; older clients can use the mandatory WebP fallback in new manifests. By default, the client selects PNG or WebP. Ask for physical pixels with both `pixelWidth` and `pixelHeight`; without a target, selection uses the generated
|
|
89
|
+
Preview 0.2 accepts the optional signed `renditionSchemaVersion: 1` extension. Existing schema-1 manifests still work; older clients can use the mandatory WebP fallback in new manifests. By default, the client selects PNG or WebP. Ask for physical pixels with both `pixelWidth` and `pixelHeight`; without a target, selection uses the generated reference dimensions. Core cannot see layout: the Expo components pass the measured view × display scale (see the [Expo README](../sdk-expo/README.md#sizing)); other callers pass their own target.
|
|
90
90
|
|
|
91
91
|
Selection uses the smallest rendition covering both dimensions, then byte size and hash. If every rendition is smaller, the largest is preferred. Failed candidates advance to the next candidate, then the legacy fallback. Historical releases remain cache-only. The result describes the actual selected MIME, hash and pixel dimensions. It does not convert one format into another on the device.
|
|
92
92
|
|
|
@@ -102,7 +102,7 @@ A catalog placement can declare `"rendering": "template"`. Assetlib then deliver
|
|
|
102
102
|
|
|
103
103
|
Signed image descriptors (placements, state members, variant cells and catalog page images) may carry `rendering`. A present value that is not a string matching `^[a-z][a-z0-9-]{0,31}$` rejects the release; absent means `original`. Resolution compares the reference's rendering with the descriptor actually selected after arm, appearance and state selection. If they differ, or the descriptor names a value this client does not know, that release's descriptor is skipped as for an incompatible size: its cache entry is not read and nothing is downloaded. When the current release publishes the key, resolution continues with the usual order, a compatible verified cached image from an older retained release and then the bundled fallback (`fallbackReason: 'missing'`). Other placements are unaffected. Catalog page images resolve as `original`. `ResolvedAsset.rendering` reports the delivered descriptor's rendering, `'original'` or `'template'`.
|
|
104
104
|
|
|
105
|
-
The bundled fallback must also be a single-color shape, such as a PNG with alpha, because the app applies the same tint to remote and bundled artwork. Remote masks are rasters, so request physical pixels with `pixelWidth` and `pixelHeight` (
|
|
105
|
+
The bundled fallback must also be a single-color shape, such as a PNG with alpha, because the app applies the same tint to remote and bundled artwork. Remote masks are rasters, so request physical pixels with `pixelWidth` and `pixelHeight` (view size × display scale); the Expo components do this for every placement. Template rendering needs this SDK and CLI or newer: older code generation drops the field, and older runtimes do not check it. Publishing template descriptors from the hosted console is planned; until then releases carry no `rendering` field.
|
|
106
106
|
|
|
107
107
|
## Offline typed references
|
|
108
108
|
|
|
@@ -121,7 +121,7 @@ Check a catalog into your application:
|
|
|
121
121
|
node node_modules/@assetlib/sdk-core/bin/codegen.mjs assetlib.catalog.json > src/assets.generated.ts
|
|
122
122
|
```
|
|
123
123
|
|
|
124
|
-
Use `AppAssets.Travel.coast` in application code. Existing compatible artwork updates do not require regenerating this catalog. Adding a new application placement does. Schema v1 identifies placements by key and by width and height.
|
|
124
|
+
Use `AppAssets.Travel.coast` in application code. Existing compatible artwork updates do not require regenerating this catalog. Adding a new application placement does. Schema v1 identifies placements by key and by width and height. Width and height are a reference size: they fix the aspect ratio and identify the placement; the SDK sizes requests from the view. Every published image must match that aspect ratio (the console checks it when an image is assigned and again at publish) and may have any pixel size. `resolve` without `pixelWidth` and `pixelHeight` uses the reference size as its target; the Expo components measure the view instead. Changing the numbers changes the placement's identity, so never renumber a catalog to change sharpness. Stable placement IDs and separately versioned contracts are not implemented yet. Renaming a key requires a coordinated migration, not simply renaming it in the console.
|
|
125
125
|
|
|
126
126
|
## Appearance and arm variants
|
|
127
127
|
|
package/dist/telemetry.js
CHANGED
|
@@ -28,7 +28,7 @@ export class ObservationReporter {
|
|
|
28
28
|
this.fetcher = fetcher;
|
|
29
29
|
this.interval = boundedInteger(options.flushIntervalMs, 60_000, 2_147_483_647);
|
|
30
30
|
this.maxBatch = boundedInteger(options.maxBatch, 200, 200);
|
|
31
|
-
const sdk = options.sdk ?? { name: 'sdk-core', version: '0.7.
|
|
31
|
+
const sdk = options.sdk ?? { name: 'sdk-core', version: '0.7.8-preview.1' };
|
|
32
32
|
const build = options.build ?? { platform: 'web', appVersion: 'unknown', buildNumber: 'unknown' };
|
|
33
33
|
if (!version(sdk.name) || !version(sdk.version) || !['ios', 'android', 'web', 'expo'].includes(build.platform) || !version(build.appVersion) || !version(build.buildNumber) || (options.installId !== undefined && !validId(options.installId)))
|
|
34
34
|
throw new Error('Invalid observation configuration.');
|