@ifc-lite/cache 2.1.0 → 2.1.2

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.
Files changed (2) hide show
  1. package/README.md +7 -3
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -46,8 +46,8 @@ If you already have a GLB blob (from a server, S3, etc.), skip the binary cache
46
46
  ```typescript
47
47
  import { loadGLBToMeshData, parseGLB } from '@ifc-lite/cache';
48
48
 
49
- const meshes = await loadGLBToMeshData(glbBuffer);
50
- // MeshData[] ready to feed into @ifc-lite/renderer
49
+ const meshes = loadGLBToMeshData(new Uint8Array(glbBuffer)); // synchronous
50
+ // MeshData[] ready to feed into @ifc-lite/renderer
51
51
 
52
52
  // Or get the parsed GLB structure if you need lower-level access
53
53
  const { json, bin } = parseGLB(glbBuffer);
@@ -66,6 +66,10 @@ const rawKey = xxhash64(buffer); // same hash as a bigint
66
66
 
67
67
  The cache keys models by the xxHash64 of the source IFC, and `reader.validate(cacheBuffer, sourceBuffer)` uses the same hash to detect when the source has changed.
68
68
 
69
+ ## Format versioning
70
+
71
+ The binary layout is versioned via the exported `FORMAT_VERSION` constant. Readers accept entries written by the current or an older format version (with backward-compatible decoding, e.g. the per-mesh geometry-class byte added in v5) and reject entries written by a newer one, so mixed-version deployments fail safely toward a cold parse.
72
+
69
73
  ## Source-hash contract (and `omitSourceHash`)
70
74
 
71
75
  By default the header stores the full-file `xxhash64` of the source in `sourceHash`, and `reader.validate()` / `read({ sourceBuffer })` compare against it. Hashing a large source can be a multi-second main-thread cost, so a caller that validates the source **another way** (e.g. an application-layer content hash plus a file modified-time guard, as the viewer's source-decoupled cache tier does) can pass `omitSourceHash: true`:
@@ -87,7 +91,7 @@ This is backward compatible: entries written before the flag existed have it uns
87
91
 
88
92
  ## API
89
93
 
90
- See the [API Reference](https://ltplus-ag.github.io/ifc-lite/api/typescript/#ifc-litecache).
94
+ See the [API Reference](https://ifclite.dev/docs/api/typescript/#ifc-litecache).
91
95
 
92
96
  ## License
93
97
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ifc-lite/cache",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "description": "Binary cache format for IFC-Lite - fast model loading",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -13,8 +13,8 @@
13
13
  }
14
14
  },
15
15
  "dependencies": {
16
- "@ifc-lite/data": "^2.4.0",
17
- "@ifc-lite/geometry": "^3.1.1"
16
+ "@ifc-lite/data": "^2.5.2",
17
+ "@ifc-lite/geometry": "^3.1.4"
18
18
  },
19
19
  "devDependencies": {
20
20
  "typescript": "^6.0.3",
@@ -27,7 +27,7 @@
27
27
  "url": "https://github.com/LTplus-AG/ifc-lite.git",
28
28
  "directory": "packages/cache"
29
29
  },
30
- "homepage": "https://ltplus-ag.github.io/ifc-lite/",
30
+ "homepage": "https://ifclite.dev/docs/",
31
31
  "bugs": "https://github.com/LTplus-AG/ifc-lite/issues",
32
32
  "keywords": [
33
33
  "ifc",