This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 519774 - Clear up dependency tree between jsdt and source editing
Summary: Clear up dependency tree between jsdt and source editing
Status: RESOLVED FIXED
Alias: None
Product: JSDT
Classification: WebTools
Component: Web (show other bugs)
Version: 3.9 (Oxygen)   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.10 M3   Edit
Assignee: Project Inbox CLA
QA Contact: Victor Rubezhny CLA
URL:
Whiteboard:
Keywords:
Depends on: 520044
Blocks: 525342
  Show dependency tree
 
Reported: 2017-07-17 12:46 EDT by Rob Stryker CLA
Modified: 2017-12-20 13:11 EST (History)
3 users (show)

See Also:


Attachments
diff update site before/after applying patch (189.03 KB, image/png)
2017-09-05 16:13 EDT, Nick Boldt CLA
no flags Details
diff update site before/after applying patch (part 2) (193.23 KB, image/png)
2017-09-05 16:13 EDT, Nick Boldt CLA
no flags Details
patch removing dependency from jsdt on sourceediting (33.78 KB, patch)
2017-09-08 23:03 EDT, Nitin Dahyabhai CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rob Stryker CLA 2017-07-17 12:46:17 EDT
As mentioned on wtp-dev, it's time to break the circular dependency between sourceediting and jsdt. I believe history indicates jsdt should be below sourcedeiting on the tree (installable just on platform), but whether that's feasible to maintain at this point depends on the discussion this bug generates.
Comment 1 Rob Stryker CLA 2017-09-05 13:29:14 EDT
Repo:  
git clone ssh://${GITUSER}@git.eclipse.org:29418/jsdt/webtools.jsdt.git

Plugins that can move to JSDT:  

