feat(web): use wasm for justified layout calculation (#15524)

* working

* use wrapper class

* update import

* simplify

* it works without changing `optimizeDeps`

* inline layout options

* update gallery view

* use es2022

* fix import

* fix vitest

* empty geometry

* bump version

* Update web/src/lib/stores/assets.store.ts

Co-authored-by: Jason Rasmussen <jason@rasm.me>

* fix: typo

---------

Co-authored-by: Jason Rasmussen <jason@rasm.me>
Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
Mert
2025-02-21 12:20:25 +03:00
committed by GitHub
parent 52f21fb331
commit 3925445de8
9 changed files with 98 additions and 110 deletions

View File

@@ -4,6 +4,7 @@ import { svelteTesting } from '@testing-library/svelte/vite';
import path from 'node:path';
import { visualizer } from 'rollup-plugin-visualizer';
import { defineConfig } from 'vite';
import wasm from 'vite-plugin-wasm';
const upstream = {
target: process.env.IMMICH_SERVER_URL || 'http://immich-server:2283/',
@@ -14,6 +15,9 @@ const upstream = {
};
export default defineConfig({
build: {
target: 'es2022',
},
resolve: {
alias: {
'xmlhttprequest-ssl': './node_modules/engine.io-client/lib/xmlhttprequest.js',
@@ -40,6 +44,7 @@ export default defineConfig({
: undefined,
enhancedImages(),
svelteTesting(),
wasm(),
],
optimizeDeps: {
entries: ['src/**/*.{svelte,ts,html}'],
@@ -52,5 +57,9 @@ export default defineConfig({
sequence: {
hooks: 'list',
},
deps: {
// workaround for https://github.com/vitest-dev/vitest/issues/2150
inline: ['@immich/justified-layout-wasm'],
},
},
});