Splitting the library into modules and removing jquery
See original GitHub issueSome of us would like to see a minimal and a decoupled version of this library without the jquery dependency and other shiny stuffs (tools, handlers…) .
this will open up the road for multiple frameworks and Gui development. i’m using react and started about a week ago trying to figure out how to approach this to make a react wrapper around it , and its seems like this library was written with strong presemptions (jquery ) .
i think that using a 250 kb library (jquery ) just for handling events and a couple of ui interactions is a waste , event attachments can be done in vanilla javascript and its dead simple
var eventData = { element : element };
var event1 = new CustomEvent("CornerstoneElementDisabled", eventData);
element.dispatchEvent(event1);
the core of this library can be more “modular” with different npm packages , each one doing nothing else than its own work ( no props passing…) . This will bring more people into it. and this will allow to other people to write plugins and modules for it.
documentation needs to be clarified with a good and detailed tutorial with the bare minimal requirements (cornerstone, codecs , wado loader ) no jquery, no tools , nothing else , just the code to transform a dicom into an array of pixels and display it on a canvas.
An example of a dead simple tool module (without jquery ) would be helpful too.
Of course most of us could decouple this in a couple of days , but the guys who wrote this can do it 10 times faster .
And i would like to thank you all , especially @chafey for the huge amount of work he has given to the community.
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (3 by maintainers)
The bulk of this work seems to have transitioned to the event and deferred issues that are currently being worked on. I’m going to close this. Feel free to monitor:
For related progress. To varying degrees, some of the jQuery work mentioned here has already been completed.
Yes , good point , no breaking change , and some documentation about it. the branch seems to be clean , now we just have to be sure that the polyfills works correctly and the tools (with jquery) works fine too.
I think you need to announce it before the release . concerning the tools , we’re all aware that it will be harder to avoid the use of jquery since its heavily dependent on it. but we can keep it that way for now, and rewrite / release tool by tool later . it will also help to decouple the tools , which means they will be easier to maintain (bug tracking , issues, releases…).