Open rajsite opened 1 month ago
Maybe I was just misinterpreting the docs, they seem to indicate that by default the inline builds are used and a bundler is not needed: https://docs.rs/perspective-js/latest/perspective_js/#installation
By default, Perspective inlines these assets into the .js scripts, and delivers them in one file. This has no runtime performance impact, but does increase asset load time.
And then conversation continues about using bundlers, presumable for the non-default use case of more optimal builds.
Maybe the docs are outdated with 3.0 changes? It seems like the inline builds are not the default and instead using the inline builds requires referencing @finos/perspective-viewer/dist/esm/perspective-viewer.inline.js
and @finos/perspective/dist/esm/perspective.inline.js
.
If that is the case then maybe this issue is a documentation should have a specific example of showing the now non-default inline builds? If that is the case I can create a PR to update that documentation.
However, even with the inline build I ran into a runtime issue (so not completely sure this is the right direction): https://github.com/finos/perspective/issues/2796
same problem here, i've tried everything without success. note: version 2.10.1 works. i'm still getting an import error but is not blocking the build process.
Do you know where we can see documentation for 2.10.1?
I don't think the documentation is available for the order version (2.xx) as far as building goes, the documentation has remained the same between the 2 major versions.
Do you know where we can see documentation for 2.10.1?
You can use the Wayback machine to see old docs:
https://web.archive.org/web/20240605134744/https://perspective.finos.org/
I found a workaround by using the inline builds in the latest package with vite as shown here: https://github.com/finos/perspective/issues/2796#issuecomment-2438383909
Maybe this issue should be open to capture documentation updates / updating the vite example for v3.1.2 via inline builds?
I found a workaround by using the inline builds in the latest package with vite as shown here: #2796 (comment)
Maybe this issue should be open to capture documentation updates / updating the vite example for v3.1.2 via inline builds?
Here's a code example of the workaround:
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
import { purgeCss } from 'vite-plugin-tailwind-purgecss';
//import { PerspectiveEsbuildPlugin } from '@finos/perspective-esbuild-plugin';
//import wasm from 'vite-plugin-wasm';
//import topLevelAwait from 'vite-plugin-top-level-await';
//import typescript from '@rollup/plugin-typescript';
export default defineConfig({
plugins: [
sveltekit(),
purgeCss(),
// // {
// // content: ['./src/**/*.svelte', './src/**/*.html', './src/**/*.ts', './src/**/*.js'],
// //}
//),
],
resolve: {
alias: {
'@finos/perspective': '@finos/perspective/dist/esm/perspective.inline.js',
'@finos/perspective-viewer': '@finos/perspective-viewer/dist/esm/perspective-viewer.inline.js',
'@finos/perspective-styles': '@finos/perspective-viewer/dist/css',
//'@finos/perspective-viewer/dist/css/solarized-dark.css': '@finos/perspective-viewer/dist/css/solarized-dark.css',
//'@finos/perspective-viewer/dist/css/themes.css': '@finos/perspective-viewer/dist/css/themes.css'
},
},
optimizeDeps: {
esbuildOptions: {
target: 'es2022',
},
},
build: {
target: 'es2022',
},
});
note that the code commented out was from trial and error.
when importing styles, you now have to import them using the new @finos/perspective-styles
.
the only catch (quite irritating) is that i'm unable to found a workaround for getting back typescrit Types. Cold you please help me guys ?
Bug Report
Steps to Reproduce:
Trying to update the vite example to perspective 3.1.0 fails for two reasons:
vite.config.ts
and updates to package.json script commands to include config file)The built
dist
output has dependencies on thesrc/ts
resulting in build errors like the following:See stackblitz example based on vite example to target es2022 for tla support: https://stackblitz.com/edit/perspective-vite-build-fail
Expected Result:
Library builds successfully
Actual Result:
See above
If you are reporting a UX/UI error:
N/A
If you are reporting a library error:
N/A
If you are reporting a build or install error:
done, see above.
Environment:
For JavaScript (browser):
@finos/perspective
version: 3.1.0For Node.js: N/A
node
versionFor Python N/A
python
interpreter version (Only CPython).Additional Context:
Related issues / discussions: