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

Ability to use offscreenCanvasPonyfill? #18

Closed
cmdcolin opened this issue Aug 19, 2021 · 5 comments
Closed

Ability to use offscreenCanvasPonyfill? #18

cmdcolin opened this issue Aug 19, 2021 · 5 comments

Comments

@cmdcolin
Copy link
Contributor

cmdcolin commented Aug 19, 2021

I was trying to reboot the jbrowse-plugin-arc-renderer but it seemed to fail on offscreenCanvasPonyfill

I made this repo to try to show
https://github.com/cmdcolin/jbrowse-plugin-arc-renderer2

Cloning the repo and running yarn should replicate issue, it prints some binary to the console as seen in log below

yarn
yarn install v1.22.10
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "@babel/preset-react > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "@babel/preset-react > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "@babel/preset-react > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "@babel/preset-react > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "@babel/preset-react > @babel/plugin-transform-react-jsx > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning " > @jbrowse/[email protected]" has incorrect peer dependency "@material-ui/core@^4.12.2".
warning " > @jbrowse/[email protected]" has unmet peer dependency "@material-ui/data-grid@^4.0.0-alpha.34".
warning " > @jbrowse/[email protected]" has unmet peer dependency "prop-types@^15.0.0".
warning " > @jbrowse/[email protected]" has incorrect peer dependency "react@^17.0.0".
warning " > @jbrowse/[email protected]" has unmet peer dependency "react-dom@^17.0.0".
warning "@jbrowse/core > @material-ui/[email protected]" has unmet peer dependency "react-dom@^16.8.0 || ^17.0.0".
warning "@jbrowse/core > [email protected]" has unmet peer dependency "react-dom@>0.13.0".
warning " > @material-ui/[email protected]" has unmet peer dependency "react-dom@^16.8.0 || ^17.0.0".
warning "@material-ui/core > @material-ui/[email protected]" has unmet peer dependency "react-dom@^16.8.0 || ^17.0.0".
warning "@material-ui/core > @material-ui/[email protected]" has unmet peer dependency "react-dom@^16.8.0 || ^17.0.0".
warning "@material-ui/core > @material-ui/[email protected]" has unmet peer dependency "react-dom@^16.8.0 || ^17.0.0".
warning "@material-ui/core > [email protected]" has unmet peer dependency "react-dom@>=16.6.0".
warning " > @material-ui/[email protected]" has unmet peer dependency "react-dom@^16.8.0 || ^17.0.0".
[4/4] Building fresh packages...
success Saved lockfile.
$ jbrowse-plugin-postinstall
patch-package 6.2.2
Applying patches...
[email protected] ✔
$ npm run build

> [email protected] prebuild
> npm run clean


> [email protected] clean
> rimraf dist


> [email protected] build
> tsdx build --format cjs,esm,umd --name JBrowsePluginMyProject

✓ Creating entry file 1.7 secs
⠙ Building modules  57%                 3.6s, estimated 6.3s
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
⠏ Building modules  98%                 6.2s, estimated 6.3s
'fs' is imported by fs?commonjs-external, but could not be resolved – treating it as an external dependency
'fs' is imported by fs?commonjs-external, but could not be resolved – treating it as an Error: Unexpected character '' (Note that you need plugins to import files that are not JavaScript)

at /home/cdiesh/src/jbrowse-plugin-template/node_modules/canvas/build/Release/canvas.node:1:0

1: ELF>0W@@�@8@  p�p�$p����$$P�td�V�V�V

Q�tdGNU���SBw��u���K|����@
                            �@"�"
   ^
2: @D0� @Ā���� �@       (�@��D)�!�      ��@"��@H@҂���d  @Hp �(%
3: J` ! F���PL`����P
                    � ���

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
@cmdcolin cmdcolin changed the title Ability to use offscreenCanvasPolyfill? Ability to use offscreenCanvasPonyfill? Aug 19, 2021
@cmdcolin
Copy link
Contributor Author

cmdcolin commented Aug 19, 2021

Maybe I found issue

It looks like there is an important path to import this from

diff --git a/src/ArcRenderer/index.js b/src/ArcRenderer/index.js
index d6070cc..bf90c9f 100644
--- a/src/ArcRenderer/index.js
+++ b/src/ArcRenderer/index.js
@@ -7,12 +7,7 @@ import {

 import { PrerenderedCanvas } from '@jbrowse/core/ui'
 import { bpSpanPx } from '@jbrowse/core/util'
-import {
-  createCanvas,
-  createImageBitmap,
-} from '@jbrowse/core/util/offscreenCanvasPonyfill'
-
-console.log({ ConfigurationSchema })
+import { createCanvas, createImageBitmap } from '@jbrowse/core/util'

@cmdcolin
Copy link
Contributor Author

I think we will also want renderToAbstractCanvas

This gives the error still

@cmdcolin
Copy link
Contributor Author

xref GMOD/jbrowse-components#2231

@cmdcolin
Copy link
Contributor Author

cmdcolin commented Sep 1, 2021

This is a working example of updating to a new renderer https://github.com/cmdcolin/jbrowse-plugin-arc-renderer with #2231 merged

@cmdcolin
Copy link
Contributor Author

cmdcolin commented Sep 1, 2021

Canvas renderer at least.

@cmdcolin cmdcolin closed this as completed Sep 1, 2021
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

No branches or pull requests

1 participant