Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embed Node.js Runtime #23

Closed
angelozerr opened this issue Aug 11, 2017 · 46 comments · Fixed by #458
Closed

Embed Node.js Runtime #23

angelozerr opened this issue Aug 11, 2017 · 46 comments · Fixed by #458

Comments

@angelozerr
Copy link
Contributor

Provide embed node.js runtime like I have done for typescript.java. It will give the capability to consumes LSP without installing node.js (VSCode does like this I think).

If you are interested, I could do a PR.

@mickaelistria
Copy link
Contributor

mickaelistria commented Aug 11, 2017 via email

@angelozerr
Copy link
Contributor Author

If you are developping JEE Application and you wish to benefit with HTML, CSS features you don't need node.js. IMHO, I think Bluesky should work without any other program installation like node.js. VSCode works like this I think.

@mickaelistria
Copy link
Contributor

There are package managers such as rpm for that. I don't think the burden should be carried by BlueSky, especially as it would drastically grow the download size and may lead users to inconsistencies ("why don't Eclipse and command-line behave the same...? [3 hours later] Ok, it's not using the same node.js!").
A simple warning pop-up if node.js is not available or version is too old should be enough.

@angelozerr
Copy link
Contributor Author

There are package managers such as rpm for that.

Take a sample. I have a computer where node.js is not installed and I want to develop HTML, CSS, JavaScript application:

  • I install VSCode, it works.
  • I install Eclipse IDE + BlueSky, it doesn't work. I don't need node.js, so I telll me why I must install node.js. I give up BlueSky and uses VSCode.

None offense with your idea, I would like just to give you some feedback with typescript.java where user like the embed node.js feature.

it would drastically grow the download size

The update site provides (like typescript.java) an optional installation of the embed node.js

@mickaelistria
Copy link
Contributor

Ok, so it could simply be a change in https://github.com/mickaelistria/eclipse-bluesky/blob/master/org.eclipse.bluesky/src/org/eclipse/bluesky/InitializeLaunchConfigurations.java#L56 to use alternative strategies:

  • If node is in PATH, use it (current)
  • If not and node is found in the Eclipse IDE installation (we could/should consume the node.js runtime packaged into some Eclipse plugin.

Doesn't JSDT already provided an embedded node.js that we could reuse (instead of writing yet-another-bundle including nodejs?) - cc @ibuziuk
Or maybe we could simply reuse the bundle that's in typescript.java

@ibuziuk
Copy link

ibuziuk commented Aug 20, 2017

Doesn't JSDT already provided an embedded node.js that we could reuse

Unfortunately, no. We wanted to bundle node.js with JSDT and opened CQ[1] (which has been approved for a couple of month by now) but literally had no bandwidth to implement it.

[1] https://dev.eclipse.org/ipzilla/show_bug.cgi?id=11306

@angelozerr
Copy link
Contributor Author

@ibuziuk thanks for your answer. Your CQ link is good?

I think it should be very cool to have an official embedjs nodejs runtime which could be consumed by tern.java, typescript.java an lsp4e/bluesky.

@ibuziuk
Copy link

ibuziuk commented Aug 21, 2017

@angelozerr good catch. I have updated CQ[1] link - node.js Version: 4.4.3

[1] https://dev.eclipse.org/ipzilla/show_bug.cgi?id=11306

@angelozerr
Copy link
Contributor Author

angelozerr commented Aug 21, 2017

Thanks @ibuziuk

current node.js is v6.11.2 . I don't remember but I think I had some trouble with tssererver/protractor or tern.java with this version. IMHO I think we should consume v6.11.2

@ibuziuk
Copy link

ibuziuk commented Aug 21, 2017

@angelozerr than new CQ should be created and one for 4.4.3 should be used as a piggyback

@jabby
Copy link
Contributor

jabby commented Sep 15, 2017

I have a little question : is node.js runtime embedded in other IDE like Netbeans and Intellij IDEA ?
I don't think that embed node.js runtime is a killer feature. A good warning should be sufficient.

@PhaserEditor2D
Copy link
Contributor

I think that there are many Eclipse projects right now using nodejs, maybe the better is to create a third project, something like the NodeRT for Eclipse project, that is just about to bundle the node runtime so it creates consistency across the different projects that require this runtime.

Then the end users can install node into eclipse optionally, and the node runtime can be updated via eclipse updates, or different versions of the runtime can be installed at the same time and the projects can use the one they need.

@mickaelistria
Copy link
Contributor

@boniatillo-com That is a good idea and it was already wished/discussed in the past without much action emerging from it. You could bring this to the appropriate Eclipse.org mailing-list and lead this initiative.

@JoyeLuo
Copy link

JoyeLuo commented Oct 13, 2017

I was wondering that is it possible that we can use it without node.js?
Like write some code to run it by the tool itself?

@mickaelistria
Copy link
Contributor

All language servers internally used by BlueSky to compute completion, hover and so on do require node.js. So node.js is a strong requirement for complete feature set.
If you're interested to contribute inclusion and shipping of node.js inside BlueSky to remove the dependency, that'd be welcome.

@paulvi
Copy link

paulvi commented Nov 1, 2017

That was @angelozerr initial proposal to do PR if there is interest,

@mickaelistria
Copy link
Contributor

See also https://bugs.eclipse.org/bugs/show_bug.cgi?id=542488 where CDT folks also consider shipping a node.js runtime.

@PhaserEditor2D
Copy link
Contributor

And VSCode is not required too?

@mickaelistria
Copy link
Contributor

And VSCode is not required too?

Nope, VSCode is not required, its interesting parts are embedded in the jars at build time.

@PhaserEditor2D
Copy link
Contributor

I think a quick solution about node is to do similar to JRE. The user (or product developers) can place node in a node folder next to the eclipse executable.

@PhaserEditor2D
Copy link
Contributor

Another simple solution is first to try with a system property, something like

-Dorg.eclipse.wildwebdeveloper.nodepath=/path/to/node

@PhaserEditor2D
Copy link
Contributor

Users can change it in the eclipse.ini and plugin developers can change it at runtime.

@mickaelistria
Copy link
Contributor

Users can change it in the eclipse.ini and plugin developers can change it at runtime.

A preference should be preferred for that.

In any case, independently of the packaging we target in fine, the method InitializeLaunchConfigurations.getNodeJSLocation() could be augmented to support more heuristic like

  • reading a preference,
  • reading a system property
  • look inside a specific folder relative to the launcher
  • ....

There is no.restriction on what conventionq we could support, as long as they seem reusable by multiple clients, so feel free to submit PRs.

@mickaelistria
Copy link
Contributor

Can Eclipse project just re-use existing third-party binary?

Yes, I think so. but as node.js will be included in some feature or bundle, it will be signed anyway.
We typically do that for all language servers.

@akurtakov
Copy link
Contributor

Mickael, should this be in wildweb or in some other project? EPP? I ask as a shellwax maintainer and shipping correct nodejs version could be of interest there too?

@akurtakov
Copy link
Contributor

@mbooth101 Mat, how would this affect flatpaks? Please raise your concerns and requirements so it's not done in a way making shipping as flatpaks harder.

@mickaelistria
Copy link
Contributor

IMO, as I don't see immediate gain in using another project, let's start with Wild Web Developer, and make it a dedicated feature that can be used by others.
Then, if later we feel it'd be better to extract it into a separate project, we'll do it.

@mbooth101
Copy link
Contributor

@mbooth101 Mat, how would this affect flatpaks? Please raise your concerns and requirements so it's not done in a way making shipping as flatpaks harder.

Hmm, I'm not too concerned. In flatpak we only ship the nodejs executable for the user's running architecture. Will this be shipping fragments for all the architectures that Eclipse supports?

@akurtakov
Copy link
Contributor

@mbooth101 Mat, how would this affect flatpaks? Please raise your concerns and requirements so it's not done in a way making shipping as flatpaks harder.

Hmm, I'm not too concerned. In flatpak we only ship the nodejs executable for the user's running architecture. Will this be shipping fragments for all the architectures that Eclipse supports?

Fragments for all archs will be available but only the current one being installed via proper filters.

@mickaelistria
Copy link
Contributor

I've started some work about it on https://github.com/mickaelistria/wildwebdeveloper/tree/nodejs . Currently, it's only showing some structure for fragments and hacking a bit the resolution of node.js location accordingly.

@akurtakov
Copy link
Contributor

@vrubezhny ^^

vrubezhny added a commit to vrubezhny/wildwebdeveloper that referenced this issue Jun 26, 2020
Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com>
vrubezhny added a commit to vrubezhny/wildwebdeveloper that referenced this issue Jun 26, 2020
Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com>
vrubezhny added a commit to vrubezhny/wildwebdeveloper that referenced this issue Jun 26, 2020
Fixes: eclipse-wildwebdeveloper#23

Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com>
vrubezhny added a commit to vrubezhny/wildwebdeveloper that referenced this issue Jun 29, 2020
Fixes: eclipse-wildwebdeveloper#23

Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com>
vrubezhny added a commit to vrubezhny/wildwebdeveloper that referenced this issue Jun 29, 2020
Fixes: eclipse-wildwebdeveloper#23

Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com>
vrubezhny added a commit to vrubezhny/wildwebdeveloper that referenced this issue Jun 29, 2020
Fixes: eclipse-wildwebdeveloper#23

Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com>
vrubezhny added a commit to vrubezhny/wildwebdeveloper that referenced this issue Jun 29, 2020
Fixes: eclipse-wildwebdeveloper#23

Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com>
@AObuchow
Copy link
Contributor

When this bug is resolved, it might be useful to allow Node to be invokable by an extension point or something similar. This would allow Eclipse project builders to be created which run JS or an npm script during auto builds. For example, being able to run Prettier from the project's node_modules directory on project save.

vrubezhny pushed a commit to vrubezhny/wildwebdeveloper that referenced this issue Jun 29, 2020
Fixes: eclipse-wildwebdeveloper#23

Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com>
vrubezhny pushed a commit to vrubezhny/wildwebdeveloper that referenced this issue Jun 30, 2020
Fixes: eclipse-wildwebdeveloper#23

Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com>
vrubezhny pushed a commit to vrubezhny/wildwebdeveloper that referenced this issue Jun 30, 2020
Fixes: eclipse-wildwebdeveloper#23

Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com>
vrubezhny pushed a commit to vrubezhny/wildwebdeveloper that referenced this issue Jun 30, 2020
Fixes: eclipse-wildwebdeveloper#23

Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com>
vrubezhny pushed a commit to vrubezhny/wildwebdeveloper that referenced this issue Jul 2, 2020
Fixes: eclipse-wildwebdeveloper#23

Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com>
vrubezhny pushed a commit to vrubezhny/wildwebdeveloper that referenced this issue Jul 2, 2020
Fixes: eclipse-wildwebdeveloper#23

Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com>
mickaelistria added a commit that referenced this issue Jul 3, 2020
Fixes: #23

Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com>
@nitind
Copy link

nitind commented Jul 27, 2020

What happens now on platforms where the embedded node isn't available, like ppc64le?

@mickaelistria
Copy link
Contributor

What happens now on platforms where the embedded node isn't available, like ppc64le?

The noxe manager will identify node isn't embedded and will then try to find node in PATH, just like it used to happen for other platforms before node embedder.

@nitind
Copy link

nitind commented Feb 11, 2021

Maybe I've got this backwards, but is WWD supposed to require the embedder?

Screen Shot 2021-02-11 at 3 59 56 PM

@mickaelistria
Copy link
Contributor

IIRC, it's an optional greedy requirement, so it gets installed by default, and then users can uninstall it.
But it's a bit messy from user perspective, https://bugs.eclipse.org/bugs/show_bug.cgi?id=562679 and https://bugs.eclipse.org/bugs/show_bug.cgi?id=562678 would need some love to better cover this story.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.