question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Splitting the library into modules and removing jquery

See original GitHub issue

Some 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:closed
  • Created 7 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dannyrbcommented, Nov 14, 2017

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.

1reaction
Revln9commented, May 11, 2017

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…).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Does it make sense to split jQuery into smaller modules? #2138
Therefore, I'm asking: Does it make sense to split this module into smaller ones so that developers can cherry pick the methods they...
Read more >
javascript - Module pattern- How to split the code for one ...
How do I split the code? I can think of a few ways, like use a hierachy of namespaces, or expand the object...
Read more >
Code Splitting - webpack
This feature allows you to split your code into various bundles which can then be loaded on demand or in parallel. It can...
Read more >
[Plan] Remove unused jQuery UI components and replace ...
1. Contrib project for jquery.ui.accordion that provides the library definition only for accordion. 2. Deprecate jquery.ui.accordion in core ...
Read more >
jQuery: Using Only What You Need - Telerik Blogs
This means you can use AMD to load individual pieces of jQuery, and not the whole library. In this article you'll see which...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found