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

Bug 369004

Summary: Navigator loads editor
Product: [ECD] Orion Reporter: Mark Macdonald <mamacdon>
Component: ClientAssignee: John Arthorne <john.arthorne>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: grant_gayed, john.arthorne, libingw, simon_kaegi, susan
Version: 0.4   
Target Milestone: 0.4 M2   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Mark Macdonald CLA 2012-01-18 15:13:14 EST
Orion HEAD 2012-01-18

I'm seeing that visiting the Orion navigator (/navigate/table.html) starts a big chain of module loads which eventually pulls in editor.js and all its related files (contentAssist.js, textView.js, etc.).

The editor and navigator should be separate.
Comment 1 Mark Macdonald CLA 2012-01-23 10:45:09 EST
The dependency chain is:

 table -> searchClient -> searchExplorer -> compare-container -> editor
Comment 2 Susan McCourt CLA 2012-01-23 12:23:45 EST
hmmm...so we need to make searchClient more encapsulated.  
Why don't we have this problem on every single page with the search box?  

Simon, thoughts?  Do we need to make the search client a plug-in, would that help to hide its implementation?
Comment 3 Mark Macdonald CLA 2012-01-23 13:06:38 EST
(In reply to comment #2)
> hmmm...so we need to make searchClient more encapsulated.  
> Why don't we have this problem on every single page with the search box?  

Actually... we do. Sites, Repositories, Settings and Plugins all have the same issue.
Comment 4 John Arthorne CLA 2012-01-23 13:22:33 EST
(In reply to comment #2)
> Simon, thoughts?  Do we need to make the search client a plug-in, would that
> help to hide its implementation?

I think it should be possible to break searchClient.js into two modules. It currently has two roles:

1) Generating queries and performing search
2) Rendering search results

Most clients need 1), but not 2). But 2) is what pulls in all the dependencies.
Comment 5 John Arthorne CLA 2012-01-23 14:41:57 EST
I'll take a look at this.
Comment 6 John Arthorne CLA 2012-01-23 16:53:19 EST
Fixed with:

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=3564db88ae52c5589cb1622434cf728e8daff6ff

This was fairly straight-forward once all the dependencies were unraveled. We already have a searchResults.js script that has the job of rendering search results on the search results page. I moved all code from searchClient.js related to "complex" search result rendering into that script. I.e., the representation of search results that uses the search explorer widget that refers to the editor.

What's left in searchClient is used by the global banner and other pages like the editor which need to perform searches but with "simple" search results list (Open Resource, and Ctrl+H search in editor). For these cases we don't need to pull in the search explorer widget (and hence the editor).
Comment 7 John Arthorne CLA 2012-01-24 09:25:24 EST
Verified in I20120123-2230.

The built-navigator.js went from 841KB yesterday to 523KB today.