Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 345472

Summary: [client] we should make an effort to avoid dojo in editor components!
Product: [ECD] Orion Reporter: Susan McCourt <susan>
Component: ClientAssignee: Simon Kaegi <simon_kaegi>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: bokowski, eclipse.felipe, mamacdon, mihai.sucan, nathan, simon_kaegi
Version: 0.2   
Target Milestone: 0.2   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Susan McCourt CLA 2011-05-11 13:18:51 EDT
in bug 344306, Nathan commented that having to run dojo to host the embedded editor was hardly minimal.  He is right.

The editor widget doesn't require dojo, but right now our surrounding components (editor container, the keybindings, content assist, etc.) use it.  Should we define a subset of client.core that should not be using dojo so that the editor pieces are consumable without dojo?
Comment 1 Boris Bokowski CLA 2011-05-11 14:01:12 EDT
Do you have an idea how much of Dojo we are using in that subset? If it's just a handful of things (things that come to mind are DOM access, XHR, animation) then it shouldn't be too hard to do. Of course, the question would be how we could ensure that no new Dojo dependencies creep in over time.
Comment 2 Susan McCourt CLA 2011-05-11 18:51:02 EDT
I haven't looked in detail, but I would imagine that we are mostly using the DOM utilities.  The embedded editor doesn't go getting files from the server or anything like that, it's just supposed to demonstrate stand-alone js/css/html editing where the file came "from somewhere" and there is a save hook.
Comment 3 Mark Macdonald CLA 2011-05-12 10:59:00 EDT
(In reply to comment #1)
> Do you have an idea how much of Dojo we are using in that subset?

I did a quick grep and found that embedded/minimal editor are using these (in order of most to least often)

- dojo.hitch
- dojo.byId
- dojo.connect
- dojo.Deferred, dojo.DeferredList (for content assist only)
- dojo.query, dojo.create (for content assist only)
- dojo.forEach, dojo.map (for content assist only)
- dojo.regexp.escapeString (for Find only)
- themes (dojo.css, nihilo.css)
Comment 4 Felipe Heidrich CLA 2011-06-03 16:18:10 EDT
This would be a good since the editor files are the only ones that declare global names (so they can work without requireJS), this forces dojo to end up as global too.
Comment 5 Boris Bokowski CLA 2011-06-06 14:44:42 EDT
We also use the low-level dojo animation support for animating things like go to line.
Comment 6 Simon Kaegi CLA 2011-06-17 12:25:01 EDT
It's very late in the release so what we've done is to ensure that the textview components are not using dojo and the editor components are using just the subset of dojo exposed in the base. e.g. no build required and no need for dojo runtime downloading of components etc.

e.g.
<script src="http://ajax.googleapis.com/ajax/libs/dojo/1.6/dojo/dojo.xd.js" type="text/javascript"></script>

or

<script type="text/javascript" src="/org.dojotoolkit/dojo/dojo.js.uncompressed.js"></script>

These changes are now in HEAD. (Mark reviewed)

At the moment our example is importing the dijit css files so before closing this bug for 0.2 we also want to ensure our examples look right after removing these files.
Comment 7 Simon Kaegi CLA 2011-06-17 12:27:52 EDT
Closing this for 0.2. We're tracking the changes in the examples in bug 349705.