Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is a rewrite of a Perspective's initialization API, in an attempt to address framework and build tool integration complexity. This has been a frequent source of Community frustration #2725 #2795 #1734 #2796 etc.
@finos/perspective-esbuild-plugin
and@finos/perspective-webpack-plugin
have been removed. In their place is an explicit WebAssembly initialization API inspired by DuckDB Wasm which implements a similar API. To use the new API, you must acquire the.wasm
binary assets via your bundler's asset packaging, then initialize Perspective viainit_client()
andinit_server()
methods. For Vite, this looks like this:The downside of this API is its verbosity - it is regrettably noisy, with IKEA-esque nescience. It is also a non-trivial breaking change for any ESM/bundler integration with Perspective. The upside is it requires no plugin at all to import with a bundler, as Perspective now exports pure JavaScript ES modules which should be compatible with any bundler.
Documentation
With this change comes a rewritten User Guide, extracted from
docs.rs
by popular demand. The beta release can be found here, note it is currently not linked as it describes an unreleased Perspective version!https://perspective.finos.org/guide/
We've added new sections covering bundling with various bundlers including Vite, ESBuild and Webpack, and added a full-blown Vite example in
/examples/vite-example
as well.Deprecated
To be decided, potentially two API deprecations in addition to the API changes above.
@finos/perspective-esbuild-plugin
and@finos/perspective-webpack-plugin
as mentioned. They will not work with v3.3.0 Perspective (at least - not as described in their docs), so v3.2.1 would be the last release for these. However, they should no longer be necessary, so if there is a strong argument to keep these, I question the value proposition of the unbundled build at all.With this change, inline build of Perspective are no longer really necessary, as you may now simply inline the
.wasm
assets in yourself with your bundler's own inlining feature. We'd like to deprecate these entirely, but for now we're still building them (with an explicit deprecation warning in the documentation and console).Changes
mdbook
docs site.Partially enabled by #2885, which removed one of the last complex Wasm/JavaScript bridge calls.
Community Call for Testing
We are interested in soliciting community feedback for this change, especially if you've had integration issues with previous Perspective builds. You can try out the new unbundled API today, via the
next
tag on NPM, by specifyingnext
instead of a version in the CLI orpackage.json
:Documentation for the new bundling workflow can be found on the new User Guide. New examples (including the Vite example) can be found in the branch
/examples
directory.