Skip to content

Commit 13b2aa8

Browse files
authored
feat(cat-voices): find manual version files through wildcard (#3723)
* feat: v1 version for key derivation * feat: add wildcard support * feat: adding v1 versions * feat: update catalyst_compression to v1
1 parent 3da967f commit 13b2aa8

File tree

27 files changed

+181
-110
lines changed

27 files changed

+181
-110
lines changed

β€Žcatalyst_voices/packages/internal/catalyst_voices_models/lib/src/config/app_config.dartβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,8 @@ final class DatabaseConfig extends Equatable {
248248

249249
const DatabaseConfig({
250250
this.name = 'catalyst_db',
251-
this.webSqlite3Wasm = 'sqlite3.wasm',
252-
this.webDriftWorker = 'drift_worker.js',
251+
this.webSqlite3Wasm = 'sqlite3.v1.wasm',
252+
this.webDriftWorker = 'drift_worker.v1.js',
253253
});
254254

255255
@override

β€Žcatalyst_voices/packages/internal/catalyst_voices_repositories/README.mdβ€Ž

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ what should be committed.
3434
## Database
3535

3636
**CatalystDatabase** depends on jsonb queries, which was introduced in sqlite 3.45.0.
37-
Read more [here](https://sqlite.org/jsonb.html).
37+
[Read more here](https://sqlite.org/jsonb.html).
3838
This means we need to ensure minimum version.
3939

4040
### Drift
@@ -68,7 +68,7 @@ Additional headers
6868
* `Cross-Origin-Opener-Policy`: Needs to be set to `same-origin`.
6969
* `Cross-Origin-Embedder-Policy`: Needs to be set to `require-corp`.
7070

71-
Read more [here](https://drift.simonbinder.eu/platforms/web/#additional-headers).
71+
[Read more here](https://drift.simonbinder.eu/platforms/web/#additional-headers).
7272

7373
Drift requires **driftWorker** and **driftWorker**
7474

@@ -77,10 +77,10 @@ Those files can be compiles by hand or downloaded from
7777
* [sqlite3Wasm](https://github.com/simolus3/sqlite3.dart/releases)
7878
* [driftWorker](https://github.com/simolus3/drift/releases).
7979

80-
`sqlite3.wasm` file needs to be served with a `Content-Type` of `application/wasm` since browsers
80+
`sqlite3.v1.wasm` file needs to be served with a `Content-Type` of `application/wasm` since browsers
8181
will reject the module otherwise.
8282

83-
Read more [here](https://drift.simonbinder.eu/platforms/web/#prerequisites).
83+
[Read more here](https://drift.simonbinder.eu/platforms/web/#prerequisites).
8484

8585
#### Native
8686

β€Žcatalyst_voices/packages/internal/catalyst_voices_repositories/test/src/database/executor/web.dartβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Future<QueryExecutor> buildExecutor() async {
1515
// see https://github.com/simolus3/drift/issues/1592
1616
throw UnsupportedError(
1717
'Drift does is not testable in unit tests for web, because it requires '
18-
'sqlite3.wasm to be served with specific headers and this is '
18+
'sqlite3.v1.wasm to be served with specific headers and this is '
1919
'not possible in flutter test. '
2020
'Its possible to test drift on web but we would need to convert existing '
2121
'unit tests to integration tests with widgets',
Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -211,14 +211,13 @@ let compression_wasm_bindgen;
211211
}
212212
/**
213213
* @param {number} func_id
214+
* @param {any} port_
214215
* @param {any} ptr_
215216
* @param {number} rust_vec_len_
216217
* @param {number} data_len_
217-
* @returns {any}
218218
*/
219-
__exports.frb_pde_ffi_dispatcher_sync = function(func_id, ptr_, rust_vec_len_, data_len_) {
220-
const ret = wasm.frb_pde_ffi_dispatcher_sync(func_id, ptr_, rust_vec_len_, data_len_);
221-
return ret;
219+
__exports.frb_pde_ffi_dispatcher_primary = function(func_id, port_, ptr_, rust_vec_len_, data_len_) {
220+
wasm.frb_pde_ffi_dispatcher_primary(func_id, port_, ptr_, rust_vec_len_, data_len_);
222221
};
223222

224223
/**
@@ -233,13 +232,14 @@ let compression_wasm_bindgen;
233232

234233
/**
235234
* @param {number} func_id
236-
* @param {any} port_
237235
* @param {any} ptr_
238236
* @param {number} rust_vec_len_
239237
* @param {number} data_len_
238+
* @returns {any}
240239
*/
241-
__exports.frb_pde_ffi_dispatcher_primary = function(func_id, port_, ptr_, rust_vec_len_, data_len_) {
242-
wasm.frb_pde_ffi_dispatcher_primary(func_id, port_, ptr_, rust_vec_len_, data_len_);
240+
__exports.frb_pde_ffi_dispatcher_sync = function(func_id, ptr_, rust_vec_len_, data_len_) {
241+
const ret = wasm.frb_pde_ffi_dispatcher_sync(func_id, ptr_, rust_vec_len_, data_len_);
242+
return ret;
243243
};
244244

245245
/**
@@ -271,10 +271,6 @@ let compression_wasm_bindgen;
271271
return ret;
272272
};
273273

274-
__exports.wasm_start_callback = function() {
275-
wasm.wasm_start_callback();
276-
};
277-
278274
function passArrayJsValueToWasm0(array, malloc) {
279275
const ptr = malloc(array.length * 4, 4) >>> 0;
280276
for (let i = 0; i < array.length; i++) {
@@ -302,6 +298,10 @@ let compression_wasm_bindgen;
302298
}
303299
};
304300

301+
__exports.wasm_start_callback = function() {
302+
wasm.wasm_start_callback();
303+
};
304+
305305
/**
306306
* # Safety
307307
*
@@ -316,15 +316,15 @@ let compression_wasm_bindgen;
316316
};
317317

318318
function __wbg_adapter_36(arg0, arg1, arg2) {
319-
wasm.closure165_externref_shim(arg0, arg1, arg2);
319+
wasm.closure178_externref_shim(arg0, arg1, arg2);
320320
}
321321

322322
function __wbg_adapter_39(arg0, arg1, arg2) {
323-
wasm.closure197_externref_shim(arg0, arg1, arg2);
323+
wasm.closure203_externref_shim(arg0, arg1, arg2);
324324
}
325325

326-
function __wbg_adapter_119(arg0, arg1, arg2, arg3) {
327-
wasm.closure244_externref_shim(arg0, arg1, arg2, arg3);
326+
function __wbg_adapter_113(arg0, arg1, arg2, arg3) {
327+
wasm.closure251_externref_shim(arg0, arg1, arg2, arg3);
328328
}
329329

330330
const WorkerPoolFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -572,7 +572,7 @@ let compression_wasm_bindgen;
572572
const a = state0.a;
573573
state0.a = 0;
574574
try {
575-
return __wbg_adapter_119(a, state0.b, arg0, arg1);
575+
return __wbg_adapter_113(a, state0.b, arg0, arg1);
576576
} finally {
577577
state0.a = a;
578578
}
@@ -698,16 +698,16 @@ let compression_wasm_bindgen;
698698
const ret = false;
699699
return ret;
700700
};
701-
imports.wbg.__wbindgen_closure_wrapper1059 = function(arg0, arg1, arg2) {
702-
const ret = makeMutClosure(arg0, arg1, 196, __wbg_adapter_39);
701+
imports.wbg.__wbindgen_closure_wrapper1008 = function(arg0, arg1, arg2) {
702+
const ret = makeMutClosure(arg0, arg1, 177, __wbg_adapter_36);
703703
return ret;
704704
};
705-
imports.wbg.__wbindgen_closure_wrapper1060 = function(arg0, arg1, arg2) {
706-
const ret = makeMutClosure(arg0, arg1, 196, __wbg_adapter_39);
705+
imports.wbg.__wbindgen_closure_wrapper1071 = function(arg0, arg1, arg2) {
706+
const ret = makeMutClosure(arg0, arg1, 202, __wbg_adapter_39);
707707
return ret;
708708
};
709-
imports.wbg.__wbindgen_closure_wrapper971 = function(arg0, arg1, arg2) {
710-
const ret = makeMutClosure(arg0, arg1, 164, __wbg_adapter_36);
709+
imports.wbg.__wbindgen_closure_wrapper1073 = function(arg0, arg1, arg2) {
710+
const ret = makeMutClosure(arg0, arg1, 202, __wbg_adapter_39);
711711
return ret;
712712
};
713713
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
rust_input: crate::compression
22
rust_root: rust/
33
dart_output: lib/src/rust
4-
default_external_library_loader_web_prefix: /assets/packages/catalyst_compression/assets/js/
4+
default_external_library_loader_web_prefix: /assets/packages/catalyst_compression/assets/js/v1/
55
wasm_bindgen_name: compression_wasm_bindgen
66
# TODO(dt-iohk): allow to auto-upgrade when we're no longer using the forked flutter_rust_bridge
77
auto_upgrade_dependency: false

β€Žcatalyst_voices/packages/libs/catalyst_compression/lib/src/rust/frb_generated.dartβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class RustLib extends BaseEntrypoint<RustLibApi, RustLibApiImpl, RustLibWire> {
6666
static const kDefaultExternalLibraryLoaderConfig = ExternalLibraryLoaderConfig(
6767
stem: 'catalyst_compression',
6868
ioDirectory: 'rust/target/release/',
69-
webPrefix: '/assets/packages/catalyst_compression/assets/js/',
69+
webPrefix: '/assets/packages/catalyst_compression/assets/js/v1/',
7070
wasmBindGenName: 'compression_wasm_bindgen',
7171
);
7272
}

0 commit comments

Comments
Β (0)