org.eclipse.wst.jsdt.web.core	
org.eclipse.wst.jsdt.web.support.jsp
org.eclipse.wst.jsdt.web.ui
Comment 2 Nitin Dahyabhai CLA 2017-09-05 14:43:15 EDT
I'm not sure there was agreement on how to break the cycle. If the goal was to make the repositories buildable per-repository in a sane order, wouldn't breaking the small dependency from JSDT to SSE (as I said at https://dev.eclipse.org/mhonarc/lists/wtp-dev/msg10393.html) be the simpler, less disruptive move?
Comment 3 Eclipse Genie CLA 2017-09-05 16:08:35 EDT
New Gerrit change created: https://git.eclipse.org/r/104394
Comment 4 Nick Boldt CLA 2017-09-05 16:13:00 EDT
Created attachment 270087 [details]
diff update site before/after applying patch

After applying https://git.eclipse.org/r/104394 - which disables building these 5 plugins ... 

  bundles/org.eclipse.wst.jsdt.web.core
  bundles/org.eclipse.wst.jsdt.web.support.jsp
  bundles/org.eclipse.wst.jsdt.web.ui
  tests/org.eclipse.wst.jsdt.web.core.tests
  tests/org.eclipse.wst.jsdt.web.ui.tests

... - you'll end up with a much smaller update site in webtools.sourceediting/site/target/repository/ since I've removed all the feature (and plugin) inclusions for org.eclipse.wst.jsdt.*

This will stop sourceediting from depending on jsdt.
Comment 5 Nick Boldt CLA 2017-09-05 16:13:31 EDT
Created attachment 270088 [details]
diff update site before/after applying patch (part 2)
Comment 6 Nick Boldt CLA 2017-09-05 16:16:01 EDT
In addition to the PR linked on this BZ, I also provided this cleanup fix for .gitignores and storage of generated (binary) files in github:

https://git.eclipse.org/r/104393

That should mean that when you build you don't suddenly have dirty changes in your workspace (which could accidentally be committed!).

This fix also enables us to use the jgit timestamp provider (should we want that in future), as the workspace remains clean during and after a build.
Comment 7 Victor Rubezhny CLA 2017-09-06 15:44:41 EDT
@Nitin, the problem is that we've dropped JSDT model a while ago, and provided WST based validation for validation job and in reconciler instead.
 
JSDT cannot be used as a standalone product since Neon.
Comment 8 Nitin Dahyabhai CLA 2017-09-08 23:03:34 EDT
Created attachment 270131 [details]
patch removing dependency from jsdt on sourceediting

(In reply to Victor Rubezhny from comment #7)
> @Nitin, the problem is that we've dropped JSDT model a while ago, and
> provided WST based validation for validation job and in reconciler instead.

That part's fine, good even since it removed a considerable amount of confusion for users dealing with a builder for *.js files and a validator for web pages. I still contend that the dependency story can be changed back to SSE->JSDT->Common and JSDT->Common by reversing some of the changes in the UI plug-in.

JavascriptReconcilingStrategy used to handle source validation, but when the SSE source validation was put in, this was broken. By restoring a little bit of what was deleted then, it's possible to drop the SSE dependency and the new classes that were created to contain it*. I'm not certain about some of the AST flags involved, but this change should break the loop in the repository dependencies. Someone with more recent experience using the editor would be better suited to determining if the functionality that should be there, after the JSDT model was scaled back, is still there with this change.

I also removed the validator's membership to the org.eclipse.wst.sse.core.structuredModelGroup group. It's only a benefit for content types that SSE supports, keeping the model in memory while all of the applicable validators are run on those files. It serves no purpose for JavaScript files, and makes JS validation slower than it would otherwise be. I'd suggest this part regardless of the rest.
Comment 9 Rob Stryker CLA 2017-09-28 16:17:19 EDT
I have to say, I find this discussion slightly silly. 

Once SSE repos are merged together, a quick analysis shows that jsdt will only actually depend on sse.core and sse.ui,   NOT any of the json / xml / xsl / xpath / web stuff also in the sse repo. 

I think it is 100% reasonable to have jsdt depend on sse.core / sse.ui (ie the core part of sse). It won't bring in so much of wtp at all. It's in fact quite slim. 

I still believe strongly that moving the 3 jsdt plugins into the jsdt repo, and having jsdt depend on sse.core/sse.ui,  is not that problematic at all. These are just core APIs with very limited effect on a user's installation size.
Comment 10 Rob Stryker CLA 2017-10-02 14:21:36 EDT
My last comment was a bit misleading.  It all depends how we treat the 3 jsdt plugins that live in sse. Those obviously depend on all of sse, including xml, xpath, etc etc.  I still don't really know what those 3 plugins do, but they seem to depend on a lot. 

But the stuff currently in jsdt repo only depends on sse.core and sse.ui. This doesn't seem so objectionable tome.
Comment 11 Victor Rubezhny CLA 2017-10-03 21:31:39 EDT
(In reply to Nitin Dahyabhai from comment #8)
> Created attachment 270131 [details]
> patch removing dependency from jsdt on sourceediting
> 
> (In reply to Victor Rubezhny from comment #7)
> > @Nitin, the problem is that we've dropped JSDT model a while ago, and
> > provided WST based validation for validation job and in reconciler instead.
> 
> That part's fine, good even since it removed a considerable amount of
> confusion for users dealing with a builder for *.js files and a validator
> for web pages. I still contend that the dependency story can be changed back
> to SSE->JSDT->Common and JSDT->Common by reversing some of the changes in
> the UI plug-in.
>

@Nitin
I'm not arguing against this, but we aren't able to reverse the ui code...
 
> JavascriptReconcilingStrategy used to handle source validation, but when the
> SSE source validation was put in, this was broken. By restoring a little bit
> of what was deleted then, it's possible to drop the SSE dependency and the
> new classes that were created to contain it*. I'm not certain about some of
> the AST flags involved, but this change should break the loop in the
> repository dependencies. Someone with more recent experience using the
> editor would be better suited to determining if the functionality that
> should be there, after the JSDT model was scaled back, is still there with
> this change.

and here is why: The jsdt model is a completely outdated thing nowadays. We cannot use the following:

>>>>> start cut >>>>>
 bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/JavascriptReconcilingStrategy.java 
index 1d16bb5..b588dff 100644

[...]

int reconcileFlags= IJavaScriptUnit.FORCE_PROBLEM_DETECTION
	| (ASTProvider.SHARED_AST_STATEMENT_RECOVERY ? IJavaScriptUnit.ENABLE_STATEMENTS_RECOVERY : 0)
	| (ASTProvider.SHARED_BINDING_RECOVERY ? IJavaScriptUnit.ENABLE_BINDINGS_RECOVERY : 0);
ast[0]= unit.reconcile(ASTProvider.SHARED_AST_LEVEL, reconcileFlags, null, fProgressMonitor);

>>>>> end cut >>>>>

we should use the only:

JavaScriptPlugin.getDefault().getASTProvider().getAST(unit, ASTProvider.WAIT_ACTIVE_ONLY, fProgressMonitor);

in order to generate ASTs and this doesn't provides/updates the old jsdt-model. (We just had no time enough to cut and clear the obsolete code)

Thus I can accept your patch only if it's modified so it doesn't change JavascriptReconcilingStrategy (see the lines mentioned above), which kills all the validation.

The way you proposed is a simple one to split the dependencies (with the mentioned exclusion), but doing it this way the validation is to be re-developed from the scratch.
Comment 12 Eclipse Genie CLA 2017-10-04 14:55:39 EDT
New Gerrit change created: https://git.eclipse.org/r/106236
Comment 13 Nick Boldt CLA 2017-10-04 16:05:36 EDT
To build this locally without using -Pintegration profile (in order to find all the dependencies and resolve them by building locally) you need to build these projects in order:

* webtools.common
* webtools.servertools (after merging the repos)
* webtools.javaee (to resolve webtools.javaee/plugins/org.eclipse.jst.common.frameworks)
* webtools.releng/org.eclipse.wtp.releng.versionchecker
* webtools.releng/tests/org.eclipse.wtp.releng.tests

Then you can build webtools.jsdt from its root pom, like this:

`mvn clean install -DskipTests -Dwebtools.buildSite=http://download.eclipse.org/webtools/downloads/drops/R3.9.1/R-3.9.1-20170912000144/ -Dtycho.version=1.0.0 -Dtycho-extras.version=1.0.0`

If you don't build all the above first, you need the -Pintegration flag to resolve all the above dynamically.

+1 for this patch [1], let's get it merged ASAP.

[1] https://git.eclipse.org/r/#/c/106236/1
Comment 14 Eclipse Genie CLA 2017-10-04 16:08:28 EDT
New Gerrit change created: https://git.eclipse.org/r/106239
Comment 15 Eclipse Genie CLA 2017-10-04 16:09:41 EDT
New Gerrit change created: https://git.eclipse.org/r/106240
Comment 16 Rob Stryker CLA 2017-10-05 10:16:14 EDT
Hi Guys:

Nitin's patch cleared up the dependency, but it killed as-you-type validation. Nitin's attempt to fix as-you-type was vetoed by Victor as no longer viable, due to the code base changing too much. 

So Victor's answer is to simply break the circular dependency, but kill as-you-type validation. I did not like this solution. So I set about to fix it. 

Rather than deleting the 3 files as Nitin and Victor's patches did, I moved them into jsdt.web.ui, the project inside sse with access to sse APIs AND jsdt api's. 

The last step was to leave a stub / delegating class in jsdt that could load from an extension point. Then, have jsdt.web.ui implement that extension point with the moved implementation. 

In this way, as-you-type validation is maintained. SSE depends on JSDT. And everything continues working as today. 

I strongly support these patches. 

jsdt patch:   https://github.com/robstryker/webtools.jsdt/commits/519774
sse patch:    https://github.com/robstryker/webtools.sourceediting/commits/519774

Please give these two patches the full consideration. I believe they are the proper solution and nobody should have any real reason to reject them.
Comment 17 Eclipse Genie CLA 2017-10-05 12:09:08 EDT
New Gerrit change created: https://git.eclipse.org/r/106303
Comment 18 Eclipse Genie CLA 2017-10-05 12:09:41 EDT
New Gerrit change created: https://git.eclipse.org/r/106304
Comment 21 Eclipse Genie CLA 2017-11-02 17:18:37 EDT
New Gerrit change created: https://git.eclipse.org/r/110946
Comment 22 Eclipse Genie CLA 2017-11-16 17:26:21 EST
New Gerrit change created: https://git.eclipse.org/r/111757
Comment 24 Eclipse Genie CLA 2017-11-20 17:50:37 EST
New Gerrit change created: https://git.eclipse.org/r/111934
Comment 26 Nick Boldt CLA 2017-12-20 13:11:03 EST
FYI

In the R3_9_maintenance branch of releng.agg, we must now use webtools.jsdt from  master branch, since:

* sse plugin wst.jsdt.web.ui requires 
* jsdt plugin org.eclipse.wst.jsdt.ui 2.0.301, 

which is only in master (not R3_9_1a tag). Thus:

http://git.eclipse.org/c/webtools/webtools.releng.aggregator.git/commit/?h=R3_9_maintenance

(Aside: why is are there jsdt plugins in the sse repo? Naming conventions in WTP are confusing.)