Description
This is an issue w/ DHE dev mode only (there is an easy workaround by modifying the Vite config there).
The issue is that @deephaven/app-utils was added as a dependency to @deephaven/dashboard-core-plugins. As a result, it became an indirect dependency in DHE when upgrading to 0.50.0 (dependency change was in 0.49.0).
In dev mode, Vite uses esbuild to pre-bundle and cache all dependencies. As part of its tree traversal (so it can do tree shaking), it hits the import 'fira' in FontBootstrap and esbuild throws that it can't handle font files like .ttf. This doesn't seem to be an issue when building since rollup is used for production builds.
Even though @deephaven/app-utils is not used by DHE, it is part of the import tree (and then would get shaken out). This issue is a downside of using barrel files to house all the imports for the package.
The things needed from app-utils can be split out into other packages. Specifically the ConnectionContext and useConnection can be put in jsapi-utils or jsapi-components. Then app-utils just creates the provider used in the app.
Steps to reproduce
Install DHC 0.50.0 packages in DHE and run npm start.
Expected results
Functional dev mode
Actual results
Broken dev mode complaining that esbuild doesn't know how to deal w/ font files.
Additional details and attachments
Adding optimizeDeps.exclude = ['@deephaven/app-utils'] seems to make dev mode functional again in DHE.
Versions
Description
This is an issue w/ DHE dev mode only (there is an easy workaround by modifying the Vite config there).
The issue is that
@deephaven/app-utilswas added as a dependency to@deephaven/dashboard-core-plugins. As a result, it became an indirect dependency in DHE when upgrading to 0.50.0 (dependency change was in 0.49.0).In dev mode, Vite uses esbuild to pre-bundle and cache all dependencies. As part of its tree traversal (so it can do tree shaking), it hits the
import 'fira'inFontBootstrapand esbuild throws that it can't handle font files like.ttf. This doesn't seem to be an issue when building since rollup is used for production builds.Even though
@deephaven/app-utilsis not used by DHE, it is part of the import tree (and then would get shaken out). This issue is a downside of using barrel files to house all the imports for the package.The things needed from
app-utilscan be split out into other packages. Specifically theConnectionContextanduseConnectioncan be put injsapi-utilsorjsapi-components. Thenapp-utilsjust creates the provider used in the app.Steps to reproduce
Install DHC 0.50.0 packages in DHE and run
npm start.Expected results
Functional dev mode
Actual results
Broken dev mode complaining that esbuild doesn't know how to deal w/ font files.
Additional details and attachments
Adding
optimizeDeps.exclude = ['@deephaven/app-utils']seems to make dev mode functional again in DHE.Versions