When a developer's system suits the supported OSs (Linux, MacOS and Win32) and architectures (x86_64, aarch64) the embedded Node.js from Wild Web Developer will be used by WildWebDeveloper to run language Servers as well as for Node Debugger unless the "org.eclipse.wildwebdeveloper.nodeJSLocation"
system property is set.
The WildWebDeveloper project always aims to embed the latest LTS (Long Term Support) version of Node.js available for the download at NodeJS.org, however it's not always possible due to the needs of testing, fixing the issues found if any and the IP Team Due Diligence Process which may take quite a long time.
However, due to different reasons, the projects may be in need of use either the latest available Node.js version, or a specific one, for example, because of their internal Due Diligence processes, or a custom version, for example, because of the company internal restriction rules on 3rd-party software installation and usage. In such cases, the users can force WWD to use such a specific Node.js version by adding the following property to their WWD eclipse.ini
configuration file:
-Dorg.eclipse.wildwebdeveloper.nodeJSLocation==<Path-to-Node.js-executable>
This property will force WWD to use the specified Node.js installation instead of the embedded one.
It's still recommended the use of LTS Node.js versions - as their functionality is tested in conjunction with WWD as well as they are supposed to be stable and secure.
(From eclipse-wildwebdeveloper#331 (comment) )
- Right-click on project > Properties > Builders
- Click "New", select "Program"
- location => path to tsc (can be
${system_path:tsc}
; working directory => project directory (can be${project_loc}
); arguments... - In Build Options a. select "Launch in background" b. select "During auto-build" c. select the interesting typescript source folder in "Select working set of relevant resources" to include the source folder.
- in Refresh, select what needs to be refreshed upon build.
- Ensure the
sourceMap
property of yourtsconfig.json
is set totrue
. Exampletsconfig.json
:
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"outDir": "out",
"sourceMap": true
}
}
- Run
tsc
to transpile your TypeScript source code to JavaScript. - Right click on TypeScript you want to debug (eg.
index.ts
) => Debug as => Node program - If a breakpoint is set in your
.ts
source file, it will be hit when the equivalent JavaScript code is run.
- Ensure the
sourceMap
property of yourtsconfig.json
is set totrue
. Exampletsconfig.json
:
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"outDir": "out",
"sourceMap": true
}
}
- Run
tsc
to transpile your TypeScript source code to JavaScript. - Right click on the entry point of your website (eg.
index.html
) => Debug as => Chrome Debug - If a breakpoint is set in your
.ts
source file, it will be hit when the equivalent JavaScript code is run.
- Start your web app's Node.JS web server (usually done through a NPM script in your package.json, eg.
npm start
). This can be done through the commandline or by right-clicking on a package.json in the Project Explorer => Run as => NPM... - Once your web app is running, take note of the local URL it's running on. For React project's, it's by default
http://localhost:3000/
- Right click on your project's root directory in the Project Explorer => Debug as => Debug configurations...
- Create a launch or attach debug configuration for Chrome or Firefox, depending on your preference.
- For launch debug configurations, select the URL radio button and enter the URL from step 2. For attach debug configurations, simply enter the URL from step 2.
- Ensure the working directory is correctly set to your project's root folder.
- Click
apply
followed bydebug
in the bottom right corner of the debug configuration
- Open the HTML file with the Generic Editor for edition.
- From the Edition context menu, the Project Explorer or other explorer, open this same HTML file with the Internal Web Browser.
- Drag the editor/browser to get them side by side or stacked one on top of the other in the IDE.
- In the Web Browser, click the arrow besides the refresh button, and select "Auto-refersh local changes"
Add the following property to the WWD eclipse.ini
configuration file:
-Dorg.eclipse.wildwebdeveloper.maxTsServerMemory=<memory in megabytes>
This will set the maximum size of V8's old memory section for the JavaScript/TypeScript language server. Values are in megabytes, for example 4096
means 4GB. The default value is dynamically configured by Node.js so can differ per system. Increase for very big projects that exceed allowed memory usage.
Developers may reuse the Node.js Embedder in their products.
Run Eclipse with the following JVM property, e.g. set in eclipse.ini
:
-vmargs
...
-Dorg.eclipse.wildwebdeveloper.xml.internal.XMLLanguageServer.debugPort=8001
Note this is a JVM property you set in the parent JVM (the Eclipse IDE) so that the (LemMinX) XML Language Server child process gets started, suspended, in debug mode, waiting for the debugger attachment. You can set the property's value to a different port if you'd like to select a different port value (than 8001 in the example).
Run Eclipse with the following JVM property, e.g. set in eclipse.ini
:
-vmargs
...
-Dorg.eclipse.wildwebdeveloper.xml.internal.XMLLanguageServer.log.level=all
Note this is a JVM property you set in the parent JVM (the Eclipse IDE) to take effect within the (LemMinX) XML Language Server child process.
The LemMinX process will use this property value as the "level" for its "root" Logger.
This workflow doesn't support the full set of java.util.logging function: handlers/formatters/etc. The normal handler registration (e.g. ConsoleHandler) is disabled and in its place a handler is created which writes the log messages to the file: <workspace-root>/.metadata/lemminx.log
. Currently this handler is coded to only log messages at Level.INFO or higher.