-
Notifications
You must be signed in to change notification settings - Fork 295
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
Problems using the module build #427
Comments
You are correct that the dependent-project example is out of date. Note though that the module build is unrelated to that example --- it was added to support https://github.com/neuroglancerhub/react-neuroglancer In general there are 3 ways to consume neuroglancer as a dependency:
|
Thanks for clarifying. We're still playing around with those options. With the iframe approach we also got types on the viewer object to work, via "compilerOptions": {
"strict": false,
"noImplicitOverride": false,
"noPropertyAccessFromIndexSignature": false,
"strictPropertyInitialization": false,
"useUnknownInCatchVariables": false,
"strictNullChecks": true,
"noImplicitAny": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"noImplicitThis": true,
"noUnusedParameters": true,
"noUnusedLocals": true,
"preserveConstEnums": true,
"moduleResolution": "node",
"importHelpers": true,
"target": "es2020",
"module": "es2020",
"lib": [
"es2020",
"dom",
"dom.iterable"
],
"typeRoots": [],
"paths": {
"neuroglancer/*": [
"lib/neuroglancer/src/neuroglancer/*"
]
} |
What would we need to get an actual node package for Neuroglancer working, so that it could be imported like any other dependency? Is the problem just the Right now I'm essentially forking Neuroglancer in order to use it as a "dependency". |
We're trying to embed Neuroglancer (master) into an Angular project.
Attempt: Consume the module build
Building the module with
npm run build-module
worked fine. But following the readme from examples/dependent-project I was unable to get the example to work. I think it's because the example uses webpack, while the main project has switched to esbuild.So the dependent-project seems unmaintained? (If so, maybe add a note about that?)
Importing and calling
setupDefaultViewer()
from Angular (vianpm link
) didn't work:codemirror
dependency that emitted compatibility-import statements that work in the browser, but caused errors from when bundling with Angular. After fixing those directly in node_modules,@babel/runtime
was missing, etc.esbuild
.neuroglancer
's dependencies (package.json
) any more.config/esbuild/
to create a module build withbundle: true,
. Got it to build, but didn't find the module entry point in the bundled result.Do you think it is useful to proceed with that approach? (Would you want a PR doing a bundled module build?)
Alternative: Embed the main build via <iframe>
This is described in this comment from issue 324 and works just fine so far. We can access the
viewer
object from the<iframe>
's window, configure it, even subscribe to events.The main drawback seems to be that we cannot import and control the initial config / viewer creation.
The text was updated successfully, but these errors were encountered: