Bug 466081 - [tern] Hook Tern up to model / file changed listeners
Summary: [tern] Hook Tern up to model / file changed listeners
Status: RESOLVED FIXED
Alias: None
Product: Orion (Archived)
Classification: ECD
Component: JS Tools (show other bugs)
Version: 8.0   Edit
Hardware: All All
: P2 major (vote)
Target Milestone: 12.0   Edit
Assignee: Michael Rennie CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
: 474420 (view as bug list)
Depends on:
Blocks: 493580
  Show dependency tree
 
Reported: 2015-05-01 10:16 EDT by Michael Rennie CLA
Modified: 2016-06-09 14:52 EDT (History)
0 users

See Also:


Attachments
POC (3.86 KB, patch)
2016-05-27 12:36 EDT, Michael Rennie CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Rennie CLA 2015-05-01 10:16:47 EDT
Currently when we make a request of Tern we send the file array with it. It would be better if we only removed / updated files in Tern based on what the workspace says. This would save inferencing time for dependencies that have not changed and other places.
Comment 1 Michael Rennie CLA 2015-06-17 00:28:19 EDT
Moving out of 9.0 and lowering priority, I found that having the worker handle changed* events causes some very bad behaviour when the Tern server is in the middle of an operation and an even causes a file Tern is using to be removed or updated.

The proper fix will require a proxy of sorts to be able to tell Tern to cancel what it is doing if an in-use file has been changed (currently the version of the server we use does not have support for this).
Comment 2 Michael Rennie CLA 2016-05-06 21:41:19 EDT
We can also use the new js project context as a way to know when files have been deleted / renamed / moved / created - allowing us to update Tern accordingly.
Comment 3 Michael Rennie CLA 2016-05-27 12:36:50 EDT
Created attachment 262085 [details]
POC

This patch adds a client-side edited state cache. If the file has not been changed, sanitize the request to not forward the source as part of the files array - which avoid an entire parse + infer pass in the worker for that (and subsequent) requests.
Comment 5 Michael Rennie CLA 2016-06-09 14:52:42 EDT
*** Bug 474420 has been marked as a duplicate of this bug. ***