Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Put web viewer on npm #3983

Closed
jprochazk opened this issue Oct 24, 2023 · 1 comment · Fixed by #4003
Closed

Put web viewer on npm #3983

jprochazk opened this issue Oct 24, 2023 · 1 comment · Fixed by #4003
Assignees

Comments

@jprochazk
Copy link
Member

jprochazk commented Oct 24, 2023

$ npm i @rerun-io/web-viewer

The package will contain our Wasm binary, and bindings for it. The basic set of features should be:

  • Place a web viewer canvas which takes up its entire container width/height
  • Give the web viewer a URL of an .rrd file to load

We'll have a small library to wrap these bindings and make them nicer to use. The web viewer should be framework agnostic, ideally exposed as a web component:

import { WebViewer } from "@rerun-io/web-viewer";

const viewer = new WebViewer("https://app.rerun.io/data.rrd");
document.body.append(viewer);

We should also provide wrappers for popular frameworks (at least React, Vue, Svelte) that just instantiate and manage the custom element:

import { WebViewer } from "@rerun-io/web-viewer/react";

export default function App() {
  return (
    <main>
      <WebViewer url="https://app.rerun.io/data.rrd" />
    </main>
  );
}

I created the rerun-io npm org where we can publish the package: https://www.npmjs.com/org/rerun-io

@jprochazk jprochazk changed the title Put rerun on npm Put web viewer on npm Oct 24, 2023
@emilk
Copy link
Member

emilk commented Oct 24, 2023

It should also handle showing a loading screen while the WASM download, and show a nice error message on crashes

@jprochazk jprochazk self-assigned this Oct 25, 2023
@jprochazk jprochazk mentioned this issue Oct 25, 2023
13 tasks
jprochazk added a commit that referenced this issue Nov 3, 2023
### What

Closes #3983

* [x] Create the package
* [x] Examples using the package
  * [x] No framework
  * [x] React
* [x] Document the package
* [x] Note about package version being equal to the rerun version
(`@rerun-io/web-viewer@0.9.1` can load the same files as `pip install
rerun-sdk==0.9.1`)
  * [x] Note about WASM imports
    * Bundlers generally handle WASM imports well
* [x] Build the package on CI
* [x] Add `npm publish` step to release process

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested [demo.rerun.io](https://demo.rerun.io/pr/4003) (if
applicable)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG

- [PR Build Summary](https://build.rerun.io/pr/4003)
- [Docs
preview](https://rerun.io/preview/75c1c97533a42a7a786f14a777fa6b3fe9397245/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/75c1c97533a42a7a786f14a777fa6b3fe9397245/examples)
<!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://ref.rerun.io/dev/bench/)
- [Wasm size tracking](https://ref.rerun.io/dev/sizes/)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants