-
Notifications
You must be signed in to change notification settings - Fork 29
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
improve HiGlass packaging / types #702
Comments
💯 agreed. Some additional thoughts:
|
I think we can close this issue as we are working on removing the HiGlass dependency. I linked this issue from #1113. |
Motivation
HiGlass is well implemented and a core dependency of Gosling. However, it is untyped and packaged as a pre-bundled UMD JavaScript file. (pre-bundled meaning all dependencies except
react
,react-dom
andpixi.js
are included inhglib.js
. This has lead to workarounds and inconsistencies in this repo, which could likely be solved all together by spending some time on improving how HiGlass is packaged.Examples
Maintenance of HiGlass "types" in this repo. Requires us to keep this repo in sync with HiGlass repo. If HiGlass published types from source code, then there is one place to make changes.
Code interfacing with
higlass
or higlass-modules (e.g.,higlass-register
) are almost entirely untyped. It works for now, but we could have much more confidence in this code which is so fundamental. Basically all data-fetchers are typed asany
, and so much of the source code is just copied-pasted from elsewhere.gosling.js/src/core/higlass-component-wrapper.tsx
Lines 7 to 8 in c00f4f8
gosling.js/src/core/init.ts
Lines 1 to 4 in 8bcbe7e
Shared modules in
higlass
andgosling.js
aren't consistently accessed (imported vs used viaHGC.libraries.*
. For example, thed3-scale
ends up twice in any gosling bundle (once from higlass and once from our import).gosling.js/src/gosling-track/gosling-track.ts
Line 111 in dfc7c0d
gosling.js/src/core/mark/grid.ts
Line 1 in 1881e7d
Improving how HiGlass is packaged would make it so that much less code is duplicated, and decrease our large bundle sizes.
Conclusion
I'm not sure if any of this is on the Gosling roadmap, but as we continue to add features I think it's important to consider how we could improve its foundation for greater long-term stability. We have come up with a lot of ad-hoc solutions in this repo for using
higlass
more like a module, but many of those solutions would be eliminated and improved if we spent some time cleaning up higlass for our use case.The text was updated successfully, but these errors were encountered: