Community
Participate
Working Groups
Currently there are some strong dependencies between various scripts - dependencies that are not strictly needed. For example, tooltip.js is required in rulers.js even if the integrator doesn't need/use tooltips and annotations. Such requirements make us integrate more code than needed - making it harder to track between updates what relevant changes have happened. Would it be possible to soften the dependencies between scripts? I'll submit a proposed patch, but I assume you guys have better thoughts on this. Thank you!
Proposed patch: https://github.com/mihaisucan/orion.client/tree/bug-364401 The approach is simply finetuning the existing code, actually. The existing code already checks if there's no annotation model, or no tooltip, but it doesn't check if the actual modules are available or not. This avoids breakage when we elect to not include some scripts (like tooltip.js, annotations.js and projectionTextModel.js) that we don't use features from (no tooltips/annotations/code folding). Any thoughts? Would this be acceptable? Or is this not a valid concern? (as in, we should not bother - just include all code needed.) Thanks!
I think that is okay (I like fine tuning of the files being loaded), except that the change proposed in the patch only makes sense for non-requirejs users (using the global.js adaptor). In the requirejs case, if the dependency is not loaded then the require/define call fails, thus it is not needed to test if mWhatever is defined. Is there a way to specify, in requirejs, that a module is optional ? or am I missing something here ?
(In reply to comment #2) > I think that is okay (I like fine tuning of the files being loaded), except > that the change proposed in the patch only makes sense for non-requirejs users > (using the global.js adaptor). > > In the requirejs case, if the dependency is not loaded then the require/define > call fails, thus it is not needed to test if mWhatever is defined. > > Is there a way to specify, in requirejs, that a module is optional ? > or am I missing something here ? I haven't seen anything like this in the requirejs API. But here's what I found... https://github.com/jrburke/requirejs/pull/16 (see the last comment) As I understand one can write a loader plugin to make deps optional.
Thanks for the link, I added comments to the feature request.
Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see: https://dev.eclipse.org/mhonarc/lists/orion-dev/msg03444.html