| Summary: | Soften dependencies between scripts | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Mihai Sucan <mihai.sucan> |
| Component: | Editor | Assignee: | Project Inbox <orion.editor-inbox> |
| Status: | RESOLVED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | eclipse.felipe, mihai.sucan, Silenio_Quarti, simon_kaegi |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Mihai Sucan
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 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 